Showing the changes to tests/script-engine/src/ScriptEngineTests.cpp (1 of 4 files). Show all
Unified · Split
| @@ -12,6 +12,8 @@ · 11 unmodified lines | ||
| 12 | 12 | #include "StatTracker.h" |
| 13 | 13 | |
| 14 | 14 | #include "NodeList.h" |
| 15 | +#include "../../../libraries/entities/src/EntityScriptingInterface.h" | |
| 16 | +//#include "../../../libraries/entities/src/EntityScriptingInterface.h" | |
| 15 | 17 | |
| 16 | 18 | QTEST_MAIN(ScriptEngineTests) |
| 17 | 19 | |
| @@ -43,7 +45,7 @@ void ScriptEngineTests::initTestCase() { · 25 unmodified lines | ||
| 43 | 45 | DependencyManager::set<ResourceRequestObserver>(); |
| 44 | 46 | DependencyManager::set<StatTracker>(); |
| 45 | 47 | DependencyManager::set<ScriptInitializers>(); |
| 46 | − | |
| 48 | + DependencyManager::set<EntityScriptingInterface>(true); | |
| 47 | 49 | |
| 48 | 50 | QSharedPointer<ScriptEngines> ac = DependencyManager::get<ScriptEngines>(); |
| 49 | 51 | QVERIFY(!ac.isNull()); |
| @@ -75,8 +77,8 @@ void ScriptEngineTests::scriptTest() { · 25 unmodified lines | ||
| 75 | 77 | QSharedPointer<ScriptEngines> ac = DependencyManager::get<ScriptEngines>(); |
| 76 | 78 | QVERIFY(!ac.isNull()); |
| 77 | 79 | |
| 78 | − | |
| 79 | − QDir testScriptsDir("tests"); | |
| 80 | + // TODO: can we execute test scripts in serial way rather than parallel | |
| 81 | + /*QDir testScriptsDir("tests"); | |
| 80 | 82 | QStringList testScripts = testScriptsDir.entryList(QStringList() << "*.js", QDir::Files); |
| 81 | 83 | testScripts.sort(); |
| 82 | 84 | |
| @@ -84,14 +86,15 @@ void ScriptEngineTests::scriptTest() { · 1 unmodified line | ||
| 84 | 86 | script = "tests/" + script; |
| 85 | 87 | qInfo() << "Running test script: " << script; |
| 86 | 88 | ac->loadOneScript(script); |
| 87 | − } | |
| 89 | + }*/ | |
| 90 | + ac->loadOneScript("tests/script-engine/tests/003_vector_math.js"); | |
| 88 | 91 | |
| 89 | 92 | qDebug() << ac->getRunning(); |
| 90 | 93 | |
| 91 | − | |
| 92 | − while (true) { | |
| 94 | + // TODO: if I don't have infinite loop here, it exits before scripts finish. It also reports: QSignalSpy: No such signal: 'scriptCountChanged' | |
| 95 | + for (int n = 0; n > -1; n++) { | |
| 93 | 96 | QSignalSpy spy(ac.get(), SIGNAL(scriptCountChanged)); |
| 94 | − spy.wait(3000000); | |
| 97 | + spy.wait(1000); | |
| 95 | 98 | qDebug() << "Signal happened"; |
| 96 | 99 | } |
| 97 | 100 | //spy.wait(5000); |