summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-05-10 21:38:41 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-05-17 06:29:03 +0000
commitf84199f8b70bb03b66a0dbac3ff4dcdb56094d20 (patch)
tree2227c04675712bd387cea5b193f5b4d3e8196452 /tests
parent520412d147b12ed8fda1a13aef96d79b953590c5 (diff)
downloadqt-creator-f84199f8b70bb03b66a0dbac3ff4dcdb56094d20.tar.gz
Solutions: Long live Solutions!
Short live Tasking in Solutions! Add src/libs/solutions/README.md with the motivation and hints. Move TaskTree and Barrier from Utils into Tasking object lib, the first solution in Solutions project. Tasking: Some more work is still required for adapting auto and manual tests. Currently they use Async task, which stayed in Utils. For Qt purposed we most probably need to have a clone of Async task inside the Tasking namespace that is more Qt-like (no Utils::FutureSynchronizer, no priority field, global QThreadPool instead of a custom one for Creator). Change-Id: I5d10a2d68170ffa467d8c299be5995b9aa4f8f77 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/CMakeLists.txt1
-rw-r--r--tests/auto/auto.qbs1
-rw-r--r--tests/auto/solutions/CMakeLists.txt1
-rw-r--r--tests/auto/solutions/solutions.qbs8
-rw-r--r--tests/auto/solutions/tasking/CMakeLists.txt4
-rw-r--r--tests/auto/solutions/tasking/tasking.qbs7
-rw-r--r--tests/auto/solutions/tasking/tst_tasking.cpp (renamed from tests/auto/utils/tasktree/tst_tasktree.cpp)23
-rw-r--r--tests/auto/utils/CMakeLists.txt1
-rw-r--r--tests/auto/utils/tasktree/CMakeLists.txt4
-rw-r--r--tests/auto/utils/tasktree/tasktree.qbs26
-rw-r--r--tests/auto/utils/utils.qbs1
-rw-r--r--tests/manual/tasktree/taskwidget.h3
12 files changed, 36 insertions, 44 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index 98ee345896..9849f8776e 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -19,6 +19,7 @@ add_subdirectory(profilewriter)
add_subdirectory(qml)
add_subdirectory(runextensions)
add_subdirectory(sdktool)
+add_subdirectory(solutions)
add_subdirectory(toolchaincache)
add_subdirectory(tracing)
add_subdirectory(treeviewfind)
diff --git a/tests/auto/auto.qbs b/tests/auto/auto.qbs
index 2ff98d1409..063977537b 100644
--- a/tests/auto/auto.qbs
+++ b/tests/auto/auto.qbs
@@ -22,6 +22,7 @@ Project {
"qml/qml.qbs",
"runextensions/runextensions.qbs",
"sdktool/sdktool.qbs",
+ "solutions/solutions.qbs",
"toolchaincache/toolchaincache.qbs",
"tracing/tracing.qbs",
"treeviewfind/treeviewfind.qbs",
diff --git a/tests/auto/solutions/CMakeLists.txt b/tests/auto/solutions/CMakeLists.txt
new file mode 100644
index 0000000000..694d940195
--- /dev/null
+++ b/tests/auto/solutions/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(tasking)
diff --git a/tests/auto/solutions/solutions.qbs b/tests/auto/solutions/solutions.qbs
new file mode 100644
index 0000000000..cc445753cc
--- /dev/null
+++ b/tests/auto/solutions/solutions.qbs
@@ -0,0 +1,8 @@
+import qbs
+
+Project {
+ name: "Solutions autotests"
+ references: [
+ "tasking/tasking.qbs",
+ ]
+}
diff --git a/tests/auto/solutions/tasking/CMakeLists.txt b/tests/auto/solutions/tasking/CMakeLists.txt
new file mode 100644
index 0000000000..534d215ccb
--- /dev/null
+++ b/tests/auto/solutions/tasking/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_qtc_test(tst_solutions_tasking
+ DEPENDS Utils
+ SOURCES tst_tasking.cpp
+)
diff --git a/tests/auto/solutions/tasking/tasking.qbs b/tests/auto/solutions/tasking/tasking.qbs
new file mode 100644
index 0000000000..173c1fc575
--- /dev/null
+++ b/tests/auto/solutions/tasking/tasking.qbs
@@ -0,0 +1,7 @@
+QtcAutotest {
+ name: "Tasking autotest"
+
+ Depends { name: "Utils" }
+
+ files: "tst_tasking.cpp"
+}
diff --git a/tests/auto/utils/tasktree/tst_tasktree.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp
index e897cd36fc..9efba89bb2 100644
--- a/tests/auto/utils/tasktree/tst_tasktree.cpp
+++ b/tests/auto/solutions/tasking/tst_tasking.cpp
@@ -1,8 +1,9 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include <solutions/tasking/barrier.h>
+
#include <utils/async.h>
-#include <utils/barrier.h>
#include <QtTest>
@@ -56,7 +57,7 @@ struct TestData {
OnDone onDone = OnDone::Success;
};
-class tst_TaskTree : public QObject
+class tst_Tasking : public QObject
{
Q_OBJECT
@@ -72,18 +73,18 @@ private slots:
void cleanupTestCase();
};
-void tst_TaskTree::initTestCase()
+void tst_Tasking::initTestCase()
{
s_futureSynchronizer = new FutureSynchronizer;
}
-void tst_TaskTree::cleanupTestCase()
+void tst_Tasking::cleanupTestCase()
{
delete s_futureSynchronizer;
s_futureSynchronizer = nullptr;
}
-void tst_TaskTree::validConstructs()
+void tst_Tasking::validConstructs()
{
const Group task {
parallel,
@@ -215,7 +216,7 @@ auto setupBarrierAdvance(const TreeStorage<CustomStorage> &storage,
};
}
-void tst_TaskTree::testTree_data()
+void tst_Tasking::testTree_data()
{
QTest::addColumn<TestData>("testData");
@@ -1484,7 +1485,7 @@ void tst_TaskTree::testTree_data()
}
}
-void tst_TaskTree::testTree()
+void tst_Tasking::testTree()
{
QFETCH(TestData, testData);
@@ -1536,7 +1537,7 @@ void tst_TaskTree::testTree()
QCOMPARE(errorCount, expectedErrorCount);
}
-void tst_TaskTree::storageOperators()
+void tst_Tasking::storageOperators()
{
TreeStorageBase storage1 = TreeStorage<CustomStorage>();
TreeStorageBase storage2 = TreeStorage<CustomStorage>();
@@ -1551,7 +1552,7 @@ void tst_TaskTree::storageOperators()
// It also checks whether the destructor of a task tree deletes properly the storage created
// while starting the task tree. When running task tree is destructed, the storage done
// handler shouldn't be invoked.
-void tst_TaskTree::storageDestructor()
+void tst_Tasking::storageDestructor()
{
bool setupCalled = false;
const auto setupHandler = [&setupCalled](CustomStorage *) {
@@ -1586,6 +1587,6 @@ void tst_TaskTree::storageDestructor()
QVERIFY(!doneCalled);
}
-QTEST_GUILESS_MAIN(tst_TaskTree)
+QTEST_GUILESS_MAIN(tst_Tasking)
-#include "tst_tasktree.moc"
+#include "tst_tasking.moc"
diff --git a/tests/auto/utils/CMakeLists.txt b/tests/auto/utils/CMakeLists.txt
index 1bb4bb641a..e78cb3380c 100644
--- a/tests/auto/utils/CMakeLists.txt
+++ b/tests/auto/utils/CMakeLists.txt
@@ -14,7 +14,6 @@ add_subdirectory(persistentsettings)
add_subdirectory(process)
add_subdirectory(settings)
add_subdirectory(stringutils)
-add_subdirectory(tasktree)
add_subdirectory(templateengine)
add_subdirectory(treemodel)
add_subdirectory(text)
diff --git a/tests/auto/utils/tasktree/CMakeLists.txt b/tests/auto/utils/tasktree/CMakeLists.txt
deleted file mode 100644
index 2a1ae73630..0000000000
--- a/tests/auto/utils/tasktree/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-add_qtc_test(tst_utils_tasktree
- DEPENDS Utils
- SOURCES tst_tasktree.cpp
-)
diff --git a/tests/auto/utils/tasktree/tasktree.qbs b/tests/auto/utils/tasktree/tasktree.qbs
deleted file mode 100644
index 9b9789c450..0000000000
--- a/tests/auto/utils/tasktree/tasktree.qbs
+++ /dev/null
@@ -1,26 +0,0 @@
-import qbs.FileInfo
-
-Project {
- QtcAutotest {
- name: "TaskTree autotest"
-
- Depends { name: "Utils" }
- Depends { name: "app_version_header" }
-
- files: [
- "tst_tasktree.cpp",
- ]
- cpp.defines: {
- var defines = base;
- if (qbs.targetOS === "windows")
- defines.push("_CRT_SECURE_NO_WARNINGS");
- var absLibExecPath = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix,
- qtc.ide_libexec_path);
- var relLibExecPath = FileInfo.relativePath(destinationDirectory, absLibExecPath);
- defines.push('TEST_RELATIVE_LIBEXEC_PATH="' + relLibExecPath + '"');
- defines.push('TESTAPP_PATH="'
- + FileInfo.joinPaths(destinationDirectory, "testapp") + '"');
- return defines;
- }
- }
-}
diff --git a/tests/auto/utils/utils.qbs b/tests/auto/utils/utils.qbs
index 6ed3fd7348..e267f009f7 100644
--- a/tests/auto/utils/utils.qbs
+++ b/tests/auto/utils/utils.qbs
@@ -19,7 +19,6 @@ Project {
"process/process.qbs",
"settings/settings.qbs",
"stringutils/stringutils.qbs",
- "tasktree/tasktree.qbs",
"templateengine/templateengine.qbs",
"treemodel/treemodel.qbs",
"unixdevicefileaccess/unixdevicefileaccess.qbs",
diff --git a/tests/manual/tasktree/taskwidget.h b/tests/manual/tasktree/taskwidget.h
index ae8e7b6788..dc8821af5e 100644
--- a/tests/manual/tasktree/taskwidget.h
+++ b/tests/manual/tasktree/taskwidget.h
@@ -1,8 +1,9 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include <solutions/tasking/tasktree.h>
+
#include <utils/layoutbuilder.h>
-#include <utils/tasktree.h>
#include <QWidget>