From b8e551ed320569b3ca0fd68477c5fa951baa5095 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 1 Aug 2022 13:56:16 -0400 Subject: Tests: Add RunCMake.try_run cases for missing keyword arguments --- Tests/RunCMake/try_run/BadStdErrVariable-result.txt | 1 - Tests/RunCMake/try_run/BadStdErrVariable-stderr.txt | 5 ----- Tests/RunCMake/try_run/BadStdErrVariable.cmake | 5 ----- Tests/RunCMake/try_run/BadStdOutVariable-result.txt | 1 - Tests/RunCMake/try_run/BadStdOutVariable-stderr.txt | 5 ----- Tests/RunCMake/try_run/BadStdOutVariable.cmake | 5 ----- Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt | 1 + Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt | 5 +++++ Tests/RunCMake/try_run/NoCompileOutputVariable.cmake | 4 ++++ Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt | 1 + Tests/RunCMake/try_run/NoOutputVariable-result.txt | 1 + Tests/RunCMake/try_run/NoOutputVariable-stderr.txt | 5 +++++ Tests/RunCMake/try_run/NoOutputVariable.cmake | 4 ++++ Tests/RunCMake/try_run/NoRunOutputVariable-result.txt | 1 + Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt | 5 +++++ Tests/RunCMake/try_run/NoRunOutputVariable.cmake | 4 ++++ Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt | 1 + Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt | 5 +++++ Tests/RunCMake/try_run/NoRunStdErrVariable.cmake | 5 +++++ Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt | 1 + Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt | 5 +++++ Tests/RunCMake/try_run/NoRunStdOutVariable.cmake | 5 +++++ Tests/RunCMake/try_run/NoWorkingDirectory-result.txt | 1 + Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt | 5 +++++ Tests/RunCMake/try_run/NoWorkingDirectory.cmake | 4 ++++ Tests/RunCMake/try_run/RunCMakeTest.cmake | 8 ++++++-- Tests/RunCMake/try_run/WorkingDirArg.cmake | 2 +- 27 files changed, 70 insertions(+), 25 deletions(-) delete mode 100644 Tests/RunCMake/try_run/BadStdErrVariable-result.txt delete mode 100644 Tests/RunCMake/try_run/BadStdErrVariable-stderr.txt delete mode 100644 Tests/RunCMake/try_run/BadStdErrVariable.cmake delete mode 100644 Tests/RunCMake/try_run/BadStdOutVariable-result.txt delete mode 100644 Tests/RunCMake/try_run/BadStdOutVariable-stderr.txt delete mode 100644 Tests/RunCMake/try_run/BadStdOutVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoCompileOutputVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoOutputVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoRunOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoRunOutputVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdErrVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdOutVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoWorkingDirectory-result.txt create mode 100644 Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoWorkingDirectory.cmake diff --git a/Tests/RunCMake/try_run/BadStdErrVariable-result.txt b/Tests/RunCMake/try_run/BadStdErrVariable-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/try_run/BadStdErrVariable-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/try_run/BadStdErrVariable-stderr.txt b/Tests/RunCMake/try_run/BadStdErrVariable-stderr.txt deleted file mode 100644 index 5d7e5e9..0000000 --- a/Tests/RunCMake/try_run/BadStdErrVariable-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error: RUN_OUTPUT_STDERR_VARIABLE specified but there is no variable -CMake Error at BadStdErrVariable.cmake:1 \(try_run\): - try_run unknown error. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_run/BadStdErrVariable.cmake b/Tests/RunCMake/try_run/BadStdErrVariable.cmake deleted file mode 100644 index 88c2a72..0000000 --- a/Tests/RunCMake/try_run/BadStdErrVariable.cmake +++ /dev/null @@ -1,5 +0,0 @@ -try_run(RUN_RESULT COMPILE_RESULT - ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/workdir - RUN_OUTPUT_STDERR_VARIABLE - ) diff --git a/Tests/RunCMake/try_run/BadStdOutVariable-result.txt b/Tests/RunCMake/try_run/BadStdOutVariable-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/try_run/BadStdOutVariable-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/try_run/BadStdOutVariable-stderr.txt b/Tests/RunCMake/try_run/BadStdOutVariable-stderr.txt deleted file mode 100644 index df60658..0000000 --- a/Tests/RunCMake/try_run/BadStdOutVariable-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error: RUN_OUTPUT_STDOUT_VARIABLE specified but there is no variable -CMake Error at BadStdOutVariable.cmake:1 \(try_run\): - try_run unknown error. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_run/BadStdOutVariable.cmake b/Tests/RunCMake/try_run/BadStdOutVariable.cmake deleted file mode 100644 index 691e881..0000000 --- a/Tests/RunCMake/try_run/BadStdOutVariable.cmake +++ /dev/null @@ -1,5 +0,0 @@ -try_run(RUN_RESULT COMPILE_RESULT - ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/workdir - RUN_OUTPUT_STDOUT_VARIABLE - ) diff --git a/Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt b/Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt b/Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt new file mode 100644 index 0000000..6feaf4f --- /dev/null +++ b/Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: COMPILE_OUTPUT_VARIABLE specified but there is no variable +CMake Error at NoCompileOutputVariable.cmake:[0-9]+ \(try_run\): + try_run unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/try_run/NoCompileOutputVariable.cmake b/Tests/RunCMake/try_run/NoCompileOutputVariable.cmake new file mode 100644 index 0000000..85b91f4 --- /dev/null +++ b/Tests/RunCMake/try_run/NoCompileOutputVariable.cmake @@ -0,0 +1,4 @@ +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COMPILE_OUTPUT_VARIABLE + ) diff --git a/Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt b/Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoOutputVariable-result.txt b/Tests/RunCMake/try_run/NoOutputVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoOutputVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoOutputVariable-stderr.txt b/Tests/RunCMake/try_run/NoOutputVariable-stderr.txt new file mode 100644 index 0000000..33e7df1 --- /dev/null +++ b/Tests/RunCMake/try_run/NoOutputVariable-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: OUTPUT_VARIABLE specified but there is no variable +CMake Error at NoOutputVariable.cmake:[0-9]+ \(try_run\): + try_run unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/try_run/NoOutputVariable.cmake b/Tests/RunCMake/try_run/NoOutputVariable.cmake new file mode 100644 index 0000000..1901b30 --- /dev/null +++ b/Tests/RunCMake/try_run/NoOutputVariable.cmake @@ -0,0 +1,4 @@ +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + OUTPUT_VARIABLE + ) diff --git a/Tests/RunCMake/try_run/NoRunOutputVariable-result.txt b/Tests/RunCMake/try_run/NoRunOutputVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunOutputVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt b/Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt new file mode 100644 index 0000000..5ec697b --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: RUN_OUTPUT_VARIABLE specified but there is no variable +CMake Error at NoRunOutputVariable.cmake:[0-9]+ \(try_run\): + try_run unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/try_run/NoRunOutputVariable.cmake b/Tests/RunCMake/try_run/NoRunOutputVariable.cmake new file mode 100644 index 0000000..25310d8 --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunOutputVariable.cmake @@ -0,0 +1,4 @@ +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + RUN_OUTPUT_VARIABLE + ) diff --git a/Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt b/Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt b/Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt new file mode 100644 index 0000000..8dee056 --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: RUN_OUTPUT_STDERR_VARIABLE specified but there is no variable +CMake Error at NoRunStdErrVariable.cmake:1 \(try_run\): + try_run unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/try_run/NoRunStdErrVariable.cmake b/Tests/RunCMake/try_run/NoRunStdErrVariable.cmake new file mode 100644 index 0000000..88c2a72 --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunStdErrVariable.cmake @@ -0,0 +1,5 @@ +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/workdir + RUN_OUTPUT_STDERR_VARIABLE + ) diff --git a/Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt b/Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt b/Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt new file mode 100644 index 0000000..5ea6d23 --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: RUN_OUTPUT_STDOUT_VARIABLE specified but there is no variable +CMake Error at NoRunStdOutVariable.cmake:1 \(try_run\): + try_run unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/try_run/NoRunStdOutVariable.cmake b/Tests/RunCMake/try_run/NoRunStdOutVariable.cmake new file mode 100644 index 0000000..691e881 --- /dev/null +++ b/Tests/RunCMake/try_run/NoRunStdOutVariable.cmake @@ -0,0 +1,5 @@ +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/workdir + RUN_OUTPUT_STDOUT_VARIABLE + ) diff --git a/Tests/RunCMake/try_run/NoWorkingDirectory-result.txt b/Tests/RunCMake/try_run/NoWorkingDirectory-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/NoWorkingDirectory-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt b/Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt new file mode 100644 index 0000000..10ad85c --- /dev/null +++ b/Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: WORKING_DIRECTORY specified but there is no variable +CMake Error at NoWorkingDirectory.cmake:[0-9]+ \(try_run\): + try_run unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/try_run/NoWorkingDirectory.cmake b/Tests/RunCMake/try_run/NoWorkingDirectory.cmake new file mode 100644 index 0000000..a115e36 --- /dev/null +++ b/Tests/RunCMake/try_run/NoWorkingDirectory.cmake @@ -0,0 +1,4 @@ +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + WORKING_DIRECTORY + ) diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake index 76c85dd..698357b 100644 --- a/Tests/RunCMake/try_run/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake @@ -13,5 +13,9 @@ endif() run_cmake(WorkingDirArg) -run_cmake(BadStdOutVariable) -run_cmake(BadStdErrVariable) +run_cmake(NoOutputVariable) +run_cmake(NoCompileOutputVariable) +run_cmake(NoRunOutputVariable) +run_cmake(NoRunStdOutVariable) +run_cmake(NoRunStdErrVariable) +run_cmake(NoWorkingDirectory) diff --git a/Tests/RunCMake/try_run/WorkingDirArg.cmake b/Tests/RunCMake/try_run/WorkingDirArg.cmake index b583823..62f78e8 100644 --- a/Tests/RunCMake/try_run/WorkingDirArg.cmake +++ b/Tests/RunCMake/try_run/WorkingDirArg.cmake @@ -1,6 +1,6 @@ try_run(RUN_RESULT COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c - RUN_OUTPUT_VARIABLE OUTPUT_VARIABLE + RUN_OUTPUT_VARIABLE RUN_OUTPUT WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/workdir ) -- cgit v0.12