From 27e145e797a265de93cc1238d6e6ee5d3f3c1998 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 5 Aug 2015 10:00:33 +0200 Subject: test_kconf_update: use QStandardPaths test mode to avoid touching the user's real files --- autotests/test_kconf_update.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'autotests/test_kconf_update.cpp') diff --git a/autotests/test_kconf_update.cpp b/autotests/test_kconf_update.cpp index dc03f9ff..41806194 100644 --- a/autotests/test_kconf_update.cpp +++ b/autotests/test_kconf_update.cpp @@ -35,6 +35,8 @@ QTEST_GUILESS_MAIN(TestKConfUpdate) void TestKConfUpdate::initTestCase() { + QStandardPaths::setTestModeEnabled(true); + // Ensure it all works with spaces in paths (as happens more commonly on OSX where it's ~/Library/Application Support/) qputenv("XDG_DATA_HOME", "/tmp/a b"); } @@ -76,7 +78,7 @@ static QTemporaryFile *writeUpdFile(const QString &content) static void runKConfUpdate(const QString &updPath) { QVERIFY(QFile::exists(KCONF_UPDATE_EXECUTABLE)); - QCOMPARE(0, QProcess::execute(KCONF_UPDATE_EXECUTABLE, QStringList() << "--debug" << updPath)); + QCOMPARE(0, QProcess::execute(KCONF_UPDATE_EXECUTABLE, QStringList() << "--testmode" << "--debug" << updPath)); } void TestKConfUpdate::test_data() -- cgit v1.2.1