Tests: Add RunCMake.try_run cases for missing keyword arguments

This commit is contained in:
Brad King
2022-08-01 13:56:16 -04:00
parent 514804c8bc
commit b8e551ed32
23 changed files with 58 additions and 13 deletions

View File

@@ -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\)

View File

@@ -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\)

View File

@@ -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\)$

View File

@@ -0,0 +1,4 @@
try_run(RUN_RESULT COMPILE_RESULT
${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
COMPILE_OUTPUT_VARIABLE
)

View File

@@ -0,0 +1 @@
1

View File

@@ -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\)$

View File

@@ -0,0 +1,4 @@
try_run(RUN_RESULT COMPILE_RESULT
${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
OUTPUT_VARIABLE
)

View File

@@ -0,0 +1 @@
1

View File

@@ -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\)$

View File

@@ -0,0 +1,4 @@
try_run(RUN_RESULT COMPILE_RESULT
${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
RUN_OUTPUT_VARIABLE
)

View File

@@ -0,0 +1 @@
1

View File

@@ -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\)$

View File

@@ -0,0 +1 @@
1

View File

@@ -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\)$

View File

@@ -0,0 +1 @@
1

View File

@@ -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\)$

View File

@@ -0,0 +1,4 @@
try_run(RUN_RESULT COMPILE_RESULT
${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
WORKING_DIRECTORY
)

View File

@@ -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)

View File

@@ -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
)