From 15150c7b4637638395e2be3da7c1e7949be9cbe7 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 7 Mar 2019 15:07:53 +0100 Subject: [PATCH] ParseAndAddCatchTests: Set the ParseAndAddCatchTests_TESTS property After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source file in the target is set, and contains the list of the tests extracted from that target, or from that file. This is useful, for example to add further labels or properties to the tests. --- contrib/ParseAndAddCatchTests.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contrib/ParseAndAddCatchTests.cmake b/contrib/ParseAndAddCatchTests.cmake index a6d11001..c9b838d7 100644 --- a/contrib/ParseAndAddCatchTests.cmake +++ b/contrib/ParseAndAddCatchTests.cmake @@ -44,6 +44,10 @@ # set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) # # just before calling this ParseAndAddCatchTests function # # # +# After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source # +# file in the target is set, and contains the list of the tests extracted from that target, or # +# from that file. This is useful, for example to add further labels or properties to the tests. # +# # #==================================================================================================# cmake_minimum_required(VERSION 2.8.8) @@ -184,6 +188,14 @@ function(ParseFile SourceFile TestTarget) set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" LABELS "${Labels}") endif() + set_property( + TARGET ${TestTarget} + APPEND + PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") + set_property( + SOURCE ${SourceFile} + APPEND + PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") endif()