Tests: Test more CMakeTest*Compiler.cmake fallbacks

Extend the test added by commit f891a75d5c (Tests: Test
CMakeTest*Compiler.cmake fallbacks, 2022-09-27) to cover more languages.
This commit is contained in:
Brad King
2022-09-29 08:04:05 -04:00
parent cadcb6a5f0
commit 586c2ab4f1
10 changed files with 46 additions and 0 deletions

View File

@@ -298,7 +298,16 @@ add_RunCMake_test(CompilerNotFound)
if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
list(APPEND CompilerTest_ARGS -DCMake_TEST_OBJC=1)
endif()
if(CMAKE_Fortran_COMPILER)
list(APPEND CompilerTest_ARGS -DCMake_TEST_Fortran=1)
endif()
foreach(lang IN ITEMS CUDA HIP ISPC)
if(CMake_TEST_${lang})
list(APPEND CompilerTest_ARGS -DCMake_TEST_${lang}=1)
endif()
endforeach()
add_RunCMake_test(CompilerTest)
set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC")
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
add_RunCMake_test(DisallowedCommands)
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")

View File

@@ -0,0 +1,2 @@
-- Check for working CUDA compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_CUDA_ABI_COMPILED FALSE)
enable_language(CUDA)

View File

@@ -0,0 +1,2 @@
-- Check for working Fortran compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_Fortran_ABI_COMPILED FALSE)
enable_language(Fortran)

View File

@@ -0,0 +1,2 @@
-- Check for working HIP compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_HIP_ABI_COMPILED FALSE)
enable_language(HIP)

View File

@@ -0,0 +1,3 @@
-- The ISPC compiler identification is [^
]*
-- Configuring done

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_ISPC_ABI_COMPILED FALSE)
enable_language(ISPC)

View File

@@ -3,6 +3,22 @@ include(RunCMake)
run_cmake(C)
run_cmake(CXX)
if(CMake_TEST_CUDA)
run_cmake(CUDA)
endif()
if(CMake_TEST_Fortran)
run_cmake(Fortran)
endif()
if(CMake_TEST_HIP)
run_cmake(HIP)
endif()
if(CMake_TEST_ISPC)
run_cmake(ISPC)
endif()
if(CMake_TEST_OBJC)
run_cmake(OBJC)
run_cmake(OBJCXX)