aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared.h
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-08-11 13:52:46 -0700
committerJake Petroules <jake.petroules@qt.io>2017-08-16 17:41:12 +0000
commit89983bbd11aed13d2365daf41392a450afdd7b57 (patch)
tree0e1af02a3b74bb9ec58c232a020db60a3ee7eb36 /tests/auto/shared.h
parentb25a9153de8995b733248ab401e6a951f86e4210 (diff)
Allow overriding the Qbs autotest profile with an environment variable
The default profile is now "none", ensuring that Qbs autotests will use a clean environment by default. This means that development can be done entirely within Qt Creator without having to separately configure Qbs from the command line. It also has the advantage that switching test profiles is much easier, for example in order to allow running the entire test suite for a cross compile target. Change-Id: I17b06952b577bfef9818338b59dd638492612e24 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/shared.h')
-rw-r--r--tests/auto/shared.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/shared.h b/tests/auto/shared.h
index 6a0caaa3c..8c4689e31 100644
--- a/tests/auto/shared.h
+++ b/tests/auto/shared.h
@@ -60,7 +60,12 @@ inline SettingsPtr settings()
return SettingsPtr(new qbs::Settings(settingsDir));
}
-inline QString profileName() { return QLatin1String("qbs_autotests"); }
+inline QString profileName()
+{
+ const QString profile = QLatin1String(qgetenv("QBS_AUTOTEST_PROFILE"));
+ return !profile.isEmpty() ? profile : QLatin1String("none");
+}
+
inline QString relativeBuildDir(const QString &configurationName = QString())
{
return !configurationName.isEmpty() ? configurationName : QLatin1String("default");