aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spec/testUtils.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/testUtils.cpp b/spec/testUtils.cpp
index e496a9b..0fc5e2b 100644
--- a/spec/testUtils.cpp
+++ b/spec/testUtils.cpp
@@ -9,12 +9,16 @@ std::vector<std::function<QObject *()>> &getQTestRegistry() {
int runAllTests() {
int exitCode = 0;
+
+ QString testName = getenv("TEST_NAME");
+
for (const auto &runTest : getQTestRegistry()) {
auto test = runTest();
- // printf(":::: %s\n", test->objectName().toStdString().c_str());
- exitCode |= QTest::qExec(test);
+ if (testName.isEmpty() || test->objectName().contains(testName))
+ exitCode |= QTest::qExec(test);
delete test;
}
+
getQTestRegistry().clear();
return exitCode;
}