summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-31 16:26:23 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-31 16:27:53 (GMT)
commit0a5d29159e086ddd3ee9fc645eb575281785b9cf (patch)
treef4cabd1155320d607b23bb64dc3d4b7d868fe8f0 /Tests
parent16b1f0c3e99023316b12fdabd1980a18b738d942 (diff)
downloadCMake-0a5d29159e086ddd3ee9fc645eb575281785b9cf.zip
CMake-0a5d29159e086ddd3ee9fc645eb575281785b9cf.tar.gz
CMake-0a5d29159e086ddd3ee9fc645eb575281785b9cf.tar.bz2
Tests: Add "Fortran" test label
With this, `ctest -L Fortran` will run only tests covering Fortran.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt13
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMakeLists.txt23
-rw-r--r--Tests/UseSWIG/CMakeLists.txt1
4 files changed, 29 insertions, 11 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a7a456c..1f384c3 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -422,6 +422,7 @@ if(BUILD_TESTING)
endif()
if(CMAKE_Fortran_COMPILER)
ADD_TEST_MACRO(FortranOnly FortranOnly)
+ set_property(TEST FortranOnly APPEND PROPERTY LABELS "Fortran")
endif()
# test Visual Studio GNU Fortran mixing with cmake_add_fortran_subdirectory
# run this project if we have a working fortran compiler or
@@ -455,6 +456,7 @@ if(BUILD_TESTING)
endif()
if(NOT CMAKE_SKIP_VSGNUFortran)
ADD_TEST_MACRO(VSGNUFortran ${CMAKE_CMAKE_COMMAND} -P runtest.cmake)
+ set_property(TEST VSGNUFortran APPEND PROPERTY LABELS "Fortran")
endif()
endif()
@@ -509,6 +511,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(PolicyScope PolicyScope)
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
ADD_TEST_MACRO(CompileDefinitions CompileDefinitions)
+
if(CMAKE_Fortran_COMPILER)
set(CompileOptions_BUILD_OPTIONS -DTEST_FORTRAN=1)
endif()
@@ -518,6 +521,8 @@ if(BUILD_TESTING)
set(CompileOptions_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
endif()
ADD_TEST_MACRO(CompileOptions CompileOptions)
+ set_property(TEST CompileOptions APPEND PROPERTY LABELS "Fortran")
+
ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
ADD_TEST_MACRO(AliasTarget AliasTarget)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
@@ -660,6 +665,7 @@ if(BUILD_TESTING)
if(CMAKE_Fortran_COMPILER)
set(Module.CheckIPOSupported-Fortran_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_Fortran=${CMake_TEST_IPO_WORKS_Fortran})
ADD_TEST_MACRO(Module.CheckIPOSupported-Fortran CheckIPOSupported-Fortran)
+ set_property(TEST Module.CheckIPOSupported-Fortran APPEND PROPERTY LABELS "Fortran")
endif()
add_test(Module.ExternalData ${CMAKE_CTEST_COMMAND}
@@ -2160,7 +2166,7 @@ if(BUILD_TESTING)
endif()
ADD_TEST_MACRO(MSVCDebugInformationFormat)
set_property(TEST MSVCDebugInformationFormat APPEND
- PROPERTY LABELS "CUDA")
+ PROPERTY LABELS "CUDA" "Fortran")
set(MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
ADD_TEST_MACRO(MSVCRuntimeLibrary)
@@ -2168,6 +2174,7 @@ if(BUILD_TESTING)
PROPERTY LABELS "CUDA")
if(CMAKE_Fortran_COMPILER)
ADD_TEST_MACRO(MSVCRuntimeLibrary.Fortran)
+ set_property(TEST MSVCRuntimeLibrary.Fortran APPEND PROPERTY LABELS "Fortran")
endif()
endif()
if(MSVC OR
@@ -3362,6 +3369,7 @@ if(BUILD_TESTING)
--build-two-config
--test-command testf)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
+ set_property(TEST Fortran APPEND PROPERTY LABELS "Fortran")
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
add_test(FortranModules ${CMAKE_CTEST_COMMAND}
@@ -3376,6 +3384,7 @@ if(BUILD_TESTING)
${CMake_TEST_FortranModules_BUILD_OPTIONS}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranModules")
+ set_property(TEST FortranModules APPEND PROPERTY LABELS "Fortran")
endif()
# FortranCInterface tests.
@@ -3385,6 +3394,7 @@ if(BUILD_TESTING)
add_test(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags")
+ set_property(TEST FortranC.Flags APPEND PROPERTY LABELS "Fortran")
else()
add_test(FortranC ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -3395,6 +3405,7 @@ if(BUILD_TESTING)
--build-two-config
--test-command CMakeFiles/FortranCInterface/FortranCInterface)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
+ set_property(TEST FortranC APPEND PROPERTY LABELS "Fortran")
endif()
endif()
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 30cabf1..ea06464 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -25,8 +25,8 @@ add_CMakeOnly_test(CheckCXXSymbolExists)
add_CMakeOnly_test(CheckCXXCompilerFlag)
add_CMakeOnly_test(CheckLanguage)
+set_property(TEST CMakeOnly.CheckLanguage APPEND PROPERTY LABELS "HIP" "Fortran")
if (CMake_TEST_HIP)
- set_property(TEST CMakeOnly.CheckLanguage APPEND PROPERTY LABELS "HIP")
add_CMakeOnly_test(CheckLanguageHIPPlatform)
set_property(TEST CMakeOnly.CheckLanguageHIPPlatform APPEND PROPERTY LABELS "HIP")
add_CMakeOnly_test(CheckLanguageHIPPlatform2)
@@ -52,6 +52,7 @@ endif()
if(CMAKE_Fortran_COMPILER)
add_CMakeOnly_test(CompilerIdFortran)
+ set_property(TEST CMakeOnly.CompilerIdFortran APPEND PROPERTY LABELS "Fortran")
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])")
add_CMakeOnly_test(CompilerIdCSharp)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index f1baf92..4d3efd3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -151,6 +151,7 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "LCC" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "LCC" OR
"${CMAKE_Fortran_COMPILER_ID}" STREQUAL "LCC")
add_RunCMake_test("CMP0129")
+ set_property(TEST RunCMake.CMP0129 APPEND PROPERTY LABELS "Fortran")
endif()
add_RunCMake_test(CMP0132)
@@ -225,6 +226,7 @@ if(CMAKE_GENERATOR MATCHES "Ninja")
endif()
endif()
add_RunCMake_test(Ninja)
+ set_property(TEST RunCMake.Ninja APPEND PROPERTY LABELS "Fortran")
set(NinjaMultiConfig_ARGS
-DCYGWIN=${CYGWIN} -DMSYS=${MSYS}
)
@@ -321,6 +323,7 @@ add_RunCMake_test(BuildDepends
-DCMAKE_C_LINK_DEPENDS_USE_COMPILER=${CMAKE_C_LINK_DEPENDS_USE_COMPILER}
-DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS}
)
+set_property(TEST RunCMake.BuildDepends APPEND PROPERTY LABELS "Fortran")
add_RunCMake_test(BuiltinTargets)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
@@ -364,7 +367,7 @@ foreach(lang IN ITEMS CUDA HIP ISPC)
endif()
endforeach()
add_RunCMake_test(CompilerTest)
-set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC")
+set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC" "Fortran")
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
add_RunCMake_test(DisallowedCommands)
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
@@ -490,6 +493,7 @@ add_RunCMake_test(add_dependencies)
add_RunCMake_test(add_executable)
add_RunCMake_test(add_library)
add_RunCMake_test(add_subdirectory -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
+set_property(TEST RunCMake.add_subdirectory APPEND PROPERTY LABELS "Fortran")
add_RunCMake_test(add_test -DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator>)
add_RunCMake_test(build_command)
add_executable(exit_code exit_code.c)
@@ -611,6 +615,8 @@ if(CMAKE_Fortran_COMPILER)
list(APPEND try_run_ARGS -DCMake_TEST_Fortran=1)
endif()
add_RunCMake_test(try_run)
+set_property(TEST RunCMake.try_run APPEND PROPERTY LABELS "Fortran")
+
add_RunCMake_test(set)
add_RunCMake_test(variable_watch)
add_RunCMake_test(while)
@@ -629,7 +635,9 @@ if(CMake_TEST_CUDA)
add_RunCMake_test(CUDA_architectures)
set_property(TEST RunCMake.CUDA_architectures APPEND PROPERTY LABELS "CUDA")
endif()
+
add_RunCMake_test(DependencyGraph -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
+set_property(TEST RunCMake.DependencyGraph APPEND PROPERTY LABELS "Fortran")
# Add C++ Module tests.
add_RunCMake_test(CXXModules -DCMake_TEST_MODULE_COMPILATION=${CMake_TEST_MODULE_COMPILATION} -DCMake_TEST_MODULE_COMPILATION_RULES=${CMake_TEST_MODULE_COMPILATION_RULES})
@@ -839,14 +847,10 @@ add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
set_property(TEST RunCMake.CheckCompilerFlag
RunCMake.CheckSourceCompiles
RunCMake.CheckSourceRuns
- APPEND PROPERTY LABELS "CUDA")
+ APPEND PROPERTY LABELS "CUDA" "HIP" "Fortran")
set_property(TEST RunCMake.CheckSourceCompiles
RunCMake.CheckCompilerFlag
APPEND PROPERTY LABELS "ISPC")
-set_property(TEST RunCMake.CheckCompilerFlag
- RunCMake.CheckSourceCompiles
- RunCMake.CheckSourceRuns
- APPEND PROPERTY LABELS "HIP")
add_RunCMake_test(CheckModules)
add_RunCMake_test(CheckIPOSupported)
if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
@@ -855,8 +859,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
-DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID}
-DCMake_TEST_CUDA=${CMake_TEST_CUDA}
-DCMake_TEST_HIP=${CMake_TEST_HIP})
- set_property(TEST RunCMake.CheckLinkerFlag APPEND PROPERTY LABELS "CUDA")
- set_property(TEST RunCMake.CheckLinkerFlag APPEND PROPERTY LABELS "HIP")
+ set_property(TEST RunCMake.CheckLinkerFlag APPEND PROPERTY LABELS "CUDA" "HIP" "Fortran")
endif()
@@ -974,6 +977,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
-DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint>
-DPSEUDO_CPPCHECK=$<TARGET_FILE:pseudo_cppcheck>
)
+
if(DEFINED CMake_TEST_CUDA)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
endif()
@@ -992,7 +996,8 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
endif()
add_RunCMake_test(CompilerLauncher)
set_property(TEST RunCMake.CompilerLauncher APPEND
- PROPERTY LABELS "CUDA;HIP;ISPC")
+ PROPERTY LABELS "CUDA" "HIP" "ISPC" "Fortran")
+
add_RunCMake_test(ctest_labels_for_subprojects)
add_RunCMake_test(CompilerArgs)
add_RunCMake_test(LinkerLauncher)
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index 3d80270..0971025 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -134,6 +134,7 @@ if (CMake_TEST_UseSWIG_Fortran)
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ set_property(TEST UseSWIG.BasicFortran APPEND PROPERTY LABELS "Fortran")
endif()
endif()