diff options
Diffstat (limited to 'Tests/RunCMake/Ninja/ShowIncludes-check.cmake')
-rw-r--r-- | Tests/RunCMake/Ninja/ShowIncludes-check.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/ShowIncludes-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-check.cmake new file mode 100644 index 0000000..304a7f6 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-check.cmake @@ -0,0 +1,17 @@ +set(rules_ninja "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/rules.ninja") +if(NOT EXISTS "${rules_ninja}") + set(RunCMake_TEST_FAILED "Generator output file is missing:\n ${rules_ninja}") + return() +endif() + +file(READ "${rules_ninja}" rules_ninja) +if(rules_ninja MATCHES "msvc_deps_prefix = ([^\r\n]*)\n") + set(actual "${CMAKE_MATCH_1}") +endif() + +if(NOT actual STREQUAL expect) + string(HEX "${actual}" actual_hex) + string(HEX "${expect}" expect_hex) + set(RunCMake_TEST_FAILED "Expected byte sequence\n '${expect}' (${expect_hex})\nbut got\n '${actual}' (${actual_hex})") + return() +endif() |