diff options
author | Brad King <brad.king@kitware.com> | 2020-11-20 15:15:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-20 15:15:53 (GMT) |
commit | 3bc549540e117a949707c51fcdf110fdc51e3d93 (patch) | |
tree | e736abff616bf3c411881074a156fdae490f6f71 /Tests/RunCMake/TransformDepfile/gccdepfile.cmake | |
parent | 64dc4efc511f766d0a099df717e2f35f9eccabce (diff) | |
parent | bf241bcc1e5cda69775c05022e146a7f4f76b41b (diff) | |
download | CMake-3bc549540e117a949707c51fcdf110fdc51e3d93.zip CMake-3bc549540e117a949707c51fcdf110fdc51e3d93.tar.gz CMake-3bc549540e117a949707c51fcdf110fdc51e3d93.tar.bz2 |
Merge branch 'master' into FindGTest-revert-no-release
Diffstat (limited to 'Tests/RunCMake/TransformDepfile/gccdepfile.cmake')
-rw-r--r-- | Tests/RunCMake/TransformDepfile/gccdepfile.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/TransformDepfile/gccdepfile.cmake b/Tests/RunCMake/TransformDepfile/gccdepfile.cmake new file mode 100644 index 0000000..be1e210 --- /dev/null +++ b/Tests/RunCMake/TransformDepfile/gccdepfile.cmake @@ -0,0 +1,16 @@ +if(EXISTS "${RunCMake_SOURCE_DIR}/${name}.d.txt") + file(READ "${RunCMake_SOURCE_DIR}/${name}.d.txt" expected_contents) + + if(EXISTS "${RunCMake_TEST_BINARY_DIR}/out.d") + file(READ "${RunCMake_TEST_BINARY_DIR}/out.d" actual_contents) + if(NOT actual_contents STREQUAL expected_contents) + string(REPLACE "\n" "\n " p_expected_contents "${expected_contents}") + string(REPLACE "\n" "\n " p_actual_contents "${actual_contents}") + string(APPEND RunCMake_TEST_FAILED "Expected contents of ${RunCMake_TEST_BINARY_DIR}/out.d:\n ${p_expected_contents}\nActual contents:\n ${p_actual_contents}") + endif() + else() + string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/out.d should exist\n") + endif() +elseif(EXISTS "${RunCMake_TEST_BINARY_DIR}/out.d") + string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/out.d should not exist\n") +endif() |