diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/CTestConfig/ScriptWithArgs.cmake | 16 | ||||
-rw-r--r-- | Tests/CTestUpdateSVN.cmake.in | 1 | ||||
-rw-r--r-- | Tests/LibName/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/PositionIndependentTargets/pic_test.h | 4 |
5 files changed, 44 insertions, 3 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9deb8ac..300ab09 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1822,6 +1822,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ add_config_tests(Release) add_config_tests(RelWithDebInfo) + # Test -S script with some -D variable definition args to ctest: + add_test(CTestConfig.ScriptWithArgs ${CMAKE_CTEST_COMMAND} + -C "Release" + -D arg1=this + -D arg2=that + -D "arg3=the other" + "-Darg4=this is the fourth" + -Darg5=the_fifth + -Darg6:STRING=value-with-type + -S "${CMake_SOURCE_DIR}/Tests/CTestConfig/ScriptWithArgs.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestConfig/ScriptWithArgs.log" + ) + ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) CONFIGURE_FILE( diff --git a/Tests/CTestConfig/ScriptWithArgs.cmake b/Tests/CTestConfig/ScriptWithArgs.cmake new file mode 100644 index 0000000..79896a7 --- /dev/null +++ b/Tests/CTestConfig/ScriptWithArgs.cmake @@ -0,0 +1,16 @@ +set(CTEST_RUN_CURRENT_SCRIPT 0) + +macro(check_arg name expected_value) + message("${name}='${${name}}'") + if(NOT "${${name}}" STREQUAL "${expected_value}") + message(FATAL_ERROR "unexpected ${name} value '${${name}}', expected '${expected_value}'") + endif() +endmacro() + +check_arg(arg1 "this") +check_arg(arg2 "that") +check_arg(arg3 "the other") +check_arg(arg4 "this is the fourth") +check_arg(arg5 "the_fifth") +check_arg(arg6 "value-with-type") +check_arg(arg7 "") diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index edafb4ef..15b833b 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -41,7 +41,6 @@ init_testing() #----------------------------------------------------------------------------- # Create the repository. message("Creating repository...") -file(MAKE_DIRECTORY ${TOP}/repo) run_child( COMMAND ${SVNADMIN} create --config-dir ${TOP}/config ${TOP}/repo ) diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt index 3dca0b0..07499a1 100644 --- a/Tests/LibName/CMakeLists.txt +++ b/Tests/LibName/CMakeLists.txt @@ -3,11 +3,24 @@ project(LibName) # LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH work set(LIBRARY_OUTPUT_PATH lib) set(EXECUTABLE_OUTPUT_PATH lib) + add_library(bar SHARED bar.c) + add_library(foo SHARED foo.c) target_link_libraries(foo bar) + add_executable(foobar foobar.c) target_link_libraries(foobar foo) IF(UNIX) target_link_libraries(foobar -L/usr/local/lib) ENDIF(UNIX) + + +# check with lib version + +add_library(verFoo SHARED foo.c) +target_link_libraries(verFoo bar) +set_target_properties(verFoo PROPERTIES VERSION 3.1.4 SOVERSION 3) + +add_executable(verFoobar foobar.c) +target_link_libraries(verFoobar verFoo) diff --git a/Tests/PositionIndependentTargets/pic_test.h b/Tests/PositionIndependentTargets/pic_test.h index 3f64557..13cf8f7 100644 --- a/Tests/PositionIndependentTargets/pic_test.h +++ b/Tests/PositionIndependentTargets/pic_test.h @@ -1,7 +1,7 @@ #if defined(__ELF__) -# if !defined(__PIC__) -# error "The POSITION_INDEPENDENT_CODE property should cause __PIC__ to be defined on ELF platforms." +# if !defined(__PIC__) && !defined(__PIE__) +# error "The POSITION_INDEPENDENT_CODE property should cause __PIC__ or __PIE__ to be defined on ELF platforms." # endif #endif |