diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-18 11:10:22 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-07-18 16:09:57 +0200 |
commit | 0ebf1bfa336b8d1fdf864925cd0cb45f0f56c572 (patch) | |
tree | 954348e80efa2d3110c79342729bf6fe2967d4d3 /tests | |
parent | cc864b59e10358aa9470a0e03b16bd507bf02033 (diff) |
API: Make the ability to update project files optional.
This is the functionality that allows callers to add files to groups
etc. Unfortunately, the QML/JS rewriter we use for this purpose pulls in
the Qt GUI module, which results in unnecessary library dependencies if
one only wants to use the command-line frontend. Therefore, allow this
feature to be compiled out.
Task-number: QBS-565
Change-Id: Ic134ff9cf37bd552ad493b388c05bcece983fd65
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/api/api.pro | 2 | ||||
-rw-r--r-- | tests/auto/api/api.qbs | 4 | ||||
-rw-r--r-- | tests/auto/api/tst_api.cpp | 2 | ||||
-rw-r--r-- | tests/auto/api/tst_api.h | 2 |
4 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/api/api.pro b/tests/auto/api/api.pro index 672947144..0adfa22db 100644 --- a/tests/auto/api/api.pro +++ b/tests/auto/api/api.pro @@ -3,4 +3,6 @@ TARGET = tst_api HEADERS = tst_api.h SOURCES = tst_api.cpp +qbs_enable_project_file_updates:DEFINES += QBS_ENABLE_PROJECT_FILE_UPDATES + include(../auto.pri) diff --git a/tests/auto/api/api.qbs b/tests/auto/api/api.qbs index 9d0e2c0b4..df42afc89 100644 --- a/tests/auto/api/api.qbs +++ b/tests/auto/api/api.qbs @@ -3,5 +3,7 @@ import "../autotest.qbs" as AutoTest AutoTest { testName: "api" files: ["tst_api.h", "tst_api.cpp"] - cpp.defines: base.concat(['SRCDIR="' + path + '"']) + cpp.defines: base + .concat(['SRCDIR="' + path + '"']) + .concat(project.enableProjectFileUpdates ? ["QBS_ENABLE_PROJECT_FILE_UPDATES"] : []) } diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp index ef3cf9801..b981ce6f2 100644 --- a/tests/auto/api/tst_api.cpp +++ b/tests/auto/api/tst_api.cpp @@ -177,6 +177,7 @@ qbs::GroupData findGroup(const qbs::ProductData &product, const QString &name) return qbs::GroupData(); } +#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES void TestApi::changeContent() { qbs::SetupProjectParameters setupParams = defaultSetupParameters(); @@ -423,6 +424,7 @@ void TestApi::changeContent() } QVERIFY(job->project().projectData() == projectData); } +#endif // QBS_ENABLE_PROJECT_FILE_UPDATES static qbs::ErrorInfo forceRuleEvaluation(const qbs::Project project) { diff --git a/tests/auto/api/tst_api.h b/tests/auto/api/tst_api.h index 756eb1ed3..473b20c80 100644 --- a/tests/auto/api/tst_api.h +++ b/tests/auto/api/tst_api.h @@ -49,7 +49,9 @@ private slots: void buildGraphLocking(); void buildSingleFile(); +#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES void changeContent(); +#endif void disabledInstallGroup(); void fileTagsFilterOverride(); void infiniteLoopBuilding(); |