summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2023-12-03 16:59:10 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-25 17:38:04 (GMT)
commit701029726f17759a84b963e2f318742a1761670a (patch)
tree50f7433fa86cb9a74bead4214cae34e44500a48e /Source/CTest
parentdbacc1d5a8c189289fe651ed9db892d9639354c6 (diff)
downloadCMake-701029726f17759a84b963e2f318742a1761670a.zip
CMake-701029726f17759a84b963e2f318742a1761670a.tar.gz
CMake-701029726f17759a84b963e2f318742a1761670a.tar.bz2
ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE
These options can be used to specify files which can be used to restrict the set of tests that will be executed. Fixes: #25455
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx10
-rw-r--r--Source/CTest/cmCTestTestCommand.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index c717868..ed16354 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -26,6 +26,8 @@ void cmCTestTestCommand::BindArguments()
this->Bind("INCLUDE"_s, this->Include);
this->Bind("EXCLUDE_LABEL"_s, this->ExcludeLabel);
this->Bind("INCLUDE_LABEL"_s, this->IncludeLabel);
+ this->Bind("EXCLUDE_FROM_FILE"_s, this->ExcludeTestsFromFile);
+ this->Bind("INCLUDE_FROM_FILE"_s, this->IncludeTestsFromFile);
this->Bind("EXCLUDE_FIXTURE"_s, this->ExcludeFixture);
this->Bind("EXCLUDE_FIXTURE_SETUP"_s, this->ExcludeFixtureSetup);
this->Bind("EXCLUDE_FIXTURE_CLEANUP"_s, this->ExcludeFixtureCleanup);
@@ -80,6 +82,14 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
if (!this->IncludeLabel.empty()) {
handler->AddMultiOption("LabelRegularExpression", this->IncludeLabel);
}
+
+ if (!this->ExcludeTestsFromFile.empty()) {
+ handler->SetOption("ExcludeTestListFile", this->ExcludeTestsFromFile);
+ }
+ if (!this->IncludeTestsFromFile.empty()) {
+ handler->SetOption("TestListFile", this->IncludeTestsFromFile);
+ }
+
if (!this->ExcludeFixture.empty()) {
handler->SetOption("ExcludeFixtureRegularExpression",
this->ExcludeFixture);
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 24e74e2..ce054ed 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -51,6 +51,8 @@ protected:
std::string Include;
std::string ExcludeLabel;
std::string IncludeLabel;
+ std::string IncludeTestsFromFile;
+ std::string ExcludeTestsFromFile;
std::string ExcludeFixture;
std::string ExcludeFixtureSetup;
std::string ExcludeFixtureCleanup;