diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-07-29 17:33:55 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2019-08-30 18:39:32 (GMT) |
commit | 1353802af366bd64ba8f730e6f93d4c416107d48 (patch) | |
tree | c721c50d768012fc631160aad6de8e51a19d029a /Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake | |
parent | 8dfeb5d278625c55be1cc82399d29c0305ee4438 (diff) | |
download | CMake-1353802af366bd64ba8f730e6f93d4c416107d48.zip CMake-1353802af366bd64ba8f730e6f93d4c416107d48.tar.gz CMake-1353802af366bd64ba8f730e6f93d4c416107d48.tar.bz2 |
Unity build: Add unit tests
Diffstat (limited to 'Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake')
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake new file mode 100644 index 0000000..fdd45bc --- /dev/null +++ b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake @@ -0,0 +1,14 @@ +set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c") +file(STRINGS ${unitybuild_c} unitybuild_c_strings) + +string(REGEX MATCH "\\/s[1-6].c" matched_files_1_6 ${unitybuild_c_strings}) +if(matched_files_1_6) + set(RunCMake_TEST_FAILED "Generated unity contains s1.c -> s6.c which should have been skipped") + return() +endif() + +string(REGEX MATCH "\\/s[7-8].c" matched_files_7_8 ${unitybuild_c_strings}) +if(NOT matched_files_7_8) + set(RunCMake_TEST_FAILED "Generated unity should have contained s7.c, s8.c!") + return() +endif() |