try_compile: Add test for bad call error cases
Add a RunCMake.try_compile test to cover cases of bad invocation of the try_compile command.
This commit is contained in:
parent
5377ac4289
commit
b680824a5f
@ -76,6 +76,7 @@ add_RunCMake_test(if)
|
||||
add_RunCMake_test(include)
|
||||
add_RunCMake_test(include_directories)
|
||||
add_RunCMake_test(list)
|
||||
add_RunCMake_test(try_compile)
|
||||
add_RunCMake_test(CMP0004)
|
||||
|
||||
find_package(Qt4 QUIET)
|
||||
|
1
Tests/RunCMake/try_compile/BadLinkLibraries-result.txt
Normal file
1
Tests/RunCMake/try_compile/BadLinkLibraries-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
5
Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
Normal file
5
Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
Normal file
@ -0,0 +1,5 @@
|
||||
CMake Error at BadLinkLibraries.cmake:2 \(try_compile\):
|
||||
Only libraries may be used as try_compile IMPORTED LINK_LIBRARIES. Got
|
||||
not_a_library of type UTILITY.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
3
Tests/RunCMake/try_compile/BadLinkLibraries.cmake
Normal file
3
Tests/RunCMake/try_compile/BadLinkLibraries.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
add_custom_target(not_a_library)
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
|
||||
LINK_LIBRARIES not_a_library)
|
3
Tests/RunCMake/try_compile/CMakeLists.txt
Normal file
3
Tests/RunCMake/try_compile/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
1
Tests/RunCMake/try_compile/NoArgs-result.txt
Normal file
1
Tests/RunCMake/try_compile/NoArgs-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/NoArgs-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/NoArgs-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at NoArgs.cmake:1 \(try_compile\):
|
||||
try_compile unknown error.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
1
Tests/RunCMake/try_compile/NoArgs.cmake
Normal file
1
Tests/RunCMake/try_compile/NoArgs.cmake
Normal file
@ -0,0 +1 @@
|
||||
try_compile()
|
1
Tests/RunCMake/try_compile/NoCopyFile-result.txt
Normal file
1
Tests/RunCMake/try_compile/NoCopyFile-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at NoCopyFile.cmake:1 \(try_compile\):
|
||||
COPY_FILE specified but there is no variable
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
2
Tests/RunCMake/try_compile/NoCopyFile.cmake
Normal file
2
Tests/RunCMake/try_compile/NoCopyFile.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
|
||||
COPY_FILE)
|
1
Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
Normal file
1
Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at NoLinkLibraries.cmake:1 \(try_compile\):
|
||||
LINK_LIBRARIES specified but there is no content
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
2
Tests/RunCMake/try_compile/NoLinkLibraries.cmake
Normal file
2
Tests/RunCMake/try_compile/NoLinkLibraries.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
|
||||
LINK_LIBRARIES)
|
1
Tests/RunCMake/try_compile/NoOutputVariable-result.txt
Normal file
1
Tests/RunCMake/try_compile/NoOutputVariable-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at NoOutputVariable.cmake:1 \(try_compile\):
|
||||
OUTPUT_VARIABLE specified but there is no variable
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
2
Tests/RunCMake/try_compile/NoOutputVariable.cmake
Normal file
2
Tests/RunCMake/try_compile/NoOutputVariable.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
|
||||
OUTPUT_VARIABLE)
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,4 @@
|
||||
CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\):
|
||||
COMPILE_FLAGS specified on a srcdir type TRY_COMPILE
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
@ -0,0 +1,2 @@
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj
|
||||
TestProject COMPILE_DEFINITIONS DEF)
|
1
Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt
Normal file
1
Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at NonSourceCopyFile.cmake:1 \(try_compile\):
|
||||
COPY_FILE specified on a srcdir type TRY_COMPILE
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
2
Tests/RunCMake/try_compile/NonSourceCopyFile.cmake
Normal file
2
Tests/RunCMake/try_compile/NonSourceCopyFile.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj
|
||||
TestProject COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/result)
|
1
Tests/RunCMake/try_compile/OneArg-result.txt
Normal file
1
Tests/RunCMake/try_compile/OneArg-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/OneArg-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/OneArg-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at OneArg.cmake:1 \(try_compile\):
|
||||
try_compile unknown error.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
1
Tests/RunCMake/try_compile/OneArg.cmake
Normal file
1
Tests/RunCMake/try_compile/OneArg.cmake
Normal file
@ -0,0 +1 @@
|
||||
try_compile(RESULT)
|
11
Tests/RunCMake/try_compile/RunCMakeTest.cmake
Normal file
11
Tests/RunCMake/try_compile/RunCMakeTest.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(NoArgs)
|
||||
run_cmake(OneArg)
|
||||
run_cmake(TwoArgs)
|
||||
run_cmake(NoCopyFile)
|
||||
run_cmake(NoOutputVariable)
|
||||
run_cmake(NoLinkLibraries)
|
||||
run_cmake(BadLinkLibraries)
|
||||
run_cmake(NonSourceCopyFile)
|
||||
run_cmake(NonSourceCompileDefinitions)
|
1
Tests/RunCMake/try_compile/TwoArgs-result.txt
Normal file
1
Tests/RunCMake/try_compile/TwoArgs-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/try_compile/TwoArgs-stderr.txt
Normal file
4
Tests/RunCMake/try_compile/TwoArgs-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
CMake Error at TwoArgs.cmake:1 \(try_compile\):
|
||||
try_compile unknown error.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
1
Tests/RunCMake/try_compile/TwoArgs.cmake
Normal file
1
Tests/RunCMake/try_compile/TwoArgs.cmake
Normal file
@ -0,0 +1 @@
|
||||
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR})
|
2
Tests/RunCMake/try_compile/proj/CMakeLists.txt
Normal file
2
Tests/RunCMake/try_compile/proj/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_minimum_required(VERSION 2.8.10)
|
||||
project(TestProject NONE)
|
1
Tests/RunCMake/try_compile/src.c
Normal file
1
Tests/RunCMake/try_compile/src.c
Normal file
@ -0,0 +1 @@
|
||||
int main(void) { return 0; }
|
Loading…
x
Reference in New Issue
Block a user