aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2017-08-01 09:56:00 +0200
committerDavid Faure <faure@kde.org>2017-08-01 09:56:00 +0200
commit48e2e7c9bcd24cc010a6af0a455f8793ea863d40 (patch)
tree9bf3342b8d0057c06977c4c0a4d9dd1b95f13324
parentd85a57645f94d2d087711d7c608a0c5a46ed7ede (diff)
downloadkconfig-48e2e7c9bcd24cc010a6af0a455f8793ea863d40.tar.gz
kconfig-48e2e7c9bcd24cc010a6af0a455f8793ea863d40.tar.bz2
autotests: fix the failures I got here.
1) some of them can't run in parallel 2) kconfigskeletontest failed due to KSharedConfig being used under the scene (for a year now), and there's probably some QPA or widget style holding a ref (here, not in the CI). Indirectly, simply setting QStandardPaths::setTestModeEnabled(true) fixes this since KSharedConfig will then not share the instance with the non-test-mode-enabled instance.
-rw-r--r--autotests/CMakeLists.txt5
-rw-r--r--autotests/kconfigskeletontest.cpp5
-rw-r--r--autotests/kconfigskeletontest.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index c1ae1de0..a07636d5 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -61,5 +61,10 @@ ecm_add_tests(
LINK_LIBRARIES KF5::ConfigGui Qt5::Test
)
+# These tests do a global cleanup of ~/.qttest, so they can't run in parallel
+set_tests_properties(kconfigcore-kconfigtest PROPERTIES RUN_SERIAL TRUE)
+set_tests_properties(kconfigcore-kconfignokdehometest PROPERTIES RUN_SERIAL TRUE)
+set_tests_properties(kconfiggui-kconfigguitest PROPERTIES RUN_SERIAL TRUE)
+
add_subdirectory(kconfig_compiler)
diff --git a/autotests/kconfigskeletontest.cpp b/autotests/kconfigskeletontest.cpp
index 898366c0..0036a7e4 100644
--- a/autotests/kconfigskeletontest.cpp
+++ b/autotests/kconfigskeletontest.cpp
@@ -35,6 +35,11 @@ QTEST_MAIN(KConfigSkeletonTest)
#define WRITE_SETTING3 QFont("helvetica",14)
#define WRITE_SETTING4 QString("KDE")
+void KConfigSkeletonTest::initTestCase()
+{
+ QStandardPaths::setTestModeEnabled(true);
+}
+
void KConfigSkeletonTest::init()
{
QFile::remove(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/kconfigskeletontestrc");
diff --git a/autotests/kconfigskeletontest.h b/autotests/kconfigskeletontest.h
index 5cdcc9d3..a5c63c9c 100644
--- a/autotests/kconfigskeletontest.h
+++ b/autotests/kconfigskeletontest.h
@@ -27,6 +27,7 @@ class KConfigSkeletonTest : public QObject
public:
private Q_SLOTS:
+ void initTestCase();
void init();
void cleanup();
void testSimple();