summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/TransformDepfile/gccdepfile.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-20 15:15:53 (GMT)
committerBrad King <brad.king@kitware.com>2020-11-20 15:15:53 (GMT)
commit3bc549540e117a949707c51fcdf110fdc51e3d93 (patch)
treee736abff616bf3c411881074a156fdae490f6f71 /Tests/RunCMake/TransformDepfile/gccdepfile.cmake
parent64dc4efc511f766d0a099df717e2f35f9eccabce (diff)
parentbf241bcc1e5cda69775c05022e146a7f4f76b41b (diff)
downloadCMake-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.cmake16
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()