From 3218ea60dea79819aa415bfa60c285e43326985e Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 2 Aug 2022 08:03:53 -0400 Subject: Tests: Add RunCMake.try_compile case for try_run-only args --- Tests/RunCMake/try_compile/RunCMakeTest.cmake | 1 + Tests/RunCMake/try_compile/TryRunArgs-stderr.txt | 71 ++++++++++++++++++++++++ Tests/RunCMake/try_compile/TryRunArgs.cmake | 11 ++++ 3 files changed, 83 insertions(+) create mode 100644 Tests/RunCMake/try_compile/TryRunArgs-stderr.txt create mode 100644 Tests/RunCMake/try_compile/TryRunArgs.cmake diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index d377cce..881ef16 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -19,6 +19,7 @@ run_cmake(BinDirEmpty) run_cmake(BinDirRelative) run_cmake(EmptyValueArgs) run_cmake(EmptyListArgs) +run_cmake(TryRunArgs) run_cmake(EnvConfig) diff --git a/Tests/RunCMake/try_compile/TryRunArgs-stderr.txt b/Tests/RunCMake/try_compile/TryRunArgs-stderr.txt new file mode 100644 index 0000000..d9346be --- /dev/null +++ b/Tests/RunCMake/try_compile/TryRunArgs-stderr.txt @@ -0,0 +1,71 @@ +^CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "COMPILE_OUTPUT_VARIABLE". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "compOutputVar". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "RUN_OUTPUT_VARIABLE". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "runOutputVar". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "RUN_OUTPUT_STDOUT_VARIABLE". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "runOutputStdOutVar". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "RUN_OUTPUT_STDERR_VARIABLE". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "runOutputStdErrVar". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "WORKING_DIRECTORY". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "runWorkDir". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "ARGS". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\): + try_compile given unknown argument "runArgs". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/try_compile/TryRunArgs.cmake b/Tests/RunCMake/try_compile/TryRunArgs.cmake new file mode 100644 index 0000000..1a60270 --- /dev/null +++ b/Tests/RunCMake/try_compile/TryRunArgs.cmake @@ -0,0 +1,11 @@ +enable_language(C) + +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/out.bin" + COMPILE_OUTPUT_VARIABLE compOutputVar + RUN_OUTPUT_VARIABLE runOutputVar + RUN_OUTPUT_STDOUT_VARIABLE runOutputStdOutVar + RUN_OUTPUT_STDERR_VARIABLE runOutputStdErrVar + WORKING_DIRECTORY runWorkDir + ARGS runArgs + ) -- cgit v0.12