diff options
author | Brad King <brad.king@kitware.com> | 2023-05-23 18:27:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-23 19:00:46 (GMT) |
commit | f9677cc1223fb23f6e6c329e9f7de954639554d1 (patch) | |
tree | fbb1a486d9e130e80741f35a989ef5fc29059efc /Tests/RunCMake/CXXModules | |
parent | d491ea197332abec3fe082397904bc12175d1044 (diff) | |
download | CMake-f9677cc1223fb23f6e6c329e9f7de954639554d1.zip CMake-f9677cc1223fb23f6e6c329e9f7de954639554d1.tar.gz CMake-f9677cc1223fb23f6e6c329e9f7de954639554d1.tar.bz2 |
Tests: Improve RunCMake.CXXModules expectation matching and error reporting
Diffstat (limited to 'Tests/RunCMake/CXXModules')
12 files changed, 78 insertions, 32 deletions
diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt index 5e4392a..c8dbdcf 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(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. diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt index 2e37da2..a0cf4d9 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt @@ -14,19 +14,29 @@ get_property(file_sets TARGET CXXModules::export_bmi_and_interfaces PROPERTY INTERFACE_CXX_MODULE_SETS) if (NOT file_sets STREQUAL "modules") message(FATAL_ERROR - "Incorrect exported file sets in `CXXModules::export_bmi_and_interfaces`: `${file_sets}`") + "Incorrect exported file sets in CXXModules::export_bmi_and_interfaces:\n ${file_sets}") endif () get_property(file_set_files TARGET CXXModules::export_bmi_and_interfaces PROPERTY CXX_MODULE_SET_modules) -if (NOT file_set_files STREQUAL "${expected_source_dir}/importable.cxx") +set(expected_file_set_files + "${expected_source_dir}/importable.cxx" + ) +if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR - "Incorrect exported file set paths in CXXModules::export_bmi_and_interfaces`: `${file_set_files}`") + "Incorrect exported file set paths in CXXModules::export_bmi_and_interfaces:\n ${file_set_files}") endif () get_property(imported_modules TARGET CXXModules::export_bmi_and_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) -if (NOT imported_modules MATCHES "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_bmi_and_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)") +set(expected_imported_modules + "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_bmi_and_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)" + ) +if (NOT imported_modules MATCHES "^${expected_imported_modules}$") message(FATAL_ERROR - "Incorrect exported modules in CXXModules::export_bmi_and_interfaces`: `${imported_modules}`") + "Incorrect exported modules in CXXModules::export_bmi_and_interfaces:\n" + " ${imported_modules}\n" + "does not match:\n" + " ${expected_imported_modules}" + ) endif () diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt index 5e4392a..c8dbdcf 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(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. diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt index 1adccb3..98f6e52 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt @@ -14,19 +14,29 @@ get_property(file_sets TARGET CXXModules::export_bmi_and_interfaces PROPERTY INTERFACE_CXX_MODULE_SETS) if (NOT file_sets STREQUAL "modules") message(FATAL_ERROR - "Incorrect exported file sets in `CXXModules::export_bmi_and_interfaces`: `${file_sets}`") + "Incorrect exported file sets in CXXModules::export_bmi_and_interfaces:\n ${file_sets}") endif () get_property(file_set_files TARGET CXXModules::export_bmi_and_interfaces PROPERTY CXX_MODULE_SET_modules) -if (NOT file_set_files STREQUAL "${expected_source_dir}/importable.cxx") +set(expected_file_set_files + "${expected_source_dir}/importable.cxx" + ) +if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR - "Incorrect exported file set paths in CXXModules::export_bmi_and_interfaces`: `${file_set_files}`") + "Incorrect exported file set paths in CXXModules::export_bmi_and_interfaces:\n ${file_set_files}") endif () get_property(imported_modules TARGET CXXModules::export_bmi_and_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) -if (NOT imported_modules MATCHES "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/importable.(gcm|pcm|ifc)") +set(expected_imported_modules + "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/importable.(gcm|pcm|ifc)" + ) +if (NOT imported_modules MATCHES "^${expected_imported_modules}$") message(FATAL_ERROR - "Incorrect exported modules in CXXModules::export_bmi_and_interfaces`: `${imported_modules}`") + "Incorrect exported modules in CXXModules::export_bmi_and_interfaces:\n" + " ${imported_modules}\n" + "does not match:\n" + " ${expected_imported_modules}" + ) endif () diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt index 5e4392a..e318a34 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9] \(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. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt index 9949969..6005676 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -14,19 +14,29 @@ get_property(file_sets TARGET CXXModules::export_interfaces PROPERTY INTERFACE_CXX_MODULE_SETS) if (NOT file_sets STREQUAL "modules") message(FATAL_ERROR - "Incorrect exported file sets in `CXXModules::export_interfaces`: `${file_sets}`") + "Incorrect exported file sets in CXXModules::export_interfaces:\n ${file_sets}") endif () get_property(file_set_files TARGET CXXModules::export_interfaces PROPERTY CXX_MODULE_SET_modules) -if (NOT file_set_files STREQUAL "${expected_source_dir}/importable.cxx") +set(expected_file_set_files + "${expected_source_dir}/importable.cxx" + ) +if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR - "Incorrect exported file set paths in CXXModules::export_interfaces`: `${file_set_files}`") + "Incorrect exported file set paths in CXXModules::export_interfaces:\n ${file_set_files}") endif () get_property(imported_modules TARGET CXXModules::export_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) -if (NOT imported_modules MATCHES "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)") +set(expected_imported_modules + "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)" + ) +if (NOT imported_modules MATCHES "^${expected_imported_modules}$") message(FATAL_ERROR - "Incorrect exported modules in CXXModules::export_interfaces`: `${imported_modules}`\n`importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)`") + "Incorrect exported modules in CXXModules::export_interfaces:\n" + " ${imported_modules}\n" + "does not match:\n" + " ${expected_imported_modules}" + ) endif () diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt index 5e4392a..c8dbdcf 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(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. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt index 7079256..6ea2831 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -14,19 +14,29 @@ get_property(file_sets TARGET CXXModules::export_interfaces PROPERTY INTERFACE_CXX_MODULE_SETS) if (NOT file_sets STREQUAL "modules") message(FATAL_ERROR - "Incorrect exported file sets in `CXXModules::export_interfaces`: `${file_sets}`") + "Incorrect exported file sets in CXXModules::export_interfaces:\n ${file_sets}") endif () get_property(file_set_files TARGET CXXModules::export_interfaces PROPERTY CXX_MODULE_SET_modules) -if (NOT file_set_files STREQUAL "${expected_source_dir}/importable.cxx") +set(expected_file_set_files + "${expected_source_dir}/importable.cxx" + ) +if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR - "Incorrect exported file set paths in CXXModules::export_interfaces`: `${file_set_files}`") + "Incorrect exported file set paths in CXXModules::export_interfaces:\n ${file_set_files}") endif () get_property(imported_modules TARGET CXXModules::export_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) -if (NOT imported_modules STREQUAL "importable=${expected_source_dir}/importable.cxx") +set(expected_imported_modules + "importable=${expected_source_dir}/importable.cxx" + ) +if (NOT imported_modules STREQUAL "${expected_imported_modules}") message(FATAL_ERROR - "Incorrect exported modules in CXXModules::export_interfaces`: `${imported_modules}`") + "Incorrect exported modules in CXXModules::export_interfaces:\n" + " ${imported_modules}\n" + "does not match:\n" + " ${expected_imported_modules}" + ) endif () diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt index 5e4392a..c8dbdcf 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(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. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index 9cdc80a..9ff88df 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -14,14 +14,17 @@ get_property(file_sets TARGET CXXModules::export_interfaces_no_properties PROPERTY INTERFACE_CXX_MODULE_SETS) if (NOT file_sets STREQUAL "modules") message(FATAL_ERROR - "Incorrect exported file sets in `CXXModules::export_interfaces_no_properties`: `${file_sets}`") + "Incorrect exported file sets in CXXModules::export_interfaces_no_properties:\n ${file_sets}") endif () get_property(file_set_files TARGET CXXModules::export_interfaces_no_properties PROPERTY CXX_MODULE_SET_modules) -if (NOT file_set_files STREQUAL "${expected_dir}/importable.cxx") +set(expected_file_set_files + "${expected_dir}/importable.cxx" + ) +if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR - "Incorrect exported file set paths in CXXModules::export_interfaces_no_properties`: `${file_set_files}`") + "Incorrect exported file set paths in CXXModules::export_interfaces_no_properties:\n ${file_set_files}") endif () get_property(imported_modules_set TARGET CXXModules::export_interfaces_no_properties diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt index 5e4392a..c8dbdcf 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(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. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index 9cdc80a..9ff88df 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -14,14 +14,17 @@ get_property(file_sets TARGET CXXModules::export_interfaces_no_properties PROPERTY INTERFACE_CXX_MODULE_SETS) if (NOT file_sets STREQUAL "modules") message(FATAL_ERROR - "Incorrect exported file sets in `CXXModules::export_interfaces_no_properties`: `${file_sets}`") + "Incorrect exported file sets in CXXModules::export_interfaces_no_properties:\n ${file_sets}") endif () get_property(file_set_files TARGET CXXModules::export_interfaces_no_properties PROPERTY CXX_MODULE_SET_modules) -if (NOT file_set_files STREQUAL "${expected_dir}/importable.cxx") +set(expected_file_set_files + "${expected_dir}/importable.cxx" + ) +if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR - "Incorrect exported file set paths in CXXModules::export_interfaces_no_properties`: `${file_set_files}`") + "Incorrect exported file set paths in CXXModules::export_interfaces_no_properties:\n ${file_set_files}") endif () get_property(imported_modules_set TARGET CXXModules::export_interfaces_no_properties |