History

Review fix: add flag to choose whether to abort script on exception

Dale Glass committed 3 years ago

Commit acd19f71 parent aec756b4 files · +34 −6Browse files

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

Unified · Split

tests/script-engine/src/ScriptEngineTests.cpp+8−2
@@ -57,6 +57,8 @@ ScriptManagerPointer ScriptEngineTests::makeManager(const QString &scriptSource, · 56 unmodified lines
5757 ScriptManagerPointer sm = newScriptManager(ScriptManager::NETWORKLESS_TEST_SCRIPT, scriptSource, scriptFilename);
5858
5959
60+ sm->setAbortOnUncaughtException(true);
61+
6062 connect(sm.get(), &ScriptManager::scriptLoaded, [](const QString& filename){
6163 qWarning() << "Loaded script" << filename;
6264 });
@@ -227,8 +229,7 @@ void ScriptEngineTests::testRaiseExceptionAndCatch() { · 164 unmodified lines
227229 " print(\"Caught!\");"
228230 " }"
229231 "}"
230− "Script.stop(true);"
231− ;
232+ "Script.stop(true);";
232233
233234 QString printed;
234235 auto sm = makeManager(script, "testRaiseCatch.js");
@@ -248,6 +249,11 @@ void ScriptEngineTests::testRaiseExceptionAndCatch() { · 13 unmodified lines
248249 }
249250
250251
252+void ScriptEngineTests::testSignal() {
253+
254+}
255+
256+
251257 void ScriptEngineTests::scriptTest() {
252258 return;
253259