diff options
Diffstat (limited to 'Tests/RunCMake')
115 files changed, 715 insertions, 112 deletions
diff --git a/Tests/RunCMake/CMP0104/CMP0104-OLD-stderr.txt b/Tests/RunCMake/CMP0104/CMP0104-OLD-stderr.txt new file mode 100644 index 0000000..66d3016 --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMP0104-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0104-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0104 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0106/CMP0106-OLD-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-OLD-stderr.txt new file mode 100644 index 0000000..ef48d5c --- /dev/null +++ b/Tests/RunCMake/CMP0106/CMP0106-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0106-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0106 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3038ed8..ad5cbb2 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -299,8 +299,8 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja") add_RunCMake_test(CompilerChange) endif() add_RunCMake_test(CompilerNotFound) -if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") - list(APPEND CompilerTest_ARGS -DCMake_TEST_OBJC=1) +if(DEFINED CMake_TEST_OBJC) + list(APPEND CompilerTest_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC}) endif() if(CMAKE_Fortran_COMPILER) list(APPEND CompilerTest_ARGS -DCMake_TEST_Fortran=1) @@ -361,7 +361,7 @@ if(XCODE_VERSION) set(GeneratorToolset_ARGS -DXCODE_VERSION=${XCODE_VERSION}) endif() add_RunCMake_test(GeneratorToolset) -add_RunCMake_test(GetPrerequisites) +add_RunCMake_test(GetPrerequisites -DSAMPLE_EXE=$<TARGET_FILE:exit_code>) add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test add_RunCMake_test(Graphviz) @@ -502,64 +502,15 @@ if(APPLE) endif() function(add_RunCMake_test_try_compile) - if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") - # Older CMake versions do not know about MSVC language standards. - # Approximate our logic from MSVC-CXX.cmake. - if ((NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) OR - NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10.25017) - set(CMAKE_CXX_STANDARD_DEFAULT 14) - elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) - set(CMAKE_CXX_STANDARD_DEFAULT "") - else() - unset(CMAKE_CXX_STANDARD_DEFAULT) - endif() - endif() - if(CMAKE_VERSION VERSION_LESS 3.18.20200813 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC") - # Older CMake versions do not know about MSVC language standards. - # Approximate our logic from MSVC-C.cmake. - if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.27) - set(CMAKE_C_STANDARD_DEFAULT 99) - else() - set(CMAKE_C_STANDARD_DEFAULT "") - endif() - endif() - if(CMAKE_VERSION VERSION_LESS 3.20.20210225 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang") - # Older CMake versions do not know about Clang MSVC compatibility mode - # standards. Approximate the logic from Clang-C.cmake. - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) - set(CMAKE_C_STANDARD_DEFAULT 17) - elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5.2) - set(CMAKE_C_STANDARD_DEFAULT 11) - endif() - endif() - if(CMAKE_VERSION VERSION_LESS 3.20.6 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xIntelLLVM" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") - # Older CMake versions accidentally set the default standards to empty when - # IntelLLVM targets the MSVC ABI, thus not activating standard selection. - # Approximate the logic from IntelLLVM-{C,CXX}.cmake. - if(DEFINED CMAKE_C_STANDARD_DEFAULT AND "${CMAKE_C_STANDARD_DEFAULT}" STREQUAL "") - set(CMAKE_C_STANDARD_DEFAULT 17) - endif() - if(DEFINED CMAKE_CXX_STANDARD_DEFAULT AND "${CMAKE_CXX_STANDARD_DEFAULT}" STREQUAL "") - set(CMAKE_CXX_STANDARD_DEFAULT 14) - endif() - endif() foreach( var IN ITEMS CMAKE_SYSTEM_NAME - CMAKE_C_COMPILER_ID - CMAKE_C_COMPILER_VERSION - CMAKE_C_STANDARD_DEFAULT - CMAKE_CXX_COMPILER_ID - CMAKE_CXX_COMPILER_VERSION - CMAKE_CXX_STANDARD_DEFAULT CMake_TEST_CUDA CMake_TEST_ISPC CMake_TEST_HIP + CMake_TEST_OBJC CMake_TEST_FILESYSTEM_1S - CMAKE_OBJC_STANDARD_DEFAULT - CMAKE_OBJCXX_STANDARD_DEFAULT ) if(DEFINED ${var}) list(APPEND try_compile_ARGS -D${var}=${${var}}) @@ -752,11 +703,13 @@ add_RunCMake_test(target_sources) add_RunCMake_test(CheckCompilerFlag -DCMake_TEST_CUDA=${CMake_TEST_CUDA} -DCMake_TEST_ISPC=${CMake_TEST_ISPC} -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID} - -DCMake_TEST_HIP=${CMake_TEST_HIP}) + -DCMake_TEST_HIP=${CMake_TEST_HIP} + -DCMake_TEST_Swift=${CMake_TEST_Swift}) add_RunCMake_test(CheckSourceCompiles -DCMake_TEST_CUDA=${CMake_TEST_CUDA} -DCMake_TEST_ISPC=${CMake_TEST_ISPC} -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID} - -DCMake_TEST_HIP=${CMake_TEST_HIP}) + -DCMake_TEST_HIP=${CMake_TEST_HIP} + -DCMake_TEST_Swift=${CMake_TEST_Swift}) add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA} -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID} -DCMake_TEST_HIP=${CMake_TEST_HIP}) @@ -896,13 +849,13 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") if(DEFINED CMake_TEST_ISPC) list(APPEND CompilerLauncher_ARGS -DCMake_TEST_ISPC=${CMake_TEST_ISPC}) endif() + if(DEFINED CMake_TEST_OBJC) + list(APPEND CompilerLauncher_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC}) + list(APPEND LinkerLauncher_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC}) + endif() if(CMAKE_Fortran_COMPILER) list(APPEND CompilerLauncher_ARGS -DCMake_TEST_Fortran=1) endif() - if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") - list(APPEND CompilerLauncher_ARGS -DCMake_TEST_OBJC=1) - list(APPEND LinkerLauncher_ARGS -DCMake_TEST_OBJC=1) - endif() add_RunCMake_test(CompilerLauncher) set_property(TEST RunCMake.CompilerLauncher APPEND PROPERTY LABELS "CUDA;HIP;ISPC") diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index 3f17c1f..921fabd 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -120,7 +120,9 @@ function (run_cxx_module_test directory) if (RunCMake_CXXModules_INSTALL) run_cmake_command("examples/${test_name}-install" "${CMAKE_COMMAND}" --build . --target install --config Debug) endif () - run_cmake_command("examples/${test_name}-test" "${CMAKE_CTEST_COMMAND}" -C Debug --output-on-failure) + if (NOT RunCMake_CXXModules_NO_TEST) + run_cmake_command("examples/${test_name}-test" "${CMAKE_CTEST_COMMAND}" -C Debug --output-on-failure) + endif () endfunction () string(REPLACE "," ";" CMake_TEST_MODULE_COMPILATION "${CMake_TEST_MODULE_COMPILATION}") @@ -132,6 +134,10 @@ if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(generated) run_cxx_module_test(public-req-private) run_cxx_module_test(deep-chain) + run_cxx_module_test(duplicate) + set(RunCMake_CXXModules_NO_TEST 1) + run_cxx_module_test(circular) + unset(RunCMake_CXXModules_NO_TEST) endif () # Tests which use named modules in shared libraries. diff --git a/Tests/RunCMake/CXXModules/examples/circular-build-result.txt b/Tests/RunCMake/CXXModules/examples/circular-build-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/circular-build-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt b/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt new file mode 100644 index 0000000..433b461 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt @@ -0,0 +1 @@ +(Ninja generators)?(build stopped: dependency cycle:) diff --git a/Tests/RunCMake/CXXModules/examples/circular-stderr.txt b/Tests/RunCMake/CXXModules/examples/circular-stderr.txt new file mode 100644 index 0000000..5e4392a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/circular-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\): + C\+\+20 modules support via CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP is + experimental. It is meant only for compiler developers to try. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt new file mode 100644 index 0000000..4d1997c --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_circular CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +add_library(circular STATIC) +target_sources(circular + PUBLIC + FILE_SET CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + circular-a.cppm + circular-b.cppm) +target_compile_features(circular PUBLIC cxx_std_20) diff --git a/Tests/RunCMake/CXXModules/examples/circular/circular-a.cppm b/Tests/RunCMake/CXXModules/examples/circular/circular-a.cppm new file mode 100644 index 0000000..eea842b --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/circular/circular-a.cppm @@ -0,0 +1,6 @@ +export module a; +import b; + +export int a() { + return b(); +} diff --git a/Tests/RunCMake/CXXModules/examples/circular/circular-b.cppm b/Tests/RunCMake/CXXModules/examples/circular/circular-b.cppm new file mode 100644 index 0000000..fc6dc42 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/circular/circular-b.cppm @@ -0,0 +1,6 @@ +export module b; +import a; + +export int b() { + return a(); +} diff --git a/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt b/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt new file mode 100644 index 0000000..5e4392a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\): + C\+\+20 modules support via CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP is + experimental. It is meant only for compiler developers to try. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt new file mode 100644 index 0000000..27be7a8 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_duplicate CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +add_executable(duplicate) +target_sources(duplicate + PRIVATE + main.cxx + PRIVATE + FILE_SET CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + duplicate.cxx) +target_compile_features(duplicate PRIVATE cxx_std_20) +target_compile_definitions(duplicate PRIVATE NDUPLICATE=1) + +add_executable(duplicate2) +target_sources(duplicate2 + PRIVATE + main.cxx + PRIVATE + FILE_SET CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + duplicate.cxx) +target_compile_features(duplicate2 PRIVATE cxx_std_20) +target_compile_definitions(duplicate2 PRIVATE NDUPLICATE=2) + +add_test(NAME duplicate COMMAND duplicate) +set_property(TEST duplicate + PROPERTY + PASS_REGULAR_EXPRESSION "From duplicate #1") +add_test(NAME duplicate2 COMMAND duplicate2) +set_property(TEST duplicate2 + PROPERTY + PASS_REGULAR_EXPRESSION "From duplicate #2") diff --git a/Tests/RunCMake/CXXModules/examples/duplicate/duplicate.cxx b/Tests/RunCMake/CXXModules/examples/duplicate/duplicate.cxx new file mode 100644 index 0000000..c0c820b --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/duplicate/duplicate.cxx @@ -0,0 +1,11 @@ +module; + +#include <iostream> + +export module duplicate; + +export int from_import() +{ + std::cerr << "From duplicate #" << NDUPLICATE << std::endl; + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/duplicate/main.cxx b/Tests/RunCMake/CXXModules/examples/duplicate/main.cxx new file mode 100644 index 0000000..c2c0636 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/duplicate/main.cxx @@ -0,0 +1,6 @@ +import duplicate; + +int main(int argc, char* argv[]) +{ + return from_import(); +} diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake new file mode 100644 index 0000000..23b3006 --- /dev/null +++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake @@ -0,0 +1,21 @@ +enable_language (Swift) +include(CheckCompilerFlag) + +set(Swift 1) + +# test that the check uses an isolated locale +set(_env_LC_ALL "${LC_ALL}") +set(ENV{LC_ALL} "BAD") + +check_compiler_flag(Swift "-foo-as-blarpy" SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "invalid Swift compile flag didn't fail.") +endif() + +check_compiler_flag(Swift "-parseable-output" SHOULD_WORK) +if(NOT SHOULD_WORK) + message(SEND_ERROR "Swift compiler flag '-parseable-output' check failed") +endif() + +# Reset locale +set(ENV{LC_ALL} ${_env_LC_ALL}) diff --git a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake index b0e025c..81429a6 100644 --- a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake @@ -32,3 +32,7 @@ endif() if(APPLE) run_cmake(HeaderpadWorkaround) endif() + +if(CMake_TEST_Swift) + run_cmake(CheckCompilerFlagSwift) +endif() diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake new file mode 100644 index 0000000..767fa69 --- /dev/null +++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake @@ -0,0 +1,15 @@ +enable_language(Swift) +include(CheckSourceCompiles) + +set(Swift 1) # test that this is tolerated + +check_source_compiles(Swift "baz()" SHOULD_FAIL) + +if(SHOULD_FAIL) + message(SEND_ERROR "invalid Swift source didn't fail.") +endif() + +check_source_compiles(Swift "print(\"Hello, CMake\")" SHOULD_BUILD) +if(NOT SHOULD_BUILD) + message(SEND_ERROR "Test failed for valid Swift source.") +endif() diff --git a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake index df77d3d..2ed3e36 100644 --- a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake @@ -31,3 +31,7 @@ endif() if(CMake_TEST_HIP) run_cmake(CheckSourceCompilesHIP) endif() + +if(CMake_TEST_Swift) + run_cmake(CheckSourceCompilesSwift) +endif() diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 1452c9b..969d8be 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -1 +1 @@ -^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":4}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ +^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":5}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ diff --git a/Tests/RunCMake/CommandLine/Envgen-bad-help-stderr.txt b/Tests/RunCMake/CommandLine/Envgen-bad-help-stderr.txt new file mode 100644 index 0000000..cdfe857 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Envgen-bad-help-stderr.txt @@ -0,0 +1 @@ +CMake Error: CMAKE_GENERATOR was set but the specified generator doesn't exist. Using CMake default. diff --git a/Tests/RunCMake/CommandLine/Envgen-bad-help-stdout.txt b/Tests/RunCMake/CommandLine/Envgen-bad-help-stdout.txt new file mode 100644 index 0000000..075c48c --- /dev/null +++ b/Tests/RunCMake/CommandLine/Envgen-bad-help-stdout.txt @@ -0,0 +1,2 @@ +Generators.* +\* (Unix Makefiles|Visual Studio).* diff --git a/Tests/RunCMake/CommandLine/Envgen-ninja-multi-help-stdout.txt b/Tests/RunCMake/CommandLine/Envgen-ninja-multi-help-stdout.txt new file mode 100644 index 0000000..ece6e5d --- /dev/null +++ b/Tests/RunCMake/CommandLine/Envgen-ninja-multi-help-stdout.txt @@ -0,0 +1 @@ +\* Ninja Multi-Config[ ]+= Generates build-<Config>.ninja files. diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index a2eeddf..327b772 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -349,6 +349,13 @@ function(run_EnvironmentGenerator) run_cmake_command(Envgen-bad ${CMAKE_COMMAND} -G) unset(ENV{CMAKE_GENERATOR}) + # Honor CMAKE_GENERATOR env var in --help output + set(ENV{CMAKE_GENERATOR} "Ninja Multi-Config") + run_cmake_command(Envgen-ninja-multi-help ${CMAKE_COMMAND} --help) + set(ENV{CMAKE_GENERATOR} "NoSuchGenerator") + run_cmake_command(Envgen-bad-help ${CMAKE_COMMAND} --help) + unset(ENV{CMAKE_GENERATOR}) + if(RunCMake_GENERATOR MATCHES "Visual Studio.*") set(ENV{CMAKE_GENERATOR} "${RunCMake_GENERATOR}") run_cmake_command(Envgen ${CMAKE_COMMAND} ${source_dir}) @@ -940,6 +947,7 @@ unset(RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS --trace) run_cmake(trace) +run_cmake(trace-try_compile) unset(RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS --trace-expand) @@ -952,6 +960,7 @@ unset(RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS --trace-redirect=${RunCMake_BINARY_DIR}/redirected.trace) run_cmake(trace-redirect) +run_cmake(trace-try_compile-redirect) unset(RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS --trace-redirect=/no/such/file.txt) diff --git a/Tests/RunCMake/CommandLine/compare_files/.gitattributes b/Tests/RunCMake/CommandLine/compare_files/.gitattributes index 91d5c10..d03da96 100644 --- a/Tests/RunCMake/CommandLine/compare_files/.gitattributes +++ b/Tests/RunCMake/CommandLine/compare_files/.gitattributes @@ -1,2 +1,2 @@ -crlf eol=crlf -lf eol=lf +crlf -text -whitespace +lf -text diff --git a/Tests/RunCMake/CommandLine/compare_files/crlf b/Tests/RunCMake/CommandLine/compare_files/crlf index a29bdeb..495181c 100644 --- a/Tests/RunCMake/CommandLine/compare_files/crlf +++ b/Tests/RunCMake/CommandLine/compare_files/crlf @@ -1 +1 @@ -line1 +line1
diff --git a/Tests/RunCMake/CommandLine/trace-try_compile-redirect-check.cmake b/Tests/RunCMake/CommandLine/trace-try_compile-redirect-check.cmake new file mode 100644 index 0000000..94a7c95 --- /dev/null +++ b/Tests/RunCMake/CommandLine/trace-try_compile-redirect-check.cmake @@ -0,0 +1,13 @@ +file(READ ${RunCMake_SOURCE_DIR}/trace-try_compile-stderr.txt expected_content) +string(REGEX REPLACE "\n+$" "" expected_content "${expected_content}") + +file(READ ${RunCMake_BINARY_DIR}/redirected.trace actual_content) +string(REGEX REPLACE "\r\n" "\n" actual_content "${actual_content}") +string(REGEX REPLACE "\n+$" "" actual_content "${actual_content}") +if(NOT "${actual_content}" MATCHES "${expected_content}") + set(RunCMake_TEST_FAILED + "Trace file content does not match that expected." + "Expected to match:\n${expected_content}\n" + "Actual content:\n${actual_content}\n" + ) +endif() diff --git a/Tests/RunCMake/CommandLine/trace-try_compile-redirect.cmake b/Tests/RunCMake/CommandLine/trace-try_compile-redirect.cmake new file mode 100644 index 0000000..982cb89 --- /dev/null +++ b/Tests/RunCMake/CommandLine/trace-try_compile-redirect.cmake @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 3.24) +project(test C) diff --git a/Tests/RunCMake/CommandLine/trace-try_compile-stderr.txt b/Tests/RunCMake/CommandLine/trace-try_compile-stderr.txt new file mode 100644 index 0000000..1674b8f --- /dev/null +++ b/Tests/RunCMake/CommandLine/trace-try_compile-stderr.txt @@ -0,0 +1,4 @@ +.*Modules/CMakeDetermineCompilerABI.cmake\([0-9]+\): try_compile\([^)]+\) +.*Tests/RunCMake/CommandLine/trace-try_compile(-redirect)?-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+/CMakeLists.txt\([0-9]+\): cmake_minimum_required.* +.*Tests/RunCMake/CommandLine/trace-try_compile(-redirect)?-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+/CMakeLists.txt\([0-9]+\): project\(CMAKE_TRY_COMPILE.* +.*Tests/RunCMake/CommandLine/trace-try_compile(-redirect)?-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+/CMakeLists.txt\([0-9]+\): add_executable\(cmTC_.* diff --git a/Tests/RunCMake/CommandLine/trace-try_compile.cmake b/Tests/RunCMake/CommandLine/trace-try_compile.cmake new file mode 100644 index 0000000..982cb89 --- /dev/null +++ b/Tests/RunCMake/CommandLine/trace-try_compile.cmake @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 3.24) +project(test C) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index b7623de..fda18b5 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -12,7 +12,7 @@ def read_codemodel_json_data(filename): def check_objects(o, g): assert is_list(o) assert len(o) == 1 - check_index_object(o[0], "codemodel", 2, 4, check_object_codemodel(g)) + check_index_object(o[0], "codemodel", 2, 5, check_object_codemodel(g)) def check_backtrace(t, b, backtrace): btg = t["backtraceGraph"] @@ -291,10 +291,30 @@ def check_target(c): assert matches(obj["paths"]["build"], expected["build"]) assert matches(obj["paths"]["source"], expected["source"]) + def check_file_set(actual, expected): + assert is_dict(actual) + expected_keys = ["name", "type", "visibility", "baseDirectories"] + + assert is_string(actual["name"], expected["name"]) + assert is_string(actual["type"], expected["type"]) + assert is_string(actual["visibility"], expected["visibility"]) + + check_list_match(lambda a, e: matches(a, e), actual["baseDirectories"], + expected["baseDirectories"], + check_exception=lambda a, e: "File set base directory (check): %s" % a, + missing_exception=lambda e: "File set base directory (missing): %s" % e, + extra_exception=lambda a: "File set base directory (extra): %s" % a) + + assert sorted(actual.keys()) == sorted(expected_keys) + def check_source(actual, expected): assert is_dict(actual) expected_keys = ["path"] + if expected["fileSetName"] is not None: + expected_keys.append("fileSetIndex") + assert is_string(obj["fileSets"][actual["fileSetIndex"]]["name"], expected["fileSetName"]) + if expected["compileGroupLanguage"] is not None: expected_keys.append("compileGroupIndex") assert is_string(obj["compileGroups"][actual["compileGroupIndex"]]["language"], expected["compileGroupLanguage"]) @@ -313,6 +333,14 @@ def check_target(c): assert sorted(actual.keys()) == sorted(expected_keys) + if expected["fileSets"] is not None: + expected_keys.append("fileSets") + check_list_match(lambda a, e: matches(a["name"], e["name"]), obj["fileSets"], + expected["fileSets"], check=check_file_set, + check_exception=lambda a, e: "File set: %s" % a["name"], + missing_exception=lambda e: "File set: %s" % e["name"], + extra_exception=lambda a: "File set: %s" % a["name"]) + check_list_match(lambda a, e: matches(a["path"], e["path"]), obj["sources"], expected["sources"], check=check_source, check_exception=lambda a, e: "Source file: %s" % a["path"], @@ -824,6 +852,7 @@ def gen_check_targets(c, g, inSource): { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", "isGenerated": True, + "fileSetName": None, "sourceGroupName": "CMake Rules", "compileGroupLanguage": None, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json index eabf739..63493c9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json @@ -5,10 +5,12 @@ "projectName": "Alias", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json index a5ff686..411057c 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json @@ -5,10 +5,12 @@ "projectName": "Custom", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json index 1f443b1..bf36bfe 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json index 017335c..ebda414 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json @@ -5,10 +5,12 @@ "projectName": "External", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json index 2de5b15..579a103 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json index fa2a6e5..ec03531 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json @@ -5,10 +5,12 @@ "projectName": "Interface", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json index 9d8899a..f145896 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json @@ -5,10 +5,12 @@ "projectName": "Object", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json index 0d45d07..46495ac 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json index ac7c94d..a27d328 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json @@ -5,10 +5,12 @@ "projectName": "Alias", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json index 7af74c4..7cfc0f2 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json index c189623..715514d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json @@ -5,10 +5,37 @@ "projectName": "codemodel-v2", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": [ + { + "name": "HEADERS", + "type": "HEADERS", + "visibility": "PUBLIC", + "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"] + }, + { + "name": "a", + "type": "HEADERS", + "visibility": "PRIVATE", + "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"] + }, + { + "name": "b", + "type": "HEADERS", + "visibility": "PUBLIC", + "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset/dir$"] + }, + { + "name": "c", + "type": "HEADERS", + "visibility": "INTERFACE", + "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"] + } + ], "sources": [ { "path": "^fileset/empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ @@ -29,6 +56,7 @@ { "path": "^fileset/error\\.c$", "isGenerated": null, + "fileSetName": "HEADERS", "sourceGroupName": "Header Files", "compileGroupLanguage": null, "backtrace": [ @@ -49,6 +77,7 @@ { "path": "^fileset/other\\.c$", "isGenerated": null, + "fileSetName": "HEADERS", "sourceGroupName": "Source Files", "compileGroupLanguage": null, "backtrace": [ @@ -69,6 +98,7 @@ { "path": "^fileset/h1\\.h$", "isGenerated": null, + "fileSetName": "a", "sourceGroupName": "Header Files", "compileGroupLanguage": null, "backtrace": [ @@ -89,6 +119,7 @@ { "path": "^fileset/dir/h2\\.h$", "isGenerated": null, + "fileSetName": "b", "sourceGroupName": "Header Files", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json index 75fe58c..4757a9c 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json @@ -5,10 +5,19 @@ "projectName": "codemodel-v2", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": [ + { + "name": "HEADERS", + "type": "HEADERS", + "visibility": "INTERFACE", + "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"] + } + ], "sources": [ { "path": "^fileset/empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json index 0ca1962..2bfc63f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json index 3392404..6342191 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json @@ -5,10 +5,12 @@ "projectName": "Object", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ @@ -29,6 +31,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(object|build/c_object_lib\\.build)/.*/empty(\\.c)?\\.o(bj)?$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "Object Libraries", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json index 1917f92..3e1b03b 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json @@ -5,10 +5,12 @@ "projectName": "Object", "type": "OBJECT_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json index 0d4018a..f7a8db4 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json index 9a210ff..9066053 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "SHARED_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json index 5542277..46c5bfe 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json index 4b63897..df28479 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json index 12ec917..4fa62e3 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^subdir/empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json index ab301e9..8d52ab8 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json @@ -5,10 +5,12 @@ "projectName": "Custom", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json index 483ae79..23f8e52 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json @@ -5,10 +5,12 @@ "projectName": "Custom", "type": "UTILITY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt(-(Debug|Release|RelWithDebInfo|MinSizeRel))?$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -29,6 +31,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt(-\\(CONFIG\\))?\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json index 837f252..b27fc5b 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json @@ -5,10 +5,12 @@ "projectName": "Alias", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json index 16d074a..12b2551 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json index 5a0f770..3251777 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json @@ -97,6 +97,7 @@ { "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -111,6 +112,7 @@ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -131,6 +133,7 @@ { "path": ".*/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json index 9455748..0ac40c2 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json @@ -143,6 +143,7 @@ { "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -157,6 +158,7 @@ { "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -171,6 +173,7 @@ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -191,6 +194,7 @@ { "path": ".*/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ @@ -205,6 +209,7 @@ { "path": ".*/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json index 9f6ffcc..86168f1 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json @@ -97,6 +97,7 @@ { "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -111,6 +112,7 @@ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -131,6 +133,7 @@ { "path": ".*/Debug/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ @@ -145,6 +148,7 @@ { "path": ".*/Release/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ @@ -159,6 +163,7 @@ { "path": ".*/MinSizeRel/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ @@ -173,6 +178,7 @@ { "path": ".*/RelWithDebInfo/cmake_pch(_[^.]+)?\\.hxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Precompile Header File", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json index 94ac081..f665004 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json index e8d6218..68c5dcc 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json @@ -5,10 +5,12 @@ "projectName": "Object", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ @@ -29,6 +31,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(object|build/cxx_object_lib\\.build)/.*/empty(\\.cxx)?\\.o(bj)?$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "Object Libraries", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json index 24b391b..0438a49 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json @@ -5,10 +5,12 @@ "projectName": "Object", "type": "OBJECT_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json index 4421c8f..bb9989e 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json index 03f4cb9..d6d59a4 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "SHARED_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json index d6d573f..a6bacf7 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json index 9cb2832..fe884e0 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json index 52c42de..d904bd9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json index 98298be..bced68a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "STATIC_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.cxx$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json index d41bbb2..4b69682 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json @@ -5,10 +5,12 @@ "projectName": "External", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ @@ -29,6 +31,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "Generated Source Files", "compileGroupLanguage": "CXX", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json index 97d7ccd..bd698d5 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json @@ -5,10 +5,12 @@ "projectName": "Interface", "type": "INTERFACE_LIBRARY", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json index fe0524c..c0c3e79 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json index 451e8d4..45fb0a5 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json index cbd4346..74c179c 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json index d92a810..6771747 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json index 1197a73..659e3fb 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json index 42564e0..7bdaffb 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "EXECUTABLE", "isGeneratorProvided": null, + "fileSets": null, "sources": [ { "path": "^empty\\.c$", "isGenerated": null, + "fileSetName": null, "sourceGroupName": "Source Files", "compileGroupLanguage": "C", "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json index 941c172..7462f7f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json @@ -5,10 +5,12 @@ "projectName": "Alias", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json index 98c6dd9..abc5084 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json @@ -5,10 +5,12 @@ "projectName": "Custom", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json index b72ff82..af4248c 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json @@ -5,10 +5,12 @@ "projectName": "Cxx", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json index 9e73806..a7b8bb0 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json @@ -5,10 +5,12 @@ "projectName": "External", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json index 7534c84..ed3da5f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json @@ -5,10 +5,12 @@ "projectName": "Imported", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json index fdd4b2a..178f9ef 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json @@ -5,10 +5,12 @@ "projectName": "Interface", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json index bcd7616..341647b 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json @@ -5,10 +5,12 @@ "projectName": "Object", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json index b3030bd..b3827ed 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json @@ -5,10 +5,12 @@ "projectName": "codemodel-v2", "type": "UTILITY", "isGeneratorProvided": true, + "fileSets": null, "sources": [ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "", "compileGroupLanguage": null, "backtrace": [ @@ -23,6 +25,7 @@ { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", "isGenerated": true, + "fileSetName": null, "sourceGroupName": "CMake Rules", "compileGroupLanguage": null, "backtrace": [ diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake index f149d99..69ab4da 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake @@ -113,23 +113,33 @@ message(STATUS "Verifying target \"${tgt}\"") if (NOT TARGET ${tgt}) message(FATAL_ERROR "No import target for fake link options package") endif() -get_target_property(link_options ${tgt} INTERFACE_LINK_OPTIONS) -if (NOT link_options STREQUAL expected_link_options) - message(FATAL_ERROR - "Additional link options not present in INTERFACE_LINK_OPTIONS property\n" - "expected: \"${expected_link_options}\", but got \"${link_options}\"" - ) -endif() -get_target_property(inc_dirs ${tgt} INTERFACE_INCLUDE_DIRECTORIES) -set(expected_inc_dirs "/special" "/other" "/more") +# Some versions of pkg-config on Windows don't parse the Libs and Cflags +# correctly. The pkg-config that comes with Strawberry perl is one example. +# It appears to treat the dummymain part of Libs as a library and only returns +# -e. It also doesn't recognize "-isystem /other", presumably because it doesn't +# support having a space between "-isystem" and the directory after it (it does +# give us the "-isystem/more" flag). Since we can't reliably test for these, +# we don't enable these checks on Windows. +if(NOT WIN32) + get_target_property(link_options ${tgt} INTERFACE_LINK_OPTIONS) + if (NOT link_options STREQUAL expected_link_options) + message(FATAL_ERROR + "Additional link options not present in INTERFACE_LINK_OPTIONS property\n" + "expected: \"${expected_link_options}\", but got \"${link_options}\"" + ) + endif() -if (NOT inc_dirs STREQUAL expected_inc_dirs) - message(FATAL_ERROR - "Additional include directories not correctly present in INTERFACE_INCLUDE_DIRECTORIES property\n" - "expected: \"${expected_inc_dirs}\", got \"${inc_dirs}\"" - ) -endif () + get_target_property(inc_dirs ${tgt} INTERFACE_INCLUDE_DIRECTORIES) + set(expected_inc_dirs "/special" "/other" "/more") + + if (NOT inc_dirs STREQUAL expected_inc_dirs) + message(FATAL_ERROR + "Additional include directories not correctly present in INTERFACE_INCLUDE_DIRECTORIES property\n" + "expected: \"${expected_inc_dirs}\", got \"${inc_dirs}\"" + ) + endif () +endif() get_target_property(c_opts ${tgt} INTERFACE_COMPILE_OPTIONS) set(expected_c_opts "-DA-isystem/foo") # this is an invalid option, but a good testcase diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake index 2a505c6..f7a9815 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_VERSION_OPERATORS.cmake @@ -20,14 +20,15 @@ Libs: -lcmakeinternalfakepackage # Always find the .pc file in the calls further below so that we can test that # the import target find_library() calls handle the NO...PATH options correctly -set(ENV{PKG_CONFIG_PATH} ${fakePkgDir}/lib/pkgconfig) +cmake_path(CONVERT "${fakePkgDir}/lib/pkgconfig" TO_NATIVE_PATH_LIST confPath) +set(ENV{PKG_CONFIG_PATH} "${confPath}") -pkg_check_modules(FakePackageGE REQUIRED QUIET "cmakeinternalfakepackage >= 8") +pkg_check_modules(FakePackageGE REQUIRED QUIET "cmakeinternalfakepackage>=8") if (NOT FakePackageGE_FOUND) message(FATAL_ERROR "fake package >= 8 not found") endif() -pkg_check_modules(FakePackageGE_FAIL QUIET "cmakeinternalfakepackage >= 8.10") +pkg_check_modules(FakePackageGE_FAIL QUIET "cmakeinternalfakepackage>=8.10") if (FakePackageGE_FAIL_FOUND) message(FATAL_ERROR "fake package >= 8.10 found") endif() @@ -37,17 +38,17 @@ if (NOT FakePackageLE_FOUND) message(FATAL_ERROR "fake package <= 9 not found") endif() -pkg_check_modules(FakePackageLE_FAIL QUIET "cmakeinternalfakepackage <= 8.1") +pkg_check_modules(FakePackageLE_FAIL QUIET "cmakeinternalfakepackage<=8.1") if (FakePackageLE_FAIL_FOUND) message(FATAL_ERROR "fake package <= 8.1 found") endif() -pkg_check_modules(FakePackageGT REQUIRED QUIET "cmakeinternalfakepackage > 8") +pkg_check_modules(FakePackageGT REQUIRED QUIET "cmakeinternalfakepackage>8") if (NOT FakePackageGT_FOUND) message(FATAL_ERROR "fake package > 8 not found") endif() -pkg_check_modules(FakePackageGT_FAIL QUIET "cmakeinternalfakepackage > 8.9") +pkg_check_modules(FakePackageGT_FAIL QUIET "cmakeinternalfakepackage>8.9") if (FakePackageGT_FAIL_FOUND) message(FATAL_ERROR "fake package > 8.9 found") endif() @@ -57,7 +58,7 @@ if (NOT FakePackageLT_FOUND) message(FATAL_ERROR "fake package < 9 not found") endif() -pkg_check_modules(FakePackageLT_FAIL QUIET "cmakeinternalfakepackage < 8.9") +pkg_check_modules(FakePackageLT_FAIL QUIET "cmakeinternalfakepackage<8.9") if (FakePackageLT_FAIL_FOUND) message(FATAL_ERROR "fake package < 8.9 found") endif() @@ -67,17 +68,17 @@ if (NOT FakePackageEQ_FOUND) message(FATAL_ERROR "fake package = 8.9 not found") endif() -pkg_check_modules(FakePackageEQ_FAIL QUIET "cmakeinternalfakepackage = 8.8") +pkg_check_modules(FakePackageEQ_FAIL QUIET "cmakeinternalfakepackage=8.8") if (FakePackageEQ_FAIL_FOUND) message(FATAL_ERROR "fake package = 8.8 found") endif() -pkg_check_modules(FakePackageEQ_INV QUIET "cmakeinternalfakepackage == 8.9") +pkg_check_modules(FakePackageEQ_INV QUIET "cmakeinternalfakepackage==8.9") if (FakePackageEQ_FAIL_FOUND) message(FATAL_ERROR "fake package == 8.9 found") endif() -pkg_check_modules(FakePackageLLT_INV QUIET "cmakeinternalfakepackage <<= 9") +pkg_check_modules(FakePackageLLT_INV QUIET "cmakeinternalfakepackage<<=9") if (FakePackageLLT_FAIL_FOUND) message(FATAL_ERROR "fake package <<= 9 found") endif() diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake index 661ae3f..6b8e884 100644 --- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake @@ -7,13 +7,18 @@ set(ENV{CMAKE_FRAMEWORK_PATH} "") run_cmake(PkgConfigDoesNotExist) -run_cmake(FindPkgConfig_CMP0126_NEW) -run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH) -run_cmake(FindPkgConfig_PKGCONFIG_PATH) -run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH) -run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH) +if(NOT WIN32) + # FIXME: The Windows implementation of these tests do not work. + # They are disabled until they can be updated to a working state. + run_cmake(FindPkgConfig_CMP0126_NEW) + run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH) + run_cmake(FindPkgConfig_PKGCONFIG_PATH) + run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH) + run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH) + run_cmake(FindPkgConfig_GET_MATCHING_ARGN) +endif() + run_cmake(FindPkgConfig_extract_frameworks) -run_cmake(FindPkgConfig_GET_MATCHING_ARGN) if(APPLE) run_cmake(FindPkgConfig_extract_frameworks_target) diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake index d1bc9b1..9cc05d0 100644 --- a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake +++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake @@ -10,7 +10,9 @@ endfunction() # Should not throw any errors # Regular executable -get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "") +if(SAMPLE_EXE) + get_prerequisites("${SAMPLE_EXE}" cmake_prereqs 1 1 "" "") +endif() # Shell script check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh) # Batch script diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake index a635e38..5550c02 100644 --- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake +++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake @@ -1,4 +1,4 @@ include(RunCMake) run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake) -run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake) +run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -DSAMPLE_EXE=${SAMPLE_EXE} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake) diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-skip-test-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-skip-test-stdout.txt index 8d7527c..18f133a 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-skip-test-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-skip-test-stdout.txt @@ -1,10 +1,13 @@ Test project .* *Start +[0-9]+: skip_test\.test1 *[0-9]+/[0-9]+ +Test +#[0-9]+: skip_test\.test1 \.+\*\*\*Skipped +[0-9.]+ sec + *Start +[0-9]+: skip_test\.test1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: skip_test\.test1 \.+\*\*\*Skipped +[0-9.]+ sec -100% tests passed, 0 tests failed out of 1 +100% tests passed, 0 tests failed out of 2 Total Test time \(real\) = +[0-9.]+ sec The following tests did not run: [ 0-9]+- skip_test\.test1 \(Skipped\) +[ 0-9]+- skip_test\.test1 \(Skipped\) diff --git a/Tests/RunCMake/GoogleTest/GoogleTest.cmake b/Tests/RunCMake/GoogleTest/GoogleTest.cmake index 221d6ad..2ed43fc 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTest.cmake @@ -78,3 +78,7 @@ xcode_sign_adhoc(skip_test) gtest_discover_tests( skip_test ) + +gtest_add_tests( + TARGET skip_test +) diff --git a/Tests/RunCMake/GoogleTest/skip_test.cpp b/Tests/RunCMake/GoogleTest/skip_test.cpp index 2bc9fe1..919b1b3 100644 --- a/Tests/RunCMake/GoogleTest/skip_test.cpp +++ b/Tests/RunCMake/GoogleTest/skip_test.cpp @@ -1,6 +1,13 @@ #include <iostream> #include <string> +/* Having this as comment lets gtest_add_tests recognizes the test we fake + here without requiring googletest +TEST_F( skip_test, test1 ) +{ +} +*/ + int main(int argc, char** argv) { // Note: GoogleTest.cmake doesn't actually depend on Google Test as such; diff --git a/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake index a1ae6ac..30b24bf 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake @@ -7,7 +7,8 @@ set(expected_compile_commands ]*Debug[^ ]*", "file": "[^ -]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)" +]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)", + "output": "(CMakeFiles/exe\.dir/Debug/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Debug\\\\main\.c\.obj)" }, { "directory": "[^ @@ -16,7 +17,8 @@ set(expected_compile_commands ]*Release[^ ]*", "file": "[^ -]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)" +]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)", + "output": "(CMakeFiles/exe\.dir/Release/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Release\\\\main\.c\.obj)" } ]$]==]) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index ba9cc3b..cc754e8 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -155,6 +155,7 @@ function(run_cmake test) "|BullseyeCoverage" "|[a-z]+\\([0-9]+\\) malloc:" "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:" + "|icp?x: remark: Note that use of .-g. without any optimization-level option will turn off most compiler optimizations" "|lld-link: warning: procedure symbol record for .* refers to PDB item index [0-9A-Fa-fx]+ which is not a valid function ID record" "|Error kstat returned" "|Hit xcodebuild bug" diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index f027e94..ed74896 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -89,3 +89,10 @@ run_cmake(VsDotnetTargetFramework) run_cmake(VsDotnetTargetFrameworkVersion) run_cmake(VsNoCompileBatching) run_cmake(DebugInformationFormat) +run_cmake(VsCLREmpty) +run_cmake(VsCLRPure) +run_cmake(VsCLRSafe) + +if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.20) + run_cmake(VsCLRNetcore) +endif() diff --git a/Tests/RunCMake/VS10Project/VsCLREmpty-check.cmake b/Tests/RunCMake/VS10Project/VsCLREmpty-check.cmake new file mode 100644 index 0000000..990da46 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLREmpty-check.cmake @@ -0,0 +1,24 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(propertyFound FALSE) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<CompileAsManaged>(.*)</CompileAsManaged>$") + set(propertyFound TRUE) + set(expectedValue "true") + set(actualValue ${CMAKE_MATCH_1}) + if(NOT (${actualValue} STREQUAL ${expectedValue})) + set(RunCMake_TEST_FAILED "CompileAsManaged \"${actualValue}\" differs from expected value \"${expectedValue}\".") + return() + endif() + endif() +endforeach() + +if(NOT propertyFound) + set(RunCMake_TEST_FAILED "Property CompileAsManaged not found in project file.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCLREmpty.cmake b/Tests/RunCMake/VS10Project/VsCLREmpty.cmake new file mode 100644 index 0000000..a622f26 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLREmpty.cmake @@ -0,0 +1,6 @@ +enable_language(CXX) + +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + COMMON_LANGUAGE_RUNTIME "") diff --git a/Tests/RunCMake/VS10Project/VsCLRNetcore-check.cmake b/Tests/RunCMake/VS10Project/VsCLRNetcore-check.cmake new file mode 100644 index 0000000..a5058d7 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLRNetcore-check.cmake @@ -0,0 +1,24 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(propertyFound FALSE) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<CLRSupport>(.*)</CLRSupport>$") + set(propertyFound TRUE) + set(expectedValue "NetCore") + set(actualValue ${CMAKE_MATCH_1}) + if(NOT (${actualValue} STREQUAL ${expectedValue})) + set(RunCMake_TEST_FAILED "CLRSupport \"${actualValue}\" differs from expected value \"${expectedValue}\".") + return() + endif() + endif() +endforeach() + +if(NOT propertyFound) + set(RunCMake_TEST_FAILED "Property CLRSupport not found in project file.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCLRNetcore.cmake b/Tests/RunCMake/VS10Project/VsCLRNetcore.cmake new file mode 100644 index 0000000..c5ec2bc --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLRNetcore.cmake @@ -0,0 +1,6 @@ +enable_language(CXX) + +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + COMMON_LANGUAGE_RUNTIME "netcore") diff --git a/Tests/RunCMake/VS10Project/VsCLRPure-check.cmake b/Tests/RunCMake/VS10Project/VsCLRPure-check.cmake new file mode 100644 index 0000000..8ae73eb --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLRPure-check.cmake @@ -0,0 +1,24 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(propertyFound FALSE) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<CompileAsManaged>(.*)</CompileAsManaged>$") + set(propertyFound TRUE) + set(expectedValue "Pure") + set(actualValue ${CMAKE_MATCH_1}) + if(NOT (${actualValue} STREQUAL ${expectedValue})) + set(RunCMake_TEST_FAILED "CompileAsManaged \"${actualValue}\" differs from expected value \"${expectedValue}\".") + return() + endif() + endif() +endforeach() + +if(NOT propertyFound) + set(RunCMake_TEST_FAILED "Property CompileAsManaged not found in project file.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCLRPure.cmake b/Tests/RunCMake/VS10Project/VsCLRPure.cmake new file mode 100644 index 0000000..f919a1c --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLRPure.cmake @@ -0,0 +1,6 @@ +enable_language(CXX) + +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + COMMON_LANGUAGE_RUNTIME "pure") diff --git a/Tests/RunCMake/VS10Project/VsCLRSafe-check.cmake b/Tests/RunCMake/VS10Project/VsCLRSafe-check.cmake new file mode 100644 index 0000000..ebb1f71 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLRSafe-check.cmake @@ -0,0 +1,24 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(propertyFound FALSE) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<CompileAsManaged>(.*)</CompileAsManaged>$") + set(propertyFound TRUE) + set(expectedValue "Safe") + set(actualValue ${CMAKE_MATCH_1}) + if(NOT (${actualValue} STREQUAL ${expectedValue})) + set(RunCMake_TEST_FAILED "CompileAsManaged \"${actualValue}\" differs from expected value \"${expectedValue}\".") + return() + endif() + endif() +endforeach() + +if(NOT propertyFound) + set(RunCMake_TEST_FAILED "Property CompileAsManaged not found in project file.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCLRSafe.cmake b/Tests/RunCMake/VS10Project/VsCLRSafe.cmake new file mode 100644 index 0000000..5f114bf --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCLRSafe.cmake @@ -0,0 +1,6 @@ +enable_language(CXX) + +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + COMMON_LANGUAGE_RUNTIME "safe") diff --git a/Tests/RunCMake/VSSolution/CMP0143-NEW-check.cmake b/Tests/RunCMake/VSSolution/CMP0143-NEW-check.cmake new file mode 100644 index 0000000..6dd042b --- /dev/null +++ b/Tests/RunCMake/VSSolution/CMP0143-NEW-check.cmake @@ -0,0 +1,6 @@ +getProjectNames(projects) + +list(FIND projects "CMakePredefinedTargets" found) + if(found EQUAL "-1") + error("CMakePredefinedTargets should be defined when CMP0143 is NEW!") +endif() diff --git a/Tests/RunCMake/VSSolution/CMP0143-NEW.cmake b/Tests/RunCMake/VSSolution/CMP0143-NEW.cmake new file mode 100644 index 0000000..dd67b16 --- /dev/null +++ b/Tests/RunCMake/VSSolution/CMP0143-NEW.cmake @@ -0,0 +1 @@ +add_custom_target(TestStartup) diff --git a/Tests/RunCMake/VSSolution/CMP0143-OLD-check.cmake b/Tests/RunCMake/VSSolution/CMP0143-OLD-check.cmake new file mode 100644 index 0000000..2d9829c --- /dev/null +++ b/Tests/RunCMake/VSSolution/CMP0143-OLD-check.cmake @@ -0,0 +1,6 @@ +getProjectNames(projects) + +list(FIND projects "CMakePredefinedTargets" found) + if(NOT (found EQUAL "-1")) + error("CMakePredefinedTargets should not be defined when CMP0143 is OLD!") +endif() diff --git a/Tests/RunCMake/VSSolution/CMP0143-OLD.cmake b/Tests/RunCMake/VSSolution/CMP0143-OLD.cmake new file mode 100644 index 0000000..dd67b16 --- /dev/null +++ b/Tests/RunCMake/VSSolution/CMP0143-OLD.cmake @@ -0,0 +1 @@ +add_custom_target(TestStartup) diff --git a/Tests/RunCMake/VSSolution/CMP0143-WARN-check.cmake b/Tests/RunCMake/VSSolution/CMP0143-WARN-check.cmake new file mode 100644 index 0000000..2d9829c --- /dev/null +++ b/Tests/RunCMake/VSSolution/CMP0143-WARN-check.cmake @@ -0,0 +1,6 @@ +getProjectNames(projects) + +list(FIND projects "CMakePredefinedTargets" found) + if(NOT (found EQUAL "-1")) + error("CMakePredefinedTargets should not be defined when CMP0143 is OLD!") +endif() diff --git a/Tests/RunCMake/VSSolution/CMP0143-WARN.cmake b/Tests/RunCMake/VSSolution/CMP0143-WARN.cmake new file mode 100644 index 0000000..dd67b16 --- /dev/null +++ b/Tests/RunCMake/VSSolution/CMP0143-WARN.cmake @@ -0,0 +1 @@ +add_custom_target(TestStartup) diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake index c25833d..134821d 100644 --- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake +++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake @@ -15,4 +15,7 @@ run_cmake(AddPackageToDefault) if(NOT NO_USE_FOLDERS) run_cmake(StartupProjectUseFolders) + run_cmake(CMP0143-WARN) + run_cmake_with_options(CMP0143-OLD "-DCMAKE_POLICY_DEFAULT_CMP0143=OLD") + run_cmake_with_options(CMP0143-NEW "-DCMAKE_POLICY_DEFAULT_CMP0143=NEW") endif() diff --git a/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD-stderr.txt b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD-stderr.txt new file mode 100644 index 0000000..f5247ca --- /dev/null +++ b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at duplicate-target-CMP0107-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0107 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/export/Repeat-CMP0103-OLD-stderr.txt b/Tests/RunCMake/export/Repeat-CMP0103-OLD-stderr.txt new file mode 100644 index 0000000..1183f86 --- /dev/null +++ b/Tests/RunCMake/export/Repeat-CMP0103-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at Repeat-CMP0103-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0103 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/string/Timestamp-stderr.txt b/Tests/RunCMake/string/Timestamp-stderr.txt index f162f52..c57bba6 100644 --- a/Tests/RunCMake/string/Timestamp-stderr.txt +++ b/Tests/RunCMake/string/Timestamp-stderr.txt @@ -1 +1 @@ -RESULT=2005-08-07 23:19:49.000000 Sunday=Sun August=Aug 05 day=219 wd=0 week=32 w_iso=31 %I=11 epoch=1123456789 +^RESULT=2005-08-07 23:19:49.000000 Sunday=Sun August=Aug 05 day=219 wd=0 week=32 w_iso=31 %I=11 epoch=1123456789 TZ=GMT tz=\+0000$ diff --git a/Tests/RunCMake/string/Timestamp.cmake b/Tests/RunCMake/string/Timestamp.cmake index 531a237..3d68b1a 100644 --- a/Tests/RunCMake/string/Timestamp.cmake +++ b/Tests/RunCMake/string/Timestamp.cmake @@ -1,3 +1,3 @@ set(ENV{SOURCE_DATE_EPOCH} "1123456789") -string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S.%f %A=%a %B=%b %y day=%j wd=%w week=%U w_iso=%V %%I=%I epoch=%s" UTC) +string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S.%f %A=%a %B=%b %y day=%j wd=%w week=%U w_iso=%V %%I=%I epoch=%s TZ=%Z tz=%z" UTC) message("RESULT=${RESULT}") diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link-stderr.txt new file mode 100644 index 0000000..07e9a9f --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0108-OLD-self-link.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0108 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/try_compile/Inspect.cmake b/Tests/RunCMake/try_compile/Inspect.cmake index added41..2977d02 100644 --- a/Tests/RunCMake/try_compile/Inspect.cmake +++ b/Tests/RunCMake/try_compile/Inspect.cmake @@ -1,4 +1,25 @@ +enable_language(C) enable_language(CXX) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" " -set(CMAKE_CXX_EXTENSIONS_DEFAULT \"${CMAKE_CXX_EXTENSIONS_DEFAULT}\") -") +if(CMake_TEST_OBJC) + enable_language(OBJC) + enable_language(OBJCXX) +endif() + +set(info "") +foreach(var + CMAKE_C_COMPILER_ID + CMAKE_C_COMPILER_VERSION + CMAKE_C_STANDARD_DEFAULT + CMAKE_CXX_COMPILER_ID + CMAKE_CXX_COMPILER_VERSION + CMAKE_CXX_STANDARD_DEFAULT + CMAKE_CXX_EXTENSIONS_DEFAULT + CMAKE_OBJC_STANDARD_DEFAULT + CMAKE_OBJCXX_STANDARD_DEFAULT + ) + if(DEFINED ${var}) + string(APPEND info "set(${var} \"${${var}}\")\n") + endif() +endforeach() + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" "${info}") diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 7245471..ad1cc29 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -1,5 +1,20 @@ include(RunCMake) +# Detect information from the toolchain: +# - CMAKE_C_COMPILER_ID +# - CMAKE_C_COMPILER_VERSION +# - CMAKE_C_STANDARD_DEFAULT +# - CMAKE_CXX_COMPILER_ID +# - CMAKE_CXX_COMPILER_VERSION +# - CMAKE_CXX_STANDARD_DEFAULT +# - CMAKE_CXX_EXTENSIONS_DEFAULT +# - CMAKE_OBJC_STANDARD_DEFAULT +# - CMAKE_OBJCXX_STANDARD_DEFAULT +run_cmake_with_options(Inspect + -DCMake_TEST_OBJC=${CMake_TEST_OBJC} + ) +include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") + run_cmake(NoArgs) run_cmake(OneArg) run_cmake(TwoArgs) @@ -88,12 +103,6 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja") unset(RunCMake_TEST_NO_CLEAN) endif() -# Lookup CMAKE_CXX_EXTENSIONS_DEFAULT. -# FIXME: Someday we could move this to the top of the file and use it in -# place of some of the values passed by 'Tests/RunCMake/CMakeLists.txt'. -run_cmake(Inspect) -include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") - # FIXME: Support more compilers and default standard levels. if (DEFINED CMAKE_CXX_STANDARD_DEFAULT AND DEFINED CMAKE_CXX_EXTENSIONS_DEFAULT AND ( |