From 694568d01a1d2480bd57a27ed2f500506f488fcb Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Mon, 29 Apr 2019 20:24:47 +0200 Subject: 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 --- tests/auto/blackbox/tst_blackbox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') 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 #include #include +#include #include #include #include @@ -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; -- cgit v1.2.3