diff options
Diffstat (limited to 'tests/auto/core/ifcodegen/backends/test')
3 files changed, 16 insertions, 2 deletions
diff --git a/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt b/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt index ea6b4bdc..14bbf422 100644 --- a/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt +++ b/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt @@ -14,5 +14,11 @@ qt_internal_add_test(tst_backends TESTDATA simulation.qml minimal_simulation_data.json server.conf ) +add_custom_target(tst_backends_extra_files + SOURCES + simulation.qml + minimal_simulation_data.json +) + set_target_properties(tst_backends PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../) diff --git a/tests/auto/core/ifcodegen/backends/test/simulation.qml b/tests/auto/core/ifcodegen/backends/test/simulation.qml index 5a3deb99..946733b8 100644 --- a/tests/auto/core/ifcodegen/backends/test/simulation.qml +++ b/tests/auto/core/ifcodegen/backends/test/simulation.qml @@ -157,6 +157,8 @@ QtObject { echo.contactList.update(0, Echomodule.contact("Mr B.", 30, true, undefined)) } else if (cmd === "remove") { echo.contactList.remove(0) + } else if (cmd === "quit") { + Qt.quit() } } } diff --git a/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp b/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp index f65262ac..486680be 100644 --- a/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp +++ b/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp @@ -127,8 +127,14 @@ void BackendsTest::cleanup() { if (m_serverProcess->state() == QProcess::Running) { qInfo() << "Stopping Server Process"; - m_serverProcess->kill(); - QVERIFY(m_serverProcess->waitForFinished()); + + sendCmd("quit"); + m_serverProcess->waitForFinished(500); + + if (m_serverProcess->state() == QProcess::Running) { + m_serverProcess->kill(); + QVERIFY(m_serverProcess->waitForFinished()); + } } delete m_localSocket; m_localSocket = nullptr; |