diff options
Diffstat (limited to 'Tests')
15 files changed, 39 insertions, 34 deletions
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 3aa57fc..127b365 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -1,30 +1,30 @@ cmake_minimum_required(VERSION 2.6) project(testRebuild) -function(test_for_xcode4 result_var) - set(${result_var} 0 PARENT_SCOPE) - if(APPLE) - execute_process(COMMAND xcodebuild -version - OUTPUT_VARIABLE ov RESULT_VARIABLE rv +if(APPLE) + set(CMake_TEST_XCODE_VERSION 0) + if(XCODE_VERSION) + set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}") + else() + execute_process( + COMMAND xcodebuild -version + OUTPUT_VARIABLE _version ERROR_VARIABLE _version ) - if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.") - if(NOT CMAKE_MATCH_1 VERSION_LESS 4) - set(${result_var} 1 PARENT_SCOPE) - endif() + if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)") + set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}") endif() endif() -endfunction() - -if(APPLE) # only use multi-arch if the sysroot exists on this machine # Ninja needs -M which could not be used with multiple -arch flags if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja") - set(CMAKE_OSX_ARCHITECTURES "ppc;i386") - test_for_xcode4(is_xcode4) - if(is_xcode4) - # Xcode 4, use modern architectures as defaults - # Arch 'ppc' no longer works: tools no longer available starting with Xcode 4 + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10) + # Arch 'i386' no longer works in Xcode 10. + set(CMAKE_OSX_ARCHITECTURES x86_64) + elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 4) + # Arch 'ppc' no longer works in Xcode 4. set(CMAKE_OSX_ARCHITECTURES i386 x86_64) + else() + set(CMAKE_OSX_ARCHITECTURES ppc i386) endif() endif() endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 886e392..b8b724e 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -252,6 +252,10 @@ if(BUILD_TESTING) set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}") endif() endif() + if(NOT CMake_TEST_XCODE_VERSION VERSION_LESS 10) + # Since Xcode 10 we do not have two supported architectures for the host. + set(CTEST_TEST_OSX_ARCH 0) + endif() if(CMAKE_OSX_SYSROOT) execute_process( COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version ProductName diff --git a/Tests/FindCURL/Test/CMakeLists.txt b/Tests/FindCURL/Test/CMakeLists.txt index f0e5568..c3c719b 100644 --- a/Tests/FindCURL/Test/CMakeLists.txt +++ b/Tests/FindCURL/Test/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(CURL REQUIRED) add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}") add_executable(test_tgt main.c) -target_link_libraries(test_tgt CURL::CURL) +target_link_libraries(test_tgt CURL::libcurl) add_test(NAME test_tgt COMMAND test_tgt) add_executable(test_var main.c) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index b2b38ef..69c96cc 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -109,6 +109,7 @@ function(run_cmake test) "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:" "|Error kstat returned" "|Hit xcodebuild bug" + "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" "|ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit" "|ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information" "|[^\n]*is a member of multiple groups" diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt b/Tests/RunCMake/Syntax/NullAfterBackslash-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt +++ b/Tests/RunCMake/Syntax/NullAfterBackslash-result.txt diff --git a/Tests/RunCMake/Syntax/NullAfterBackslash-stderr.txt b/Tests/RunCMake/Syntax/NullAfterBackslash-stderr.txt new file mode 100644 index 0000000..e7ba440 --- /dev/null +++ b/Tests/RunCMake/Syntax/NullAfterBackslash-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at NullAfterBackslash.cmake:1: + Parse error. Function missing ending "\)". Instead found bad character + with text "\\". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/NullAfterBackslash.cmake b/Tests/RunCMake/Syntax/NullAfterBackslash.cmake Binary files differnew file mode 100644 index 0000000..ed96904 --- /dev/null +++ b/Tests/RunCMake/Syntax/NullAfterBackslash.cmake diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index 628df91..b8f5fd0 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -55,6 +55,7 @@ run_cmake(BracketNoSpace5) run_cmake(Escape1) run_cmake(Escape2) run_cmake(EscapeCharsAllowed) +run_cmake(NullAfterBackslash) run_cmake(NullTerminatedArgument) include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake") run_cmake(ParenNoSpace0) diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt index 4825d7a..a8f10b5 100644 --- a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt @@ -1,3 +1 @@ - *Error when uploading file: .*/Configure.xml *Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*) - *Problems when submitting via HTTP diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index b5d90d2..ed0e666 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -5,14 +5,19 @@ set(CASE_DROP_METHOD "http") set(CASE_DROP_SITE "-no-site-") set(CASE_CTEST_SUBMIT_ARGS "") -#----------------------------------------------------------------------------- -# Test bad argument combinations. function(run_ctest_submit CASE_NAME) set(CASE_CTEST_SUBMIT_ARGS "${ARGN}") run_ctest(${CASE_NAME}) endfunction() +function(run_ctest_submit_debug CASE_NAME) + set(CASE_CTEST_SUBMIT_ARGS "${ARGN}") + run_ctest(${CASE_NAME} "--debug") +endfunction() + +#----------------------------------------------------------------------------- +# Test bad argument combinations. run_ctest_submit(BadArg bad-arg) run_ctest_submit(BadPARTS PARTS bad-part) run_ctest_submit(BadFILES FILES bad-file) @@ -25,8 +30,8 @@ run_ctest_submit(CDashUploadNone CDASH_UPLOAD) run_ctest_submit(CDashUploadMissingFile CDASH_UPLOAD bad-upload) run_ctest_submit(CDashUploadRetry CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo RETRY_COUNT 2 RETRY_DELAY 1 INTERNAL_TEST_CHECKSUM) run_ctest_submit(CDashSubmitQuiet QUIET) -run_ctest_submit(CDashSubmitHeaders HTTPHEADER "Authorization: Bearer asdf") -run_ctest_submit(CDashUploadHeaders CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo HTTPHEADER "Authorization: Bearer asdf") +run_ctest_submit_debug(CDashSubmitHeaders HTTPHEADER "Authorization: Bearer asdf") +run_ctest_submit_debug(CDashUploadHeaders CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo HTTPHEADER "Authorization: Bearer asdf") function(run_ctest_CDashUploadFTP) set(CASE_DROP_METHOD ftp) diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt b/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt b/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt deleted file mode 100644 index af3cb2e..0000000 --- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at GLOB-error-FOLLOW_SYMLINKS\.cmake:[0-9]+ \(file\): - file FOLLOW_SYMLINKS is not a valid parameter for GLOB\. -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS.cmake b/Tests/RunCMake/file/GLOB-noexp-FOLLOW_SYMLINKS.cmake index 6d467a0..6d467a0 100644 --- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS.cmake +++ b/Tests/RunCMake/file/GLOB-noexp-FOLLOW_SYMLINKS.cmake diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt b/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt deleted file mode 100644 index ee6cb0b..0000000 --- a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at GLOB-noexp-LIST_DIRECTORIES\.cmake:[0-9]+ \(file\): - file GLOB requires a glob expression after the bool\. -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index 342606b..b383230 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -39,12 +39,12 @@ run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS) # tests are valid both for GLOB and GLOB_RECURSE run_cmake(GLOB-sort-dedup) -run_cmake(GLOB-error-FOLLOW_SYMLINKS) run_cmake(GLOB-error-LIST_DIRECTORIES-not-boolean) run_cmake(GLOB-error-LIST_DIRECTORIES-no-arg) run_cmake(GLOB-error-RELATIVE-no-arg) run_cmake(GLOB-error-CONFIGURE_DEPENDS-modified) run_cmake(GLOB-noexp-CONFIGURE_DEPENDS) +run_cmake(GLOB-noexp-FOLLOW_SYMLINKS) run_cmake(GLOB-noexp-LIST_DIRECTORIES) run_cmake(GLOB-noexp-RELATIVE) run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P |