Qbs build system: Add a component for test files groups

Mainly in order to enforce a unified group name across QtC libraries and
plugins.

Change-Id: I6eafe0f9d227ec73d8c9029675866c67063768fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2023-03-21 10:01:28 +01:00
parent 1029cb959b
commit 50a214de9e
24 changed files with 29 additions and 68 deletions

View File

@@ -0,0 +1,6 @@
import qbs 1.0
Group {
name: "Unit tests"
condition: qtc.testsEnabled
}

View File

@@ -116,9 +116,7 @@ Project {
"sdkmanageroutputparser.h" "sdkmanageroutputparser.h"
] ]
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
files: [ files: [
"android_tst.qrc", "android_tst.qrc",
"androidsdkmanager_test.cpp", "androidsdkmanager_test.cpp",

View File

@@ -125,9 +125,7 @@ QtcPlugin {
] ]
} }
Group { QtcTestFiles {
name: "Test sources"
condition: qtc.testsEnabled
files: [ files: [
"autotestunittests.cpp", "autotestunittests.cpp",
"autotestunittests.h", "autotestunittests.h",

View File

@@ -94,9 +94,7 @@ QtcPlugin {
} }
} }
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
prefix: "test/" prefix: "test/"
files: [ files: [
"activationsequenceprocessortest.cpp", "activationsequenceprocessortest.cpp",

View File

@@ -54,10 +54,8 @@ QtcPlugin {
"clangformatutils.cpp", "clangformatutils.cpp",
] ]
Group { QtcTestFiles {
name: "Tests"
prefix: "tests/" prefix: "tests/"
condition: qtc.testsEnabled
cpp.defines: outer.concat('TESTDATA_DIR="' + sourceDirectory + "/tests/data" + '"') cpp.defines: outer.concat('TESTDATA_DIR="' + sourceDirectory + "/tests/data" + '"')
files: [ files: [
"clangformat-test.cpp", "clangformat-test.cpp",

View File

@@ -74,9 +74,7 @@ QtcPlugin {
"virtualfilesystemoverlay.h", "virtualfilesystemoverlay.h",
] ]
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
files: [ files: [
"clangtoolspreconfiguredsessiontests.cpp", "clangtoolspreconfiguredsessiontests.cpp",
"clangtoolspreconfiguredsessiontests.h", "clangtoolspreconfiguredsessiontests.h",

View File

@@ -21,9 +21,7 @@ QtcPlugin {
"compilationdbparser.h", "compilationdbparser.h",
] ]
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: [ files: [
"compilationdatabasetests.cpp", "compilationdatabasetests.cpp",
"compilationdatabasetests.h", "compilationdatabasetests.h",

View File

@@ -271,9 +271,7 @@ Project {
] ]
} }
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: [ files: [
"testdatadir.cpp", "testdatadir.cpp",
"testdatadir.h", "testdatadir.h",

View File

@@ -245,9 +245,7 @@ QtcPlugin {
] ]
} }
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"']) cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"'])
files: [ files: [
"compileroptionsbuilder_test.cpp", "compileroptionsbuilder_test.cpp",

View File

@@ -239,9 +239,7 @@ Project {
] ]
} }
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
files: [ files: [
"debuggerunittests.qrc", "debuggerunittests.qrc",
] ]

View File

@@ -77,9 +77,7 @@ QtcPlugin {
] ]
} }
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: [ "gotoslot_test.cpp" ] files: [ "gotoslot_test.cpp" ]
cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"']) cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"'])

View File

@@ -25,9 +25,7 @@ QtcPlugin {
"fakevimtr.h", "fakevimtr.h",
] ]
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: ["fakevim_test.cpp"] files: ["fakevim_test.cpp"]
} }
} }

View File

@@ -58,8 +58,7 @@ QtcPlugin {
"settingshandler.cpp", "settingshandler.cpp",
] ]
Group { QtcTestFiles {
name: "McuSupport test files"
condition: qtc.testsEnabled && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent) condition: qtc.testsEnabled && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent)
prefix: "test/" prefix: "test/"
files: [ files: [

View File

@@ -75,9 +75,7 @@ QtcPlugin {
files: [ "PerfProfilerFlameGraphView.qml" ] files: [ "PerfProfilerFlameGraphView.qml" ]
} }
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
prefix: "tests/" prefix: "tests/"
files: [ files: [
"perfprofilertracefile_test.cpp", "perfprofilertracefile_test.cpp",

View File

@@ -250,9 +250,7 @@ Project {
] ]
} }
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: ["outputparser_test.h", "outputparser_test.cpp"] files: ["outputparser_test.h", "outputparser_test.cpp"]
} }

View File

@@ -54,9 +54,7 @@ QtcPlugin {
"qmljstools.qrc" "qmljstools.qrc"
] ]
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: ["qmljstools_test.cpp"] files: ["qmljstools_test.cpp"]
} }

View File

@@ -38,9 +38,7 @@ QtcPlugin {
] ]
} }
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
prefix: "tests/" prefix: "tests/"
files: [ files: [
"qmlpreviewclient_test.cpp", "qmlpreviewclient_test.cpp",

View File

@@ -73,9 +73,7 @@ QtcPlugin {
files: "qml/**" files: "qml/**"
} }
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
prefix: "tests/" prefix: "tests/"
files: [ files: [
"debugmessagesmodel_test.cpp", "debugmessagesmodel_test.h", "debugmessagesmodel_test.cpp", "debugmessagesmodel_test.h",

View File

@@ -67,9 +67,7 @@ Project {
"images/embeddedtarget.png", "images/embeddedtarget.png",
] ]
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: [ files: [
"filesystemaccess_test.cpp", "filesystemaccess_test.cpp",
"filesystemaccess_test.h", "filesystemaccess_test.h",

View File

@@ -13,9 +13,7 @@ QtcPlugin {
"silversearcherplugin.cpp", "silversearcherplugin.h", "silversearcherplugin.cpp", "silversearcherplugin.h",
] ]
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: [ files: [
"outputparser_test.cpp", "outputparser_test.cpp",
"outputparser_test.h", "outputparser_test.h",

View File

@@ -222,9 +222,7 @@ Project {
] ]
} }
Group { QtcTestFiles {
name: "Tests"
condition: qtc.testsEnabled
files: [ files: [
"texteditor_test.cpp", "texteditor_test.cpp",
] ]

View File

@@ -76,9 +76,7 @@ QtcPlugin {
] ]
} }
Group { QtcTestFiles {
name: "Test sources"
condition: qtc.testsEnabled
files: [ files: [
"valgrindmemcheckparsertest.cpp", "valgrindmemcheckparsertest.cpp",
"valgrindmemcheckparsertest.h", "valgrindmemcheckparsertest.h",

View File

@@ -23,9 +23,7 @@ QtcPlugin {
"vcpkgsettings.h", "vcpkgsettings.h",
] ]
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
files: [ files: [
"vcpkg_test.h", "vcpkg_test.h",
"vcpkg_test.cpp", "vcpkg_test.cpp",

View File

@@ -33,9 +33,7 @@ QtcPlugin {
"webassemblytoolchain.h", "webassemblytoolchain.h",
] ]
Group { QtcTestFiles {
name: "Unit tests"
condition: qtc.testsEnabled
files: [ files: [
"webassembly_test.cpp", "webassembly_test.cpp",
"webassembly_test.h", "webassembly_test.h",