summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-09-25 15:04:42 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-09-25 21:39:35 (GMT)
commit1c9f83c8ec31b523efc2ea97bfca239faaf808d2 (patch)
tree83fe56a0fa8806d3906aeb43faf06d084252d98b
parent7a4c02cb38547e719d53196c16cbe10743dce995 (diff)
downloadCMake-1c9f83c8ec31b523efc2ea97bfca239faaf808d2.zip
CMake-1c9f83c8ec31b523efc2ea97bfca239faaf808d2.tar.gz
CMake-1c9f83c8ec31b523efc2ea97bfca239faaf808d2.tar.bz2
Tests/CXXModules: fix error detection propagation
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake2
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake2
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake2
-rw-r--r--Tests/RunCMake/CXXModules/check-json.cmake11
4 files changed, 15 insertions, 2 deletions
diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake
index 0d08c44..124efa8 100644
--- a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake
+++ b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake
@@ -32,3 +32,5 @@ else ()
file(READ "${CMAKE_CURRENT_LIST_DIR}/expect/NinjaDependInfoBMIInstall-private.json" expect_contents)
check_json("${actual_contents}" "${expect_contents}")
endif ()
+
+string(REPLACE ";" "\n " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}")
diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake
index 7720257..b08b63f 100644
--- a/Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake
+++ b/Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake
@@ -32,3 +32,5 @@ else ()
file(READ "${CMAKE_CURRENT_LIST_DIR}/expect/NinjaDependInfoExport-private.json" expect_contents)
check_json("${actual_contents}" "${expect_contents}")
endif ()
+
+string(REPLACE ";" "\n " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}")
diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake
index b9a1315..785d123 100644
--- a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake
+++ b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake
@@ -32,3 +32,5 @@ else ()
file(READ "${CMAKE_CURRENT_LIST_DIR}/expect/NinjaDependInfoFileSet-private.json" expect_contents)
check_json("${actual_contents}" "${expect_contents}")
endif ()
+
+string(REPLACE ";" "\n " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}")
diff --git a/Tests/RunCMake/CXXModules/check-json.cmake b/Tests/RunCMake/CXXModules/check-json.cmake
index 19d0c8a..0790b6b 100644
--- a/Tests/RunCMake/CXXModules/check-json.cmake
+++ b/Tests/RunCMake/CXXModules/check-json.cmake
@@ -22,6 +22,7 @@ function (check_json_value path actual_type expect_type actual_value expect_valu
if (NOT actual_type STREQUAL expect_type)
list(APPEND RunCMake_TEST_FAILED
"Type mismatch at ${path}: ${actual_type} vs. ${expect_type}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
return ()
endif ()
@@ -53,6 +54,8 @@ function (check_json_value path actual_type expect_type actual_value expect_valu
elseif (actual_type STREQUAL OBJECT)
check_json_object("${path}" "${actual_value}" "${expect_value}")
endif ()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
endfunction ()
# Check that two arrays are the same.
@@ -82,6 +85,8 @@ function (check_json_array path actual expect)
string(JSON expect_value GET "${expect}" "${idx}")
check_json_value("${new_path}" "${actual_type}" "${expect_type}" "${actual_value}" "${expect_value}")
endforeach ()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
endfunction ()
# Check that two inner objects are the same.
@@ -148,13 +153,15 @@ function (check_json_object path actual expect)
string(JSON expect_value GET "${expect}" "${key}")
check_json_value("${new_path}" "${actual_type}" "${expect_type}" "${actual_value}" "${expect_value}")
endforeach ()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
endfunction ()
# Check that two JSON objects are the same.
function (check_json actual expect)
check_json_object("" "${actual}" "${expect}")
-endfunction ()
-string(REPLACE ";" "; " RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction ()
cmake_policy(POP)