diff options
Diffstat (limited to 'Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake')
-rw-r--r-- | Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake b/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake new file mode 100644 index 0000000..ece3ba0 --- /dev/null +++ b/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake @@ -0,0 +1,18 @@ + +if (actual_stdout MATCHES "(LINKER|SHELL):") + set (RunCMake_TEST_FAILED "LINKER: prefix was not expanded.") + return() +endif() + +if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/LINKER.txt") + set (RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/LINKER.txt: Reference file not found.") + return() +endif() +file(READ "${RunCMake_TEST_BINARY_DIR}/LINKER.txt" linker_flag) + +if (NOT actual_stdout MATCHES "${linker_flag}") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "LINKER: was not expanded correctly.") +endif() |