summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake')
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake b/Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake
new file mode 100644
index 0000000..3d684af
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake
@@ -0,0 +1,18 @@
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ include("${RunCMake_TEST_BINARY_DIR}/default/CPackConfig.cmake")
+ set(cpack_dir "${RunCMake_TEST_BINARY_DIR}/default/_CPack_Packages/${CPACK_TOPLEVEL_TAG}")
+ set(contents [[Debug
+Release
+]])
+
+ file(GLOB dirs RELATIVE "${cpack_dir}" "${cpack_dir}/*")
+ foreach(dir IN LISTS dirs)
+ set(configs_file "${cpack_dir}/${dir}/${CPACK_PACKAGE_FILE_NAME}/configs.txt")
+ file(READ "${configs_file}" actual_contents)
+ if(NOT contents STREQUAL actual_contents)
+ string(REPLACE "\n" "\n " contents_formatted "${contents}")
+ string(REPLACE "\n" "\n " actual_contents_formatted "${actual_contents}")
+ string(APPEND RunCMake_TEST_FAILED "Expected contents of ${configs_file}:\n ${contents_formatted}\nActual contents:\n ${actual_contents_formatted}\n")
+ endif()
+ endforeach()
+endif()