aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2019-04-29 20:24:47 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2019-05-02 18:03:50 +0000
commit694568d01a1d2480bd57a27ed2f500506f488fcb (patch)
tree9c510759b6c3a75f6b80204f8bca008dcab7018d /tests
parent03431c8b352e88753ca66a23fe30c59ae08ab92e (diff)
Fix qbsConfig test on Macos
It seems, that QSettings is not working properly with SystemScope on Macos (QTBUG-21062). QSettings::fileName returns a path to a file in a test directory, not in "/Library/Application Support" as expected. Thus, canWriteToSystemSettings is true and test fails when real qbs binary tries to write to the /Library... location Change-Id: I726360a1daacf4871f944f5afe30089083283dce Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 2de7cea85..dba77ff60 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -36,6 +36,7 @@
#include <tools/preferences.h>
#include <tools/profile.h>
#include <tools/qttools.h>
+#include <tools/settings.h>
#include <tools/shellutils.h>
#include <tools/stlutils.h>
#include <tools/version.h>
@@ -5230,8 +5231,9 @@ void TestBlackbox::qbsConfig()
bool canWriteToSystemSettings;
QString testSettingsFilePath;
{
- QSettings testSettings(QSettings::IniFormat, QSettings::SystemScope,
- "dummyOrg", "dummyApp");
+ QSettings testSettings(
+ qbs::Settings::defaultSystemSettingsBaseDir() + "/dummyOrg" + "/dummyApp.conf",
+ QSettings::IniFormat);
testSettings.setValue("dummyKey", "dummyValue");
testSettings.sync();
canWriteToSystemSettings = testSettings.status() == QSettings::NoError;