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.
wilder
David Faure 9 years ago
parent d85a57645f
commit 48e2e7c9bc
  1. 5
      autotests/CMakeLists.txt
  2. 5
      autotests/kconfigskeletontest.cpp
  3. 1
      autotests/kconfigskeletontest.h

@ -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)

@ -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");

@ -27,6 +27,7 @@ class KConfigSkeletonTest : public QObject
public:
private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
void testSimple();

Loading…
Cancel
Save