From 0ebf1bfa336b8d1fdf864925cd0cb45f0f56c572 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 18 Jul 2014 11:10:22 +0200 Subject: 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 --- tests/auto/api/api.pro | 2 ++ tests/auto/api/api.qbs | 4 +++- tests/auto/api/tst_api.cpp | 2 ++ tests/auto/api/tst_api.h | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/auto') 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(); -- cgit v1.2.3