History

Initial support for a directory with test scripts

This way there's no need to rebuild the test every time. Script dir is symlinked from the source into the binary dir.

Dale Glass committed 4 years ago

Commit e1c22b51 parent be3d1715 files · +36 −4Browse files

Showing the changes to tests/script-engine/src/ScriptEngineTests.cpp (1 of 5 files). Show all

Unified · Split

tests/script-engine/src/ScriptEngineTests.cpp+10−4
@@ -76,10 +76,16 @@ void ScriptEngineTests::scriptTest() { · 75 unmodified lines
7676 QVERIFY(!ac.isNull());
7777
7878
79− ac->loadOneScript("test1.js");
80− //ac->loadOneScript("test-missing.js");
81− //ac->loadOneScript("test-hello.js");
82− //ac->loadOneScript("test-divide-by-zero.js");
79+ QDir testScriptsDir("tests");
80+ QStringList testScripts = testScriptsDir.entryList(QStringList() << "*.js", QDir::Files);
81+ testScripts.sort();
82+
83+ for(QString script : testScripts) {
84+ script = "tests/" + script;
85+ qInfo() << "Running test script: " << script;
86+ ac->loadOneScript(script);
87+ }
88+
8389 qDebug() << ac->getRunning();
8490
8591