summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/core/ifcodegen/backends/server_qtro/serverMain.cpp2
-rw-r--r--tests/auto/core/ifcodegen/backends/test/CMakeLists.txt6
-rw-r--r--tests/auto/core/ifcodegen/backends/test/simulation.qml2
-rw-r--r--tests/auto/core/ifcodegen/backends/test/tst_backends.cpp10
4 files changed, 18 insertions, 2 deletions
diff --git a/tests/auto/core/ifcodegen/backends/server_qtro/serverMain.cpp b/tests/auto/core/ifcodegen/backends/server_qtro/serverMain.cpp
index 16f74212..898a0a13 100644
--- a/tests/auto/core/ifcodegen/backends/server_qtro/serverMain.cpp
+++ b/tests/auto/core/ifcodegen/backends/server_qtro/serverMain.cpp
@@ -123,6 +123,8 @@ void serverMain(QIfRemoteObjectsConfig &config)
contactsModelService->update(0, updatedContact);
} else if (cmd == u"remove"_s) {
contactsModelService->remove(0);
+ } else if (cmd == u"quit"_s) {
+ qApp->quit();
}
});
}
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;