From 11642ebfe17496d3da218e0f95dd0042b9b17991 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 9 Jan 2023 11:47:42 +0200 Subject: [PATCH] Property to control building unit tests. --- qbs/modules/buildconfig/buildconfig.qbs | 3 +++ src/test/CollectionTest/CollectionTest.qbs | 1 + src/test/ParserTest/ParserTest.qbs | 1 + src/test/TranslationsTest/TranslationsTest.qbs | 1 + src/test/ValentinaTest/ValentinaTest.qbs | 1 + 5 files changed, 7 insertions(+) diff --git a/qbs/modules/buildconfig/buildconfig.qbs b/qbs/modules/buildconfig/buildconfig.qbs index 3481fefd7..13074d0ab 100644 --- a/qbs/modules/buildconfig/buildconfig.qbs +++ b/qbs/modules/buildconfig/buildconfig.qbs @@ -9,6 +9,9 @@ Module { property bool enableUbSanitizer: false property bool enableThreadSanitizer: false + // Use this property to disable building unit tests. + property bool enableUnitTests: true + property string libDirName: "lib" property string appTarget diff --git a/src/test/CollectionTest/CollectionTest.qbs b/src/test/CollectionTest/CollectionTest.qbs index 2cff0e31d..355e222c3 100644 --- a/src/test/CollectionTest/CollectionTest.qbs +++ b/src/test/CollectionTest/CollectionTest.qbs @@ -12,6 +12,7 @@ VApp { type: base.concat("autotest", "tst_files") bundle.isBundle: false install: false + condition: buildconfig.enableUnitTests files: [ "qttestmainlambda.cpp", diff --git a/src/test/ParserTest/ParserTest.qbs b/src/test/ParserTest/ParserTest.qbs index 3f8000912..565b5138f 100644 --- a/src/test/ParserTest/ParserTest.qbs +++ b/src/test/ParserTest/ParserTest.qbs @@ -9,6 +9,7 @@ VApp { consoleApplication: true bundle.isBundle: false install: false + condition: buildconfig.enableUnitTests files: [ "main.cpp" diff --git a/src/test/TranslationsTest/TranslationsTest.qbs b/src/test/TranslationsTest/TranslationsTest.qbs index 8d9a51d3b..c2fe7f447 100644 --- a/src/test/TranslationsTest/TranslationsTest.qbs +++ b/src/test/TranslationsTest/TranslationsTest.qbs @@ -11,6 +11,7 @@ VApp { type: base.concat("autotest") bundle.isBundle: false install: false + condition: buildconfig.enableUnitTests files: [ "qttestmainlambda.cpp", diff --git a/src/test/ValentinaTest/ValentinaTest.qbs b/src/test/ValentinaTest/ValentinaTest.qbs index 3ac465cab..26b96bfc6 100644 --- a/src/test/ValentinaTest/ValentinaTest.qbs +++ b/src/test/ValentinaTest/ValentinaTest.qbs @@ -14,6 +14,7 @@ VApp { type: base.concat("autotest") bundle.isBundle: false install: false + condition: buildconfig.enableUnitTests files: [ "qttestmainlambda.cpp",