summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-29 14:14:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-29 14:14:20 (GMT)
commit32d369aa7049c4921d3c35ca8097bc0485866be6 (patch)
tree039ec9fb81b3c6848067d34fd3d61039bc02a011 /Tests
parent1d3603a1706d122f6d22b47a365ec5023e58579a (diff)
parentea03f508420845fef72fef06ba4c9a7dacbca5fe (diff)
downloadCMake-32d369aa7049c4921d3c35ca8097bc0485866be6.zip
CMake-32d369aa7049c4921d3c35ca8097bc0485866be6.tar.gz
CMake-32d369aa7049c4921d3c35ca8097bc0485866be6.tar.bz2
Merge topic 'llvm-rc-CMAKE_RC_FLAGS'
ea03f50842 llvm_rc: add llvm_rc option filter to correctly pick up all options Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5412
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/pseudo_llvm-rc.c30
3 files changed, 33 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 38ab553..9fc5b69 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -565,7 +565,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
endif()
-add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
+add_executable(pseudo_llvm-rc pseudo_llvm-rc.c)
+add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLineTar)
if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index b9c5aa2..c438860 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -789,7 +789,7 @@ function(run_llvm_rc)
"test.tmp was not deleted")
endif()
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir")
- run_cmake_command(llvm_rc_full_run ${CMAKE_COMMAND} -E cmake_llvm_rc ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/source_file test.tmp ${CMAKE_COMMAND} -E echo "This is a test" ++ ${CMAKE_COMMAND} -E copy test.tmp SOURCE_DIR/llvmrc.result )
+ run_cmake_command(llvm_rc_full_run ${CMAKE_COMMAND} -E cmake_llvm_rc ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/source_file test.tmp ${CMAKE_COMMAND} -E echo "This is a test" ++ ${LLVM_RC} -bad /FO SOURCE_DIR/llvmrc.result test.tmp )
if(EXISTS ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/test.tmp)
message(SEND_ERROR "${test} - FAILED:\n"
"test.tmp was not deleted")
diff --git a/Tests/RunCMake/pseudo_llvm-rc.c b/Tests/RunCMake/pseudo_llvm-rc.c
new file mode 100644
index 0000000..7acb2a3
--- /dev/null
+++ b/Tests/RunCMake/pseudo_llvm-rc.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char* argv[])
+{
+ FILE* source;
+ FILE* target;
+ int i;
+ for (i = 1; i < argc; ++i) {
+ if (strcmp(argv[i], "-bad") == 0) {
+ fprintf(stdout, "stdout from bad command line arg '-bad'\n");
+ fprintf(stderr, "stderr from bad command line arg '-bad'\n");
+ return 1;
+ }
+ }
+ source = fopen(argv[argc - 1], "rb");
+ if (source == NULL) {
+ return 1;
+ }
+ target = fopen(argv[argc - 2], "wb");
+ if (target != NULL) {
+ char buffer[500];
+ size_t n = fread(buffer, 1, sizeof(buffer), source);
+ fwrite(buffer, 1, n, target);
+ fclose(source);
+ fclose(target);
+ return 0;
+ }
+ return 1;
+}