diff options
Diffstat (limited to 'Tests/RunCMake')
355 files changed, 2843 insertions, 255 deletions
diff --git a/Tests/RunCMake/AutoExportDll/AutoExport.cmake b/Tests/RunCMake/AutoExportDll/AutoExport.cmake index d37e896..a550005 100644 --- a/Tests/RunCMake/AutoExportDll/AutoExport.cmake +++ b/Tests/RunCMake/AutoExportDll/AutoExport.cmake @@ -11,5 +11,11 @@ if(MSVC) set_target_properties(say PROPERTIES ENABLE_EXPORTS ON) add_library(autoexport_for_exec SHARED hello2.c) target_link_libraries(autoexport_for_exec say) + if(NOT MSVC_VERSION VERSION_LESS 1600) + enable_language(ASM_MASM) + target_sources(autoexport PRIVATE nop.asm) + set_property(SOURCE nop.asm PROPERTY COMPILE_FLAGS /safeseh) + target_compile_definitions(say PRIVATE HAS_JUSTNOP) + endif() endif() target_link_libraries(say autoexport autoexport2) diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c index 4b1318b..e70fbb5 100644 --- a/Tests/RunCMake/AutoExportDll/foo.c +++ b/Tests/RunCMake/AutoExportDll/foo.c @@ -13,3 +13,5 @@ int bar() { return 5; } + +const char testconst[] = "testconst"; diff --git a/Tests/RunCMake/AutoExportDll/nop.asm b/Tests/RunCMake/AutoExportDll/nop.asm new file mode 100644 index 0000000..fd6892f --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/nop.asm @@ -0,0 +1,12 @@ +IFDEF RAX +ELSE +.MODEL FLAT,C +ENDIF + +SOME SEGMENT EXECUTE READ + +public justnop +justnop: + ret + +END diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx index e966b1f..eb9c0ff 100644 --- a/Tests/RunCMake/AutoExportDll/say.cxx +++ b/Tests/RunCMake/AutoExportDll/say.cxx @@ -12,6 +12,15 @@ int WINAPI foo(); // test regular C int bar(); int objlib(); +void justnop(); + +// test const export +#ifdef _WIN32 +// data symbols must be explicitly imported +__declspec(dllimport) extern const char testconst[]; +#else +extern const char testconst[]; +#endif } // test c++ functions @@ -42,5 +51,10 @@ int main() bar(); objlib(); printf("\n"); + printf("%s", testconst); + printf("\n"); +#ifdef HAS_JUSTNOP + justnop(); +#endif return 0; } diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake new file mode 100644 index 0000000..0f92e0e --- /dev/null +++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake @@ -0,0 +1,13 @@ +add_custom_command( + OUTPUT output.cxx + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx output.cxx + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx + IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx) +add_custom_target(generate ALL DEPENDS output.cxx) +set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}) + +file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +set(check_pairs + \"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\" + ) +") diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx new file mode 100644 index 0000000..9a0edef --- /dev/null +++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx @@ -0,0 +1,6 @@ +#include "MakeCustomIncludes.h" + +int main() +{ + return MakeCustomIncludes(); +} diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake new file mode 100644 index 0000000..6bb01a6 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake @@ -0,0 +1,3 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/MakeCustomIncludes.h" [[ +inline int MakeCustomIncludes() { return 1; } +]]) diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake new file mode 100644 index 0000000..6b3151d --- /dev/null +++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake @@ -0,0 +1,3 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/MakeCustomIncludes.h" [[ +inline int MakeCustomIncludes() { return 2; } +]]) diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index ffd3ae1..9941c70 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -31,7 +31,7 @@ function(run_BuildDepends CASE) endfunction() run_BuildDepends(C-Exe) -if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode") +if(NOT RunCMake_GENERATOR STREQUAL "Xcode") if(RunCMake_GENERATOR MATCHES "Visual Studio 10") # VS 10 forgets to re-link when a manifest changes set(run_BuildDepends_skip_step_2 1) @@ -43,9 +43,11 @@ endif() run_BuildDepends(Custom-Symbolic-and-Byproduct) run_BuildDepends(Custom-Always) -if(RunCMake_GENERATOR MATCHES "Make" AND - NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}") - run_BuildDepends(MakeInProjectOnly) +if(RunCMake_GENERATOR MATCHES "Make") + run_BuildDepends(MakeCustomIncludes) + if(NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}") + run_BuildDepends(MakeInProjectOnly) + endif() endif() function(run_ReGeneration) diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt new file mode 100644 index 0000000..048762d --- /dev/null +++ b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0019 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt index f672285..5d39214 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt @@ -4,13 +4,13 @@ CMake Warning \(dev\) in CMakeLists.txt: cmake_policy command to set the policy and suppress this warning. Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from - its LINK_INTERFACE_LIBRARIES properties. + its LINK_INTERFACE_LIBRARIES(_DEBUG)? properties. INTERFACE_LINK_LIBRARIES: foo - LINK_INTERFACE_LIBRARIES: + LINK_INTERFACE_LIBRARIES(_DEBUG)?: bat diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake index 11b4e22..03223e8 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake @@ -5,7 +5,9 @@ add_library(foo SHARED empty_vs6_1.cpp) add_library(bar SHARED empty_vs6_2.cpp) add_library(bat SHARED empty_vs6_3.cpp) target_link_libraries(bar LINK_PUBLIC foo) +# Replace the compatibility values set by target_link_libraries set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat) +set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES_DEBUG bat) add_library(user SHARED empty.cpp) target_link_libraries(user bar) diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt new file mode 100644 index 0000000..edeb337 --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0026-CONFIG-LOCATION-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0026 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt new file mode 100644 index 0000000..32ff698 --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0026-LOCATION-CONFIG-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0026 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt new file mode 100644 index 0000000..b3f79fc --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0026-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0026 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake b/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake new file mode 100644 index 0000000..80497a3 --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake @@ -0,0 +1,12 @@ +enable_language(CXX) + +cmake_policy(SET CMP0026 OLD) + +set(out ${CMAKE_CURRENT_BINARY_DIR}/out.txt) + +add_library(somelib empty.cpp ${out}) +get_target_property(_loc somelib LOCATION) + +file(WRITE "${out}" + "source file written by project code after getting target LOCATION\n" + ) diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake index 6331717..047da28 100644 --- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake @@ -1,6 +1,7 @@ include(RunCMake) run_cmake(CMP0026-WARN) +run_cmake(CMP0026-OLD) run_cmake(CMP0026-NEW) run_cmake(CMP0026-IMPORTED) run_cmake(CMP0026-CONFIG-LOCATION-NEW) diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt new file mode 100644 index 0000000..157a046 --- /dev/null +++ b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at clear-cached-information.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0026 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt new file mode 100644 index 0000000..b7a0755 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0028-OLD-iface.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0028 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt new file mode 100644 index 0000000..586a876 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0028-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0028 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0068/CMP0068-NEW-result.txt b/Tests/RunCMake/CMP0068/CMP0068-NEW-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-NEW-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake b/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake new file mode 100644 index 0000000..eb8cfa1 --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-NEW.cmake @@ -0,0 +1,6 @@ + +cmake_policy(SET CMP0068 NEW) +cmake_policy(SET CMP0042 NEW) + +add_library(foo SHARED empty.cpp) +set_target_properties(foo PROPERTIES INSTALL_NAME_DIR "@rpath" INSTALL_RPATH "@loader_path/" BUILD_WITH_INSTALL_RPATH 1) diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD-result.txt b/Tests/RunCMake/CMP0068/CMP0068-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake b/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake new file mode 100644 index 0000000..cf1040f --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-OLD.cmake @@ -0,0 +1,6 @@ + +cmake_policy(SET CMP0068 OLD) +cmake_policy(SET CMP0042 NEW) + +add_library(foo SHARED empty.cpp) +set_target_properties(foo PROPERTIES INSTALL_NAME_DIR "@rpath" INSTALL_RPATH "@loader_path/" BUILD_WITH_INSTALL_RPATH 1) diff --git a/Tests/RunCMake/CMP0068/CMP0068-WARN-result.txt b/Tests/RunCMake/CMP0068/CMP0068-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0068/CMP0068-WARN-stderr.txt b/Tests/RunCMake/CMP0068/CMP0068-WARN-stderr.txt new file mode 100644 index 0000000..3cb5854 --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-WARN-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\): + Policy CMP0068 is not set: RPATH settings on macOS do not affect + install_name. Run "cmake --help-policy CMP0068" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. + + For compatibility with older versions of CMake, the install_name fields for + the following targets are still affected by RPATH settings: + + foo3 + foo4 + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake b/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake new file mode 100644 index 0000000..b7ec480 --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMP0068-WARN.cmake @@ -0,0 +1,12 @@ +cmake_policy(SET CMP0042 NEW) + +add_library(foo SHARED empty.cpp) +add_library(foo-static STATIC empty.cpp) +add_library(foo2 SHARED empty.cpp) +set_target_properties(foo2 PROPERTIES MACOSX_RPATH 1) +add_library(foo3 SHARED empty.cpp) +set_target_properties(foo3 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@loader_path") +add_library(foo4 SHARED empty.cpp) +set_target_properties(foo4 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath") +add_library(foo5 SHARED empty.cpp) +set_target_properties(foo5 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 BUILD_WITH_INSTALL_NAME_DIR 1 INSTALL_NAME_DIR "@rpath") diff --git a/Tests/RunCMake/CMP0068/CMakeLists.txt b/Tests/RunCMake/CMP0068/CMakeLists.txt new file mode 100644 index 0000000..375cbdb --- /dev/null +++ b/Tests/RunCMake/CMP0068/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.8) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0068/RunCMakeTest.cmake b/Tests/RunCMake/CMP0068/RunCMakeTest.cmake new file mode 100644 index 0000000..88a6225 --- /dev/null +++ b/Tests/RunCMake/CMP0068/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0068-OLD) +run_cmake(CMP0068-NEW) +run_cmake(CMP0068-WARN) diff --git a/Tests/RunCMake/CMP0068/empty.cpp b/Tests/RunCMake/CMP0068/empty.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/CMP0068/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-result.txt diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt new file mode 100644 index 0000000..ddb3cae --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0069-NEW-cmake\.cmake:[0-9]+ \(add_executable\): + CMake doesn't support IPO for current compiler +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake new file mode 100644 index 0000000..23fae13 --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0069 NEW) + +set(_CMAKE_IPO_SUPPORTED_BY_CMAKE NO) + +add_executable(foo main.cpp) +set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/find_dependency/extra-args-result.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/extra-args-result.txt +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-result.txt diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt new file mode 100644 index 0000000..8decfab --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0069-NEW-compiler\.cmake:[0-9]+ \(add_executable\): + Compiler doesn't support IPO +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake new file mode 100644 index 0000000..24b409a --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0069 NEW) + +set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) + +add_executable(foo main.cpp) +set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/find_dependency/empty-version-result.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/empty-version-result.txt +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-result.txt diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt new file mode 100644 index 0000000..0e05ee7 --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0069-NEW-generator\.cmake:[0-9]+ \(add_executable\): + CMake doesn't support IPO for current generator +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake new file mode 100644 index 0000000..df2a888 --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0069 NEW) + +set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) + +add_executable(foo main.cpp) +set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/CMP0069-OLD.cmake b/Tests/RunCMake/CMP0069/CMP0069-OLD.cmake new file mode 100644 index 0000000..cfe1e9d --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-OLD.cmake @@ -0,0 +1,4 @@ +cmake_policy(SET CMP0069 OLD) + +add_executable(foo main.cpp) +set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/CMP0069-WARN-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-WARN-stderr.txt new file mode 100644 index 0000000..314e180 --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-WARN-stderr.txt @@ -0,0 +1,9 @@ +^CMake Warning \(dev\) at CMP0069-WARN\.cmake:[0-9]+ \(add_executable\): + Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when + enabled. Run "cmake --help-policy CMP0069" for policy details\. Use the + cmake_policy command to set the policy and suppress this warning\. + + INTERPROCEDURAL_OPTIMIZATION property will be ignored for target 'foo'\. +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/CMP0069/CMP0069-WARN.cmake b/Tests/RunCMake/CMP0069/CMP0069-WARN.cmake new file mode 100644 index 0000000..0e3e670 --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMP0069-WARN.cmake @@ -0,0 +1,4 @@ +set(_CMAKE_IPO_LEGACY_BEHAVIOR NO) + +add_executable(foo main.cpp) +set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/CMakeLists.txt b/Tests/RunCMake/CMP0069/CMakeLists.txt new file mode 100644 index 0000000..375cbdb --- /dev/null +++ b/Tests/RunCMake/CMP0069/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.8) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0069/RunCMakeTest.cmake b/Tests/RunCMake/CMP0069/RunCMakeTest.cmake new file mode 100644 index 0000000..f44f840 --- /dev/null +++ b/Tests/RunCMake/CMP0069/RunCMakeTest.cmake @@ -0,0 +1,10 @@ +include(RunCMake) + +run_cmake(CMP0069-OLD) +run_cmake(CMP0069-NEW-cmake) +run_cmake(CMP0069-NEW-compiler) +run_cmake(CMP0069-WARN) + +if(RunCMake_GENERATOR MATCHES "^Visual Studio ") + run_cmake(CMP0069-NEW-generator) +endif() diff --git a/Tests/RunCMake/CMP0069/main.cpp b/Tests/RunCMake/CMP0069/main.cpp new file mode 100644 index 0000000..5047a34 --- /dev/null +++ b/Tests/RunCMake/CMP0069/main.cpp @@ -0,0 +1,3 @@ +int main() +{ +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index a16efb3..75d4e29 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -63,15 +63,6 @@ if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1) set(Swift_ARGS -DXCODE_BELOW_6_1=1) endif() -if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3) - set(GeneratorToolset_ARGS -DXCODE_BELOW_3=1) -endif() - -if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 2) - set(TargetSources_ARGS -DXCODE_BELOW_2=1) - set(File_Generate_ARGS -DXCODE_BELOW_2=1) -endif() - # Test MSVC for older host CMake versions, and test # WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows. if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel")) @@ -104,6 +95,10 @@ add_RunCMake_test(CMP0057) add_RunCMake_test(CMP0059) add_RunCMake_test(CMP0060) add_RunCMake_test(CMP0064) +if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) + add_RunCMake_test(CMP0068) +endif() +add_RunCMake_test(CMP0069) # The test for Policy 65 requires the use of the # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode @@ -115,6 +110,10 @@ if(CMAKE_GENERATOR MATCHES "Make") add_RunCMake_test(Make) endif() if(CMAKE_GENERATOR STREQUAL "Ninja") + set(Ninja_ARGS + -DCMAKE_C_OUTPUT_EXTENSION=${CMAKE_C_OUTPUT_EXTENSION} + -DCMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX} + -DCMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX}) add_RunCMake_test(Ninja) endif() add_RunCMake_test(CTest) @@ -199,6 +198,8 @@ endif() add_RunCMake_test(ctest_start) add_RunCMake_test(ctest_submit) add_RunCMake_test(ctest_test) +add_RunCMake_test(ctest_disabled_test) +add_RunCMake_test(ctest_skipped_test) add_RunCMake_test(ctest_upload) add_RunCMake_test(ctest_fixtures) add_RunCMake_test(file) @@ -216,6 +217,7 @@ add_RunCMake_test(list) add_RunCMake_test(message) add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) add_RunCMake_test(return) +add_RunCMake_test(separate_arguments) add_RunCMake_test(set_property) add_RunCMake_test(string) foreach(var @@ -265,17 +267,17 @@ endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") add_RunCMake_test(include_external_msproject) - if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([789]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND) + if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([89]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND) set(NO_USE_FOLDERS 1) endif() add_RunCMake_test(VSSolution -DNO_USE_FOLDERS=${NO_USE_FOLDERS}) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^89]|[89][0-9])") add_RunCMake_test(VS10Project) endif() -if(XCODE_VERSION AND NOT "${XCODE_VERSION}" VERSION_LESS 3) +if(XCODE_VERSION) add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION}) endif() @@ -290,7 +292,8 @@ add_RunCMake_test(target_link_libraries) add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) -add_RunCMake_test(CommandLine) +add_RunCMake_test(CheckIPOSupported) +add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(CommandLineTar) add_RunCMake_test(install) @@ -322,19 +325,6 @@ add_executable(pseudo_emulator_custom_command pseudo_emulator_custom_command.c) add_RunCMake_test(CrosscompilingEmulator -DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator> -DPSEUDO_EMULATOR_CUSTOM_COMMAND=$<TARGET_FILE:pseudo_emulator_custom_command>) -# Xcode 2.x forgets to create the output directory before linking -# the individual architectures. -if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") - add_custom_command( - TARGET pseudo_emulator - PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" - ) - add_custom_command( - TARGET pseudo_emulator_custom_command - PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" - ) -endif() - if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") if(UNIX AND NOT CYGWIN) execute_process(COMMAND ldd --help diff --git a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake index ce039f5..99d3155 100644 --- a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake +++ b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake @@ -33,7 +33,7 @@ function(getPackageContentList FILE RESULT_VAR) endfunction() function(toExpectedContentList FILE_NO CONTENT_VAR) - findExpectedFile("${FILE_NO}" "file_") + findExpectedFile("${FILE_NO}" "file_" "glob_expr_") # component and monolithic packages differ for some reason by either having # package filename prefix in path or not diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 65399db..faf151a 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -5,7 +5,7 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake") # run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES" run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM" false "MONOLITHIC;COMPONENT") -run_cpack_test(CUSTOM_NAMES "RPM;DEB" true "COMPONENT") +run_cpack_test(CUSTOM_NAMES "RPM;DEB;TGZ" true "COMPONENT") run_cpack_test(DEBUGINFO "RPM" true "COMPONENT") run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT") run_cpack_test(DIST "RPM" false "MONOLITHIC") @@ -21,7 +21,9 @@ run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384; run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false "COMPONENT") run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM") +run_cpack_test(EXTRA_SLASH_IN_PATH "RPM" true "COMPONENT") run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") +run_cpack_test(SYMLINKS "RPM;TGZ" false "MONOLITHIC;COMPONENT") run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") run_cpack_test(MD5SUMS "DEB" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/STGZ/Helpers.cmake b/Tests/RunCMake/CPack/STGZ/Helpers.cmake index 08224d3..68b1eab 100644 --- a/Tests/RunCMake/CPack/STGZ/Helpers.cmake +++ b/Tests/RunCMake/CPack/STGZ/Helpers.cmake @@ -35,7 +35,7 @@ function(getPackageContentList FILE RESULT_VAR) endfunction() function(toExpectedContentList FILE_NO CONTENT_VAR) - findExpectedFile("${FILE_NO}" "file_") + findExpectedFile("${FILE_NO}" "file_" "glob_expr_") get_filename_component(prefix_ "${file_}" NAME) # NAME_WE removes everything after the dot and dot is in version so replace instead diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 59751a7..470ebf7 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR) -function(findExpectedFile FILE_NO RESULT_VAR) +function(findExpectedFile FILE_NO RESULT_VAR GLOBING_EXPR_VAR) if(NOT DEFINED EXPECTED_FILE_${FILE_NO}) # explicit file name regex was not provided - construct one from other data # set defaults if parameters are not provided if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_NAME) @@ -21,6 +21,7 @@ function(findExpectedFile FILE_NO RESULT_VAR) file(GLOB found_file_ RELATIVE "${bin_dir}" "${EXPECTED_FILE_${FILE_NO}}") set(${RESULT_VAR} "${found_file_}" PARENT_SCOPE) + set(${GLOBING_EXPR_VAR} "${EXPECTED_FILE_${FILE_NO}}" PARENT_SCOPE) endfunction() include("${config_file}") @@ -39,7 +40,8 @@ include("${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/ExpectedFiles.cmake") # check that expected generated files exist and contain expected content if(NOT EXPECTED_FILES_COUNT EQUAL 0) foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT}) - findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}") + findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}" + "EXPECTED_FILE_${file_no_}") list(APPEND foundFiles_ "${FOUND_FILE_${file_no_}}") list(LENGTH FOUND_FILE_${file_no_} foundFilesCount_) diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake index ae5f0af..5cb280c 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake @@ -9,4 +9,7 @@ set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") string(TOLOWER "${GENERATOR_TYPE}" file_extension_) set(EXPECTED_FILE_3 "pkg_3_abc.${file_extension_}") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(EXPECTED_FILE_2 "second.tar.gz") + set(EXPECTED_FILE_3 "pkg_3_abc.tar.gz") endif() diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake index 0c2b37b..4c20e41 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake @@ -7,6 +7,9 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") string(TOLOWER "${GENERATOR_TYPE}" file_extension_) set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_3_FILE_NAME "pkg_3_abc.${file_extension_}") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(CPACK_ARCHIVE_PKG_2_FILE_NAME "second") + set(CPACK_ARCHIVE_PKG_3_FILE_NAME "pkg_3_abc") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake index 06e56d3..3d8de74 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake @@ -3,14 +3,16 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) +set(EXPECTED_FILE_1_NAME "Debuginfo") set(EXPECTED_FILE_1_COMPONENT "applications") set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") -set(EXPECTED_FILE_2 "debuginfo*-headers.rpm") +set(EXPECTED_FILE_2 "TestDinfo-pkg*-headers.rpm") set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") -set(EXPECTED_FILE_3 "debuginfo*-libs.rpm") +set(EXPECTED_FILE_3 "TestDinfo-pkg*-libs.rpm") set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/libtest_lib.so") +set(EXPECTED_FILE_4_NAME "Debuginfo") set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo") set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") -set(EXPECTED_FILE_5_COMPONENT "libs-debuginfo") +set(EXPECTED_FILE_5 "libs-DebugInfoPackage.rpm") set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index 0642d83..f1b6738 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -25,6 +25,16 @@ install(TARGETS test_lib DESTINATION bas COMPONENT libs) set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) + +# test that components with debuginfo enabled still honor +# CPACK_PACKAGE_FILE_NAME setting +set(CPACK_RPM_PACKAGE_NAME "Debuginfo") +set(CPACK_PACKAGE_FILE_NAME "TestDinfo-pkg") set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) +# test debuginfo package rename +set(CPACK_RPM_DEBUGINFO_FILE_NAME + "@cpack_component@-DebugInfoPackage.rpm") +set(CPACK_RPM_APPLICATIONS_DEBUGINFO_FILE_NAME "RPM-DEFAULT") + set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") diff --git a/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/ExpectedFiles.cmake new file mode 100644 index 0000000..a45b38d --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/ExpectedFiles.cmake @@ -0,0 +1,16 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "5") +set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) + +set(EXPECTED_FILE_1_COMPONENT "applications") +set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/test_prog") +set(EXPECTED_FILE_2 "extra_slash_in_path*-headers.rpm") +set(EXPECTED_FILE_CONTENT_2_LIST "/bar;/bar/CMakeLists.txt") +set(EXPECTED_FILE_3 "extra_slash_in_path*-libs.rpm") +set(EXPECTED_FILE_CONTENT_3_LIST "/bas;/bas/libtest_lib.so") + +set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo") +set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") +set(EXPECTED_FILE_5_COMPONENT "libs-debuginfo") +set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/VerifyResult.cmake new file mode 100644 index 0000000..bfef720 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/VerifyResult.cmake @@ -0,0 +1,7 @@ +# check that relocation path is /foo and not //foo +getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_") +set(whitespaces_ "[\t\n\r ]*") +if(NOT FILE_INFO_ MATCHES "Relocations${whitespaces_}:${whitespaces_}/${whitespaces_}/foo") + message(FATAL_ERROR "Unexpected relocation path in file '${FOUND_FILE_1}';" + " file info: '${FILE_INFO_}'") +endif() diff --git a/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/test.cmake b/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/test.cmake new file mode 100644 index 0000000..4fd1e81 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA_SLASH_IN_PATH/test.cmake @@ -0,0 +1,37 @@ +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +# PGI compiler doesn't add build id to binaries by default +if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") + string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") + string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") +endif() + +set(CMAKE_BUILD_TYPE Debug) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") +add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +target_link_libraries(test_prog test_lib) + +install(TARGETS test_prog DESTINATION foo COMPONENT applications) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) +install(TARGETS test_lib DESTINATION bas COMPONENT libs) + +set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) +set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) + +# extra trailing slash at the end that should be removed +set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src/") + +# combination should not cause //foo to apper as an relocation path +# should be only /foo (extra slashes cause path comparisons to fail) +set(CPACK_PACKAGING_INSTALL_PREFIX "/") +# extra trailing slash at the end that should be removed +set(CPACK_RPM_RELOCATION_PATHS "foo/") diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/ExpectedFiles.cmake new file mode 100644 index 0000000..05be748 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/ExpectedFiles.cmake @@ -0,0 +1,13 @@ +set(EXPECTED_FILES_COUNT "1") + +set(EXPECTED_FILE_CONTENT_1_LIST + "/usr" + "/usr/empty_dir" + "/usr/non_empty_dir" + "/usr/non_empty_dir/CMakeLists.txt" + "/usr/symlink_to_empty_dir" + "/usr/symlink_to_non_empty_dir") + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(EXPECTED_FILE_1_COMPONENT "links") +endif() diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/TGZ-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/TGZ-Prerequirements.cmake new file mode 100644 index 0000000..f3df46b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/TGZ-Prerequirements.cmake @@ -0,0 +1,5 @@ +function(get_test_prerequirements found_var config_file) + if(UNIX) # limit test to platforms that support symlinks + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/VerifyResult.cmake new file mode 100644 index 0000000..0632319 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/VerifyResult.cmake @@ -0,0 +1,26 @@ +set(whitespaces "[\\t\\n\\r ]*") + +####################### +# verify generated symbolic links +####################### +file(GLOB_RECURSE symlink_files RELATIVE "${bin_dir}" "${bin_dir}/*/symlink_*") + +foreach(check_symlink IN LISTS symlink_files) + get_filename_component(symlink_name "${check_symlink}" NAME) + execute_process(COMMAND ls -la "${check_symlink}" + WORKING_DIRECTORY "${bin_dir}" + OUTPUT_VARIABLE SYMLINK_POINT_ + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if("${symlink_name}" STREQUAL "symlink_to_empty_dir") + string(REGEX MATCH "^.*${whitespaces}->${whitespaces}empty_dir$" check_symlink "${SYMLINK_POINT_}") + elseif("${symlink_name}" STREQUAL "symlink_to_non_empty_dir") + string(REGEX MATCH "^.*${whitespaces}->${whitespaces}non_empty_dir$" check_symlink "${SYMLINK_POINT_}") + else() + message(FATAL_ERROR "error: unexpected rpm symbolic link '${check_symlink}'") + endif() + + if(NOT check_symlink) + message(FATAL_ERROR "symlink points to unexpected location '${SYMLINK_POINT_}'") + endif() +endforeach() diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/test.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/test.cmake new file mode 100644 index 0000000..fef765c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/test.cmake @@ -0,0 +1,14 @@ +install(DIRECTORY DESTINATION empty_dir COMPONENT links) +install(FILES CMakeLists.txt DESTINATION non_empty_dir COMPONENT links) + +# test symbolic link to an empty dir +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink empty_dir symlink_to_empty_dir) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/symlink_to_empty_dir DESTINATION "." COMPONENT links) + +# test symbolic link to a non empty dir +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink non_empty_dir symlink_to_non_empty_dir) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/symlink_to_non_empty_dir DESTINATION "." COMPONENT links) + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL links) +endif() diff --git a/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt b/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt new file mode 100644 index 0000000..4a13d29 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) + +cmake_policy(SET CMP0069 NEW) + +include(CheckIPOSupported) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake new file mode 100644 index 0000000..e145569 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake @@ -0,0 +1,13 @@ +include(RunCMake) + +run_cmake(unparsed-arguments) +run_cmake(user-lang-unknown) +run_cmake(default-lang-none) +run_cmake(not-supported-by-cmake) +run_cmake(not-supported-by-compiler) +run_cmake(save-to-result) +run_cmake(cmp0069-is-old) + +if(RunCMake_GENERATOR MATCHES "^Visual Studio ") + run_cmake(not-supported-by-generator) +endif() diff --git a/Tests/RunCMake/find_dependency/empty-arg-3-result.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/empty-arg-3-result.txt +++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-result.txt diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt new file mode 100644 index 0000000..f183594 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + Policy CMP0069 set to OLD +Call Stack \(most recent call first\): + cmp0069-is-old\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake new file mode 100644 index 0000000..14fed04 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake @@ -0,0 +1,6 @@ +project(${RunCMake_TEST} LANGUAGES C CXX) + +cmake_policy(SET CMP0069 OLD) + +include(CheckIPOSupported) +check_ipo_supported() diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt b/Tests/RunCMake/CheckIPOSupported/default-lang-none-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt +++ b/Tests/RunCMake/CheckIPOSupported/default-lang-none-result.txt diff --git a/Tests/RunCMake/CheckIPOSupported/default-lang-none-stderr.txt b/Tests/RunCMake/CheckIPOSupported/default-lang-none-stderr.txt new file mode 100644 index 0000000..dc2c3ad --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/default-lang-none-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + IPO is not supported \(no C/CXX/Fortran languages found in ENABLED_LANGUAGES + global property\)\. +Call Stack \(most recent call first\): + .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) + default-lang-none\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/default-lang-none.cmake b/Tests/RunCMake/CheckIPOSupported/default-lang-none.cmake new file mode 100644 index 0000000..0a2ac69 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/default-lang-none.cmake @@ -0,0 +1 @@ +check_ipo_supported() diff --git a/Tests/RunCMake/TargetObjects/BadContext-result.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/TargetObjects/BadContext-result.txt +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-result.txt diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt new file mode 100644 index 0000000..f63f30f --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + IPO is not supported \(CMake doesn't support IPO for current compiler\)\. +Call Stack \(most recent call first\): + .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) + not-supported-by-cmake\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake new file mode 100644 index 0000000..6f61f7e --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake @@ -0,0 +1,3 @@ +project(${RunCMake_TEST} LANGUAGES C) +set(_CMAKE_IPO_SUPPORTED_BY_CMAKE NO) +check_ipo_supported() diff --git a/Tests/RunCMake/ObjectLibrary/Install-result.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ObjectLibrary/Install-result.txt +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-result.txt diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt new file mode 100644 index 0000000..5f5f410 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + IPO is not supported \(Compiler doesn't support IPO\)\. +Call Stack \(most recent call first\): + .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) + not-supported-by-compiler\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake new file mode 100644 index 0000000..652cfd5 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake @@ -0,0 +1,4 @@ +project(${RunCMake_TEST} LANGUAGES C) +set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) +check_ipo_supported() diff --git a/Tests/RunCMake/ObjectLibrary/Import-result.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ObjectLibrary/Import-result.txt +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator-result.txt diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator-stderr.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator-stderr.txt new file mode 100644 index 0000000..a2aa58c --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + IPO is not supported \(CMake doesn't support IPO for current generator\)\. +Call Stack \(most recent call first\): + .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) + not-supported-by-generator\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake new file mode 100644 index 0000000..dc0fa09 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake @@ -0,0 +1,6 @@ +project(${RunCMake_TEST} LANGUAGES C) + +set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) + +check_ipo_supported() diff --git a/Tests/RunCMake/CheckIPOSupported/save-to-result.cmake b/Tests/RunCMake/CheckIPOSupported/save-to-result.cmake new file mode 100644 index 0000000..f76db72 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/save-to-result.cmake @@ -0,0 +1,22 @@ +project(${RunCMake_TEST} LANGUAGES C) +check_ipo_supported(RESULT result OUTPUT output) + +string(COMPARE EQUAL "${result}" "" is_empty) +if(is_empty) + message(FATAL_ERROR "Result variable is empty") +endif() + +string(COMPARE EQUAL "${result}" "YES" is_yes) +string(COMPARE EQUAL "${result}" "NO" is_no) + +if(is_yes) + # Compiler supports IPO +elseif(is_no) + # Compiler doesn't support IPO, output should not be empty. + string(COMPARE EQUAL "${output}" "" is_empty) + if(is_empty) + message(FATAL_ERROR "Output is empty") + endif() +else() + message(FATAL_ERROR "Unexpected result: ${result}") +endif() diff --git a/Tests/RunCMake/ObjectLibrary/Export-result.txt b/Tests/RunCMake/CheckIPOSupported/unparsed-arguments-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ObjectLibrary/Export-result.txt +++ b/Tests/RunCMake/CheckIPOSupported/unparsed-arguments-result.txt diff --git a/Tests/RunCMake/CheckIPOSupported/unparsed-arguments-stderr.txt b/Tests/RunCMake/CheckIPOSupported/unparsed-arguments-stderr.txt new file mode 100644 index 0000000..a3fee53 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/unparsed-arguments-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + Unparsed arguments: xxx +Call Stack \(most recent call first\): + unparsed-arguments\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/unparsed-arguments.cmake b/Tests/RunCMake/CheckIPOSupported/unparsed-arguments.cmake new file mode 100644 index 0000000..3ee7326 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/unparsed-arguments.cmake @@ -0,0 +1 @@ +check_ipo_supported(RESULT result OUTPUT output xxx) diff --git a/Tests/RunCMake/CheckIPOSupported/user-lang-unknown-result.txt b/Tests/RunCMake/CheckIPOSupported/user-lang-unknown-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/user-lang-unknown-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CheckIPOSupported/user-lang-unknown-stderr.txt b/Tests/RunCMake/CheckIPOSupported/user-lang-unknown-stderr.txt new file mode 100644 index 0000000..278ba0b --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/user-lang-unknown-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): + IPO is not supported \(language\(s\) 'UnknownLanguage' not supported\)\. +Call Stack \(most recent call first\): + .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) + user-lang-unknown\.cmake:[0-9]+ \(check_ipo_supported\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckIPOSupported/user-lang-unknown.cmake b/Tests/RunCMake/CheckIPOSupported/user-lang-unknown.cmake new file mode 100644 index 0000000..ac743ad --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/user-lang-unknown.cmake @@ -0,0 +1 @@ +check_ipo_supported(LANGUAGES UnknownLanguage) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt deleted file mode 100644 index 2cb01ff..0000000 --- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Warning: - The "Visual Studio 7 .NET 2003" generator is deprecated and will be removed - in a future version of CMake. - - Add CMAKE_WARN_VS71=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-OFF.cmake index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake +++ b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-OFF.cmake diff --git a/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt new file mode 100644 index 0000000..2f2cbd3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 8 2005" generator is deprecated and will be removed in a + future version of CMake. + + Add CMAKE_WARN_VS8=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON.cmake index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake +++ b/Tests/RunCMake/CommandLine/DeprecateVS8-WARN-ON.cmake diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 0c4f71c..f94b10a 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.1) + include(RunCMake) run_cmake_command(NoArgs ${CMAKE_COMMAND}) @@ -76,11 +78,11 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") unset(RunCMake_TEST_NO_CLEAN) endif() -if(RunCMake_GENERATOR STREQUAL "Visual Studio 7 .NET 2003") - set(RunCMake_WARN_VS71 1) - run_cmake(DeprecateVS71-WARN-ON) - unset(RunCMake_WARN_VS71) - run_cmake(DeprecateVS71-WARN-OFF) +if(RunCMake_GENERATOR MATCHES "^Visual Studio 8 2005") + set(RunCMake_WARN_VS8 1) + run_cmake(DeprecateVS8-WARN-ON) + unset(RunCMake_WARN_VS8) + run_cmake(DeprecateVS8-WARN-OFF) endif() if(UNIX) @@ -301,3 +303,14 @@ set(CMAKE_RELATIVE_PATH_TOP_BINARY \"${RunCMake_TEST_BINARY_DIR}\") ) endfunction() run_cmake_depends() + +function(reject_fifo) + find_program(BASH_EXECUTABLE bash) + if(BASH_EXECUTABLE) + set(BASH_COMMAND_ARGUMENT "'${CMAKE_COMMAND}' -P <(echo 'return()')") + run_cmake_command(reject_fifo ${BASH_EXECUTABLE} -c ${BASH_COMMAND_ARGUMENT}) + endif() +endfunction() +if(CMAKE_HOST_UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "CYGWIN") + reject_fifo() +endif() diff --git a/Tests/RunCMake/CommandLine/reject_fifo-result.txt b/Tests/RunCMake/CommandLine/reject_fifo-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/reject_fifo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/reject_fifo-stderr.txt b/Tests/RunCMake/CommandLine/reject_fifo-stderr.txt new file mode 100644 index 0000000..7a335c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/reject_fifo-stderr.txt @@ -0,0 +1,2 @@ +CMake Error in .* + Error while reading Byte-Order-Mark\. File not seekable\? diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 2d14a9e..b24a680 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -6,9 +6,10 @@ add_library(empty3 INTERFACE) target_compile_features(empty3 INTERFACE cxx_std_11) target_link_libraries(empty1 - # When starting, $<COMPILE_FEATURES:cxx_auto_type> is '0', so 'freeze' the + # When starting, $<COMPILE_FEATURES:cxx_std_11> is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. - $<$<COMPILE_FEATURES:cxx_auto_type>:empty2> + $<$<COMPILE_FEATURES:cxx_std_11>:empty2> + # This would add cxx_std_11, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 8dc627d..5a70da2 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -1,3 +1,4 @@ +cmake_policy(SET CMP0057 NEW) include(RunCMake) run_cmake(NotAFeature) @@ -28,13 +29,13 @@ endif() if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) -else() +elseif (cxx_std_98 IN_LIST CXX_FEATURES AND cxx_std_11 IN_LIST CXX_FEATURES) if(CXX_STANDARD_DEFAULT EQUAL 98) run_cmake(LinkImplementationFeatureCycle) endif() run_cmake(LinkImplementationFeatureCycleSolved) - if (";${CXX_FEATURES};" MATCHES ";cxx_final;") + if (cxx_final IN_LIST CXX_FEATURES) set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") endif() run_cmake(NonValidTarget1) diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt new file mode 100644 index 0000000..430c865 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0029-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0029 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt index e95e16f..d00b827 100644 --- a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at CMP0030-OLD.cmake:2 \(use_mangled_mesa\): +^CMake Deprecation Warning at CMP0030-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0030 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at CMP0030-OLD.cmake:2 \(use_mangled_mesa\): use_mangled_mesa called with incorrect number of arguments Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt new file mode 100644 index 0000000..723c467 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt @@ -0,0 +1,91 @@ +-- The following TYPE1 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have not been found: + + \* Bar + +-- The following TYPE3 packages have not been found: + + \* Baz + +--[ ] + \* Foo, The Foo package, <https://foo.example/> + +--[ ] + \* Bar + +--[ ] + \* Baz + +-- TYPE1 pkgs found + + \* Foo, The Foo package, <https://foo.example/> + +-- TYPE2 pkgs not found + + \* Bar + +-- TYPE3 pkgs not found + + \* Baz + +-- The following TYPE1 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have not been found: + + \* Bar + +-- The following TYPE3 packages have not been found: + + \* Baz + +-- The following first type packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following second type packages have not been found: + + \* Bar + +-- The following third type packages have not been found: + + \* Baz + +--[ ] + \* Foo, The Foo package, <https://foo.example/> + +--[ ] + \* Bar + +--[ ] + \* Baz + +-- TYPE1 pkgs found + + \* Foo, The Foo package, <https://foo.example/> + +-- TYPE2 pkgs not found + + \* Bar + +-- TYPE3 pkgs not found + + \* Baz + +-- The following first type packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following second type packages have not been found: + + \* Bar + +-- The following third type packages have not been found: + + \* Baz + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake new file mode 100644 index 0000000..e61b652 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake @@ -0,0 +1,158 @@ +include(FeatureSummary) +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) +find_package(Bar) +find_package(Baz) + +set_package_properties(Foo PROPERTIES TYPE TYPE1) +set_package_properties(Bar PROPERTIES TYPE TYPE2) +set_package_properties(Baz PROPERTIES TYPE TYPE3) + +feature_summary(WHAT ALL) + +feature_summary(WHAT TYPE1_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE2_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE3_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) + +feature_summary(WHAT TYPE1_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE1 pkgs found\n") +feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE1 pkgs not found\n") +feature_summary(WHAT TYPE2_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE2 pkgs found\n") +feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE2 pkgs not found\n") +feature_summary(WHAT TYPE3_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE3 pkgs found\n") +feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE3 pkgs not found\n") + +feature_summary(WHAT TYPE1_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE2_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE3_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) + +set_property(GLOBAL PROPERTY FeatureSummary_TYPE1_DESCRIPTION "first type packages") +set_property(GLOBAL PROPERTY FeatureSummary_TYPE2_DESCRIPTION "second type packages") +set_property(GLOBAL PROPERTY FeatureSummary_TYPE3_DESCRIPTION "third type packages") + +feature_summary(WHAT ALL) + +feature_summary(WHAT TYPE1_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE2_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE3_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) + +feature_summary(WHAT TYPE1_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE1 pkgs found\n") +feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE1 pkgs not found\n") +feature_summary(WHAT TYPE2_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE2 pkgs found\n") +feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE2 pkgs not found\n") +feature_summary(WHAT TYPE3_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE3 pkgs found\n") +feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "TYPE3 pkgs not found\n") + +feature_summary(WHAT TYPE1_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE2_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE3_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt new file mode 100644 index 0000000..47bdee3 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt @@ -0,0 +1,46 @@ +-- The following RUNTIME packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have not been found: + + \* Bar + +-- The following REQUIRED packages have not been found: + + \* Baz + +--[ ] + \* Foo, The Foo package, <https://foo.example/> + +--[ ] + \* Bar + +--[ ] + \* Baz + +-- RUNTIME pkgs found + + \* Foo, The Foo package, <https://foo.example/> + +-- OPTIONAL pkgs not found + + \* Bar + +-- REQUIRED pkgs not found + + \* Baz + +-- The following RUNTIME packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have not been found: + + \* Bar + +-- The following REQUIRED packages have not been found: + + \* Baz + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake new file mode 100644 index 0000000..536fe72 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake @@ -0,0 +1,82 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) +find_package(Bar) +find_package(Baz) + +set_package_properties(Foo PROPERTIES TYPE RUNTIME) +set_package_properties(Bar PROPERTIES TYPE OPTIONAL) +set_package_properties(Baz PROPERTIES TYPE REQUIRED) + +feature_summary(WHAT ALL) + +feature_summary(WHAT RUNTIME_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT RUNTIME_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT OPTIONAL_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT REQUIRED_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) +feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY) + +feature_summary(WHAT RUNTIME_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "RUNTIME pkgs found\n") +feature_summary(WHAT RUNTIME_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "RUNTIME pkgs not found\n") +feature_summary(WHAT OPTIONAL_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "OPTIONAL pkgs found\n") +feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "OPTIONAL pkgs not found\n") +feature_summary(WHAT REQUIRED_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "REQUIRED pkgs found\n") +feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DESCRIPTION "REQUIRED pkgs not found\n") + +feature_summary(WHAT RUNTIME_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT RUNTIME_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT OPTIONAL_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT REQUIRED_PACKAGES_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) +feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + QUIET_ON_EMPTY + DEFAULT_DESCRIPTION) diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake index 9caee4c..c672c16 100644 --- a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake +++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake @@ -14,8 +14,10 @@ run_cmake(FeatureSummaryFatalOnMissingRequiredPackages) run_cmake(FeatureSummaryIncludeQuietPackages) run_cmake(FeatureSummaryQuietOnEmpty) run_cmake(FeatureSummaryMultipleDepends) +run_cmake(FeatureSummaryDefaultDescription) run_cmake(FeatureSummaryCustomTypes) run_cmake(FeatureSummaryCustomBadDefault) run_cmake(FeatureSummaryCustomRequired) run_cmake(FeatureSummaryCustomRequiredListA) run_cmake(FeatureSummaryCustomRequiredListB) +run_cmake(FeatureSummaryCustomDescription) diff --git a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt index 0abb7df..a242180 100644 --- a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt +++ b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt @@ -1,5 +1,6 @@ CMake Error in CMakeLists.txt: - Evaluation file to be written multiple times for different configurations - or languages with different content: + Evaluation file to be written multiple times with different content. This + is generally caused by the content evaluating the configuration type, + language, or location of object files: .*output.txt diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt index d3aa973..b08ef5a 100644 --- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt @@ -1,9 +1,8 @@ -CMake Error at OutputNameMatchesObjects.cmake:2 \(file\): +CMake Error at OutputNameMatchesObjects.cmake:[0-9]+ \(file\): Error evaluating generator expression: \$<TARGET_OBJECTS:foo> - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. + Objects of target "foo" referenced but is not an OBJECT library. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake index d807450..daa7c49 100644 --- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake @@ -1,3 +1,4 @@ +enable_language(CXX) file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<BOOL:$<TARGET_OBJECTS:foo>>somefile.cpp" diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index db344ef..82e903d 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -1,7 +1,7 @@ include(RunCMake) run_cmake(CommandConflict) -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio|Xcode" AND NOT XCODE_BELOW_2) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio|Xcode") run_cmake(OutputConflict) endif() run_cmake(EmptyCondition1) diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake index 4a41533..2687efe 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake @@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME endif() else() # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties + get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) - if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake index b66d02f..74cda25 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake @@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME endif() else() # not debian, check the FIND_LIBRARY_USE_LIB64_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties + get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) - if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake index bdecb8a..1defde8 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake @@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME endif() else() # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS propertie + get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) - if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake index df67235..166a617 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake @@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME endif() else() # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties + get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) - if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake index 1351b6f..e4673b3 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake @@ -30,9 +30,12 @@ if(NOT DEFINED CMAKE_SYSTEM_NAME endif() else() # not debian, check the FIND_LIBRARY_USE_LIB64_PATHS and FIND_LIBRARY_USE_LIB32_PATHS properties + get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) - if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat index f2f86b0..b038370 100755 --- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat @@ -1,7 +1,11 @@ @ECHO OFF + +:LOOP + IF "%1"=="" ( EXIT /B 255 ) + IF "%1"=="--version" ( ECHO 0.0-cmake-dummy EXIT /B 0 @@ -13,6 +17,11 @@ IF "%1"=="--exists" ( ECHO Found: %PKG_CONFIG_PATH% IF NOT "%*"=="%PKG_CONFIG_PATH%" ( EXIT /B 1 + ) ELSE ( + EXIT /B 0 ) ) -EXIT /B 0 +SHIFT +IF NOT "%~1"=="" GOTO LOOP + +EXIT /B 255 diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh index abe14bf..56bba30 100755 --- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh @@ -4,18 +4,20 @@ # to the --exists argument with the PKG_CONFIG_PATH environment variable # and returns 1 if they are different. -case $1 in - --version) - echo "0.0-cmake-dummy" - ;; - --exists) - shift - eval last=\${$#} - echo "Expected: ${last}" - echo "Found: ${PKG_CONFIG_PATH}" - [ "${last}" = "${PKG_CONFIG_PATH}" ] || exit 1 - ;; - *) - exit 255 - ;; -esac +while [ $# -gt 0 ]; do + case $1 in + --version) + echo "0.0-cmake-dummy" + exit 0 + ;; + --exists) + shift + eval last=\${$#} + echo "Expected: ${last}" + echo "Found: ${PKG_CONFIG_PATH}" + [ "${last}" = "${PKG_CONFIG_PATH}" ] && exit 0 || exit 1 + ;; + esac + shift +done +exit 255 diff --git a/Tests/RunCMake/FindPkgConfig/pc-bar/libx32/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-bar/libx32/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-bar/libx32/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-foo/libx32/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-foo/libx32/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-foo/libx32/pkgconfig/.placeholder diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake index ae32134..3d62a8a 100644 --- a/Tests/RunCMake/Framework/FrameworkLayout.cmake +++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake @@ -1,14 +1,25 @@ cmake_minimum_required(VERSION 3.4) enable_language(C) +set(CMAKE_CONFIGURATION_TYPES "Debug" CACHE INTERNAL "Supported configuration types") +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) # get rid of ${EFFECTIVE_PLATFORM_NAME} + add_library(Framework ${FRAMEWORK_TYPE} foo.c foo.h - res.txt) + res.txt + flatresource.txt + deepresource.txt + some.txt) set_target_properties(Framework PROPERTIES FRAMEWORK TRUE PUBLIC_HEADER foo.h RESOURCE "res.txt") +set_source_files_properties(flatresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources) +set_source_files_properties(deepresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources/deep) +set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir) add_custom_command(TARGET Framework POST_BUILD COMMAND /usr/bin/file $<TARGET_FILE:Framework>) + +file(GENERATE OUTPUT FrameworkName.cmake CONTENT "set(framework-dir \"$<TARGET_BUNDLE_DIR:Framework>\")\n") diff --git a/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt index 8d90f5f..f664db9 100644 --- a/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt +++ b/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt @@ -1 +1,3 @@ -.*/Framework: Mach-O[^\n]* dynamically linked shared library.* +.*/Framework:( Mach-O universal binary with [^ +]*)? Mach-O[^ +]* dynamically linked shared library.* diff --git a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt index c9f50b6..532cfed 100644 --- a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt +++ b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt @@ -1 +1,2 @@ -.*/Framework: current ar archive random library.* +.*/Framework:( Mach-O universal binary with [^ +]*)? current ar archive random library.* diff --git a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake index da1ccb4..eb71394 100644 --- a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake +++ b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake @@ -1,8 +1,11 @@ -set(framework-dir "${RunCMake_TEST_BINARY_DIR}/Framework.framework") +include("${RunCMake_TEST_BINARY_DIR}/FrameworkName.cmake") set(framework-resources "${framework-dir}/Resources") set(framework-resource-file "${framework-resources}/res.txt") +set(framework-flat-resource-file "${framework-resources}/flatresource.txt") +set(framework-deep-resource-file "${framework-resources}/deep/deepresource.txt") set(framework-library "${framework-dir}/Framework") set(framework-versions "${framework-dir}/Versions") +set(framework-some-file "${framework-versions}/Current/somedir/some.txt") set(plist-file "${framework-resources}/Info.plist") set(framework-header "${framework-dir}/Headers/foo.h") @@ -22,6 +25,18 @@ if(NOT EXISTS ${framework-resource-file}) message(SEND_ERROR "Framework resource file not found at ${framework-resource-file}") endif() +if(NOT EXISTS ${framework-flat-resource-file}) + message(SEND_ERROR "Framework flat resource file not found at ${framework-flat-resource-file}") +endif() + +if(NOT EXISTS ${framework-deep-resource-file}) + message(SEND_ERROR "Framework deep resource file not found at ${framework-deep-resource-file}") +endif() + +if(NOT EXISTS ${framework-some-file}) + message(SEND_ERROR "Framework some file not found at ${framework-some-file}") +endif() + if(NOT EXISTS ${framework-versions}) message(SEND_ERROR "Framework versions not found at ${framework-versions}") endif() diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake index e64892d..4fc83f8 100644 --- a/Tests/RunCMake/Framework/RunCMakeTest.cmake +++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake @@ -13,13 +13,10 @@ function(framework_layout_test Name Toolchain Type) run_cmake_command(${Name} ${CMAKE_COMMAND} --build .) endfunction() -# build check cannot cope with multi-configuration generators directory layout -if(NOT RunCMake_GENERATOR STREQUAL "Xcode") - framework_layout_test(iOSFrameworkLayout-build ios SHARED) - framework_layout_test(iOSFrameworkLayout-build ios STATIC) - framework_layout_test(OSXFrameworkLayout-build osx SHARED) - framework_layout_test(OSXFrameworkLayout-build osx STATIC) -endif() +framework_layout_test(iOSFrameworkLayout-build ios SHARED) +framework_layout_test(iOSFrameworkLayout-build ios STATIC) +framework_layout_test(OSXFrameworkLayout-build osx SHARED) +framework_layout_test(OSXFrameworkLayout-build osx STATIC) function(framework_type_test Toolchain Type) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${Toolchain}${Type}FrameworkType-build) diff --git a/Tests/RunCMake/Framework/deepresource.txt b/Tests/RunCMake/Framework/deepresource.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/Framework/deepresource.txt diff --git a/Tests/RunCMake/Framework/flatresource.txt b/Tests/RunCMake/Framework/flatresource.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/Framework/flatresource.txt diff --git a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake index b81a5f7..2da60d2 100644 --- a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake +++ b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake @@ -1,6 +1,9 @@ -set(framework-dir "${RunCMake_TEST_BINARY_DIR}/Framework.framework") +include("${RunCMake_TEST_BINARY_DIR}/FrameworkName.cmake") set(framework-resources "${framework-dir}/Resources") set(framework-resource-file "${framework-dir}/res.txt") +set(framework-flat-resource-file "${framework-dir}/flatresource.txt") +set(framework-deep-resource-file "${framework-dir}/deep/deepresource.txt") +set(framework-some-file "${framework-dir}/somedir/some.txt") set(framework-library "${framework-dir}/Framework") set(framework-versions "${framework-dir}/Versions") set(plist-file "${framework-dir}/Info.plist") @@ -22,6 +25,18 @@ if(NOT EXISTS ${framework-resource-file}) message(SEND_ERROR "Framework resource file not found at ${framework-resource-file}") endif() +if(NOT EXISTS ${framework-flat-resource-file}) + message(SEND_ERROR "Framework flat resource file not found at ${framework-flat-resource-file}") +endif() + +if(NOT EXISTS ${framework-deep-resource-file}) + message(SEND_ERROR "Framework deep resource file not found at ${framework-deep-resource-file}") +endif() + +if(NOT EXISTS ${framework-some-file}) + message(SEND_ERROR "Framework some file not found at ${framework-some-file}") +endif() + if(EXISTS ${framework-versions}) message(SEND_ERROR "Framework versions found at ${framework-versions}") endif() diff --git a/Tests/RunCMake/Framework/some.txt b/Tests/RunCMake/Framework/some.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/Framework/some.txt diff --git a/Tests/RunCMake/GNUInstallDirs/Common.cmake b/Tests/RunCMake/GNUInstallDirs/Common.cmake index eff2d54..5f119af 100644 --- a/Tests/RunCMake/GNUInstallDirs/Common.cmake +++ b/Tests/RunCMake/GNUInstallDirs/Common.cmake @@ -15,6 +15,7 @@ set(dirs LIBEXECDIR LOCALEDIR LOCALSTATEDIR + RUNSTATEDIR MANDIR SBINDIR SHAREDSTATEDIR diff --git a/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt index aee8552..3e18410 100644 --- a/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64)' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='share/man' CMAKE_INSTALL_SBINDIR='sbin' CMAKE_INSTALL_SHAREDSTATEDIR='com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/opt/Opt/(lib|lib64)' CMAKE_INSTALL_FULL_LIBEXECDIR='/opt/Opt/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/opt/Opt/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var/opt/Opt' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run/opt/Opt' CMAKE_INSTALL_FULL_MANDIR='/opt/Opt/share/man' CMAKE_INSTALL_FULL_SBINDIR='/opt/Opt/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/opt/Opt/com' diff --git a/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt index a95400e..8c13368 100644 --- a/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='usr/(lib|lib64)' CMAKE_INSTALL_LIBEXECDIR='usr/libexec' CMAKE_INSTALL_LOCALEDIR='usr/share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='usr/share/man' CMAKE_INSTALL_SBINDIR='usr/sbin' CMAKE_INSTALL_SHAREDSTATEDIR='usr/com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64)' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' CMAKE_INSTALL_FULL_MANDIR='/usr/share/man' CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com' diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt index e10c4c5..a591436 100644 --- a/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64|lib/arch)' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='share/man' CMAKE_INSTALL_SBINDIR='sbin' CMAKE_INSTALL_SHAREDSTATEDIR='com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64|lib/arch)' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' CMAKE_INSTALL_FULL_MANDIR='/usr/share/man' CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com' diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt index 8dcf25b..f957e0e 100644 --- a/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64)' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='share/man' CMAKE_INSTALL_SBINDIR='sbin' CMAKE_INSTALL_SHAREDSTATEDIR='com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/local/(lib|lib64)' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/usr/local/var/run' CMAKE_INSTALL_FULL_MANDIR='/usr/local/share/man' CMAKE_INSTALL_FULL_SBINDIR='/usr/local/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/local/com' diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake index cddba29..e0677a7 100644 --- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake +++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake @@ -110,7 +110,7 @@ if (WIN32 OR CYGWIN) else() set(_platform WinEmpty) endif() -elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY) +elseif(COMPILER_HAS_HIDDEN_VISIBILITY) set(_platform UNIX) elseif(COMPILER_HAS_DEPRECATED) set(_platform UNIX_DeprecatedOnly) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt new file mode 100644 index 0000000..854447f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake:[0-9]* \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_CONTENT_DIR:empty> + + TARGET_BUNDLE_CONTENT_DIR not allowed for IMPORTED targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake new file mode 100644 index 0000000..ac2d3ce --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake @@ -0,0 +1,2 @@ +add_library(empty UNKNOWN IMPORTED) +add_custom_target(custom COMMAND echo $<TARGET_BUNDLE_CONTENT_DIR:empty>) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt new file mode 100644 index 0000000..9b97df1 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at ImportedTarget-TARGET_BUNDLE_DIR.cmake:[0-9]* \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_DIR:empty> + + TARGET_BUNDLE_DIR not allowed for IMPORTED targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake new file mode 100644 index 0000000..17c8128 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake @@ -0,0 +1,2 @@ +add_library(empty UNKNOWN IMPORTED) +add_custom_target(custom COMMAND echo $<TARGET_BUNDLE_DIR:empty>) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt new file mode 100644 index 0000000..03c02d9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake:[0-9]* \(file\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_CONTENT_DIR:empty> + + TARGET_BUNDLE_CONTENT_DIR is allowed only for Bundle targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake new file mode 100644 index 0000000..63b3b1b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake @@ -0,0 +1,9 @@ + +enable_language(C) + +add_library(empty STATIC empty.c) + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt" + CONTENT "[$<TARGET_BUNDLE_CONTENT_DIR:empty>]" +) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt new file mode 100644 index 0000000..f895c88 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NonValidTarget-TARGET_BUNDLE_DIR.cmake:[0-9]* \(file\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_DIR:empty> + + TARGET_BUNDLE_DIR is allowed only for Bundle targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake new file mode 100644 index 0000000..19f333a --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake @@ -0,0 +1,9 @@ + +enable_language(C) + +add_library(empty STATIC empty.c) + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt" + CONTENT "[$<TARGET_BUNDLE_DIR:empty>]" +) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 084b5c3..63cd2da 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -17,6 +17,8 @@ run_cmake(NonValidTarget-C_COMPILER_ID) run_cmake(NonValidTarget-CXX_COMPILER_ID) run_cmake(NonValidTarget-C_COMPILER_VERSION) run_cmake(NonValidTarget-CXX_COMPILER_VERSION) +run_cmake(NonValidTarget-TARGET_BUNDLE_DIR) +run_cmake(NonValidTarget-TARGET_BUNDLE_CONTENT_DIR) run_cmake(NonValidTarget-TARGET_PROPERTY) run_cmake(NonValidTarget-TARGET_POLICY) run_cmake(COMPILE_LANGUAGE-add_custom_target) @@ -32,6 +34,8 @@ run_cmake(OUTPUT_NAME-recursion) run_cmake(TARGET_PROPERTY-LOCATION) run_cmake(LINK_ONLY-not-linking) +run_cmake(ImportedTarget-TARGET_BUNDLE_DIR) +run_cmake(ImportedTarget-TARGET_BUNDLE_CONTENT_DIR) run_cmake(ImportedTarget-TARGET_PDB_FILE) if(LINKER_SUPPORTS_PDB) run_cmake(NonValidTarget-TARGET_PDB_FILE) diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetFormat-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetFormat-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetFormat-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetFormat-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetFormat-stderr.txt new file mode 100644 index 0000000..ab3a98f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetFormat-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + .* + + given toolset specification + + Test Toolset,not_a_key + + that contains a field after the first ',' with no '='\.$ diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetFormat.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetFormat.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetFormat.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArch-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArch-stderr.txt index 5737e95..bd0063a 100644 --- a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArch-stderr.txt +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArch-stderr.txt @@ -3,8 +3,8 @@ CMake Error at CMakeLists.txt:[0-9]+ \(project\): .* - does not recognize the toolset + given toolset specification Test Toolset,host=x6[45] - that was specified\.$ + that contains invalid field 'host=x6[45]'\.$ diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt new file mode 100644 index 0000000..164d3aa --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + .* + + given toolset specification + + Test Toolset,host=x64,host=x64 + + that contains duplicate field key 'host'\.$ diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode-stderr.txt new file mode 100644 index 0000000..5737e95 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + .* + + does not recognize the toolset + + Test Toolset,host=x6[45] + + that was specified\.$ diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchXcode.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake index e8ce47d..f89100e 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -3,9 +3,15 @@ include(RunCMake) set(RunCMake_GENERATOR_TOOLSET "") run_cmake(NoToolset) -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]|Xcode" AND NOT XCODE_BELOW_3) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset") run_cmake(TestToolset) + set(RunCMake_GENERATOR_TOOLSET "Test Toolset,cuda=Test Cuda") + run_cmake(TestToolsetCudaBoth) + set(RunCMake_GENERATOR_TOOLSET ",cuda=Test Cuda") + run_cmake(TestToolsetCudaOnly) + set(RunCMake_GENERATOR_TOOLSET "cuda=Test Cuda") + run_cmake(TestToolsetCudaOnly) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[245]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64") run_cmake(TestToolsetHostArchBoth) @@ -17,10 +23,19 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]|Xcode" AND NOT XCODE_ run_cmake(TestToolsetHostArchNone) set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x65") run_cmake(BadToolsetHostArch) + set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x64") + run_cmake(BadToolsetHostArchTwice) else() set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64") run_cmake(BadToolsetHostArch) endif() + set(RunCMake_GENERATOR_TOOLSET "Test Toolset,not_a_key") + run_cmake(BadToolsetFormat) +elseif("${RunCMake_GENERATOR}" STREQUAL "Xcode") + set(RunCMake_GENERATOR_TOOLSET "Test Toolset") + run_cmake(TestToolset) + set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64") + run_cmake(BadToolsetHostArchXcode) else() set(RunCMake_GENERATOR_TOOLSET "Bad Toolset") run_cmake(BadToolset) @@ -32,7 +47,7 @@ set(RunCMake_TEST_OPTIONS -T "Extra Toolset") run_cmake(TwoToolsets) unset(RunCMake_TEST_OPTIONS) -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]|Xcode" AND NOT XCODE_BELOW_3) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]|Xcode") set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestToolset-toolchain.cmake) run_cmake(TestToolsetToolchain) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt new file mode 100644 index 0000000..90503e2 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset' +-- CMAKE_VS_PLATFORM_TOOLSET_CUDA='Test Cuda' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth.cmake new file mode 100644 index 0000000..befa0af --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth.cmake @@ -0,0 +1,2 @@ +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_CUDA='${CMAKE_VS_PLATFORM_TOOLSET_CUDA}'") diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt new file mode 100644 index 0000000..94e1e43 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_VS_PLATFORM_TOOLSET='(v[0-9]+|Windows7.1SDK)' +-- CMAKE_VS_PLATFORM_TOOLSET_CUDA='Test Cuda' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake new file mode 100644 index 0000000..befa0af --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake @@ -0,0 +1,2 @@ +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_CUDA='${CMAKE_VS_PLATFORM_TOOLSET_CUDA}'") diff --git a/Tests/RunCMake/Ninja/AssumedSources.cmake b/Tests/RunCMake/Ninja/AssumedSources.cmake new file mode 100644 index 0000000..5fb0219 --- /dev/null +++ b/Tests/RunCMake/Ninja/AssumedSources.cmake @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(AssumedSources) + +set_source_files_properties( + "${CMAKE_CURRENT_BINARY_DIR}/target.c" + "${CMAKE_CURRENT_BINARY_DIR}/target-no-depends.c" + PROPERTIES GENERATED 1) + +add_executable(working + "${CMAKE_CURRENT_BINARY_DIR}/target.c" + "${CMAKE_CURRENT_BINARY_DIR}/target-no-depends.c") + +add_custom_target( + gen-target.c ALL + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/dep.c" "${CMAKE_CURRENT_BINARY_DIR}/target.c") +add_custom_target( + gen-target-no-depends.c ALL + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/dep.c" "${CMAKE_CURRENT_BINARY_DIR}/target-no-depends.c") + +add_dependencies(working gen-target.c) diff --git a/Tests/RunCMake/Ninja/CommandConcat.cmake b/Tests/RunCMake/Ninja/CommandConcat.cmake new file mode 100644 index 0000000..790cf9d --- /dev/null +++ b/Tests/RunCMake/Ninja/CommandConcat.cmake @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.7) +project(concat_cmd NONE) +set(output1 ${CMAKE_BINARY_DIR}/out1.txt) +set(output2 ${CMAKE_BINARY_DIR}/out2.txt) +file(REMOVE ${output1} ${output2}) +# Check that second command runs if first command contains "||" which has higher precedence than "&&" on Windows +add_custom_target(concat_cmd ALL + COMMAND ${CMAKE_COMMAND} -E echo "Hello || pipe world" && ${CMAKE_COMMAND} -E touch ${output1} || exit 1 + COMMAND ${CMAKE_COMMAND} -E touch ${output2}) +# Check output +add_custom_target(check_output ALL + COMMAND ${CMAKE_COMMAND} -E copy ${output1} ${output1}.copy + COMMAND ${CMAKE_COMMAND} -E copy ${output2} ${output2}.copy) +add_dependencies(check_output concat_cmd) diff --git a/Tests/RunCMake/Ninja/LooseObjectDepends.cmake b/Tests/RunCMake/Ninja/LooseObjectDepends.cmake new file mode 100644 index 0000000..360c7ba --- /dev/null +++ b/Tests/RunCMake/Ninja/LooseObjectDepends.cmake @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.8) +project(LooseObjectDepends C) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/command.h" + COMMAND "${CMAKE_COMMAND}" -E touch + "${CMAKE_CURRENT_BINARY_DIR}/command.h" + COMMENT "Creating command.h") +add_custom_target(create-command.h + DEPENDS + "${CMAKE_CURRENT_BINARY_DIR}/command.h") + +add_custom_target(create-target.h + BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/target.h" + COMMAND "${CMAKE_COMMAND}" -E touch + "${CMAKE_CURRENT_BINARY_DIR}/target.h" + COMMENT "Creating target.h") + +add_library(dep SHARED dep.c) +add_dependencies(dep create-command.h create-target.h) +target_include_directories(dep + PUBLIC + "${CMAKE_CURRENT_BINARY_DIR}") + +add_library(top top.c) +target_link_libraries(top PRIVATE dep) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 7b4e51e..b3720fb 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -40,6 +40,16 @@ run_CMP0058(NEW-by) run_cmake(CustomCommandDepfile) +function(run_CommandConcat) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommandConcat-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(CommandConcat) + run_cmake_command(CommandConcat-build ${CMAKE_COMMAND} --build .) +endfunction() +run_CommandConcat() + function(run_SubDir) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build) @@ -73,7 +83,7 @@ run_SubDir() function(run_ninja dir) execute_process( - COMMAND "${RunCMake_MAKE_PROGRAM}" + COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN} WORKING_DIRECTORY "${dir}" OUTPUT_VARIABLE ninja_stdout ERROR_VARIABLE ninja_stderr @@ -95,6 +105,39 @@ ${ninja_stderr} endif() endfunction(run_ninja) +function (run_LooseObjectDepends) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/LooseObjectDepends-build) + run_cmake(LooseObjectDepends) + run_ninja("${RunCMake_TEST_BINARY_DIR}" "CMakeFiles/top.dir/top.c${CMAKE_C_OUTPUT_EXTENSION}") + if (EXISTS "${RunCMake_TEST_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}dep${CMAKE_SHARED_LIBRARY_SUFFIX}") + message(FATAL_ERROR + "The `dep` library was created when requesting an object file to be " + "built; this should no longer be necessary.") + endif () + if (EXISTS "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/dep.dir/dep.c${CMAKE_C_OUTPUT_EXTENSION}") + message(FATAL_ERROR + "The `dep.c` object file was created when requesting an object file to " + "be built; this should no longer be necessary.") + endif () +endfunction () +run_LooseObjectDepends() + +function (run_AssumedSources) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AssumedSources-build) + run_cmake(AssumedSources) + run_ninja("${RunCMake_TEST_BINARY_DIR}" "target.c") + if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/target.c") + message(FATAL_ERROR + "Dependencies for an assumed source did not hook up properly for 'target.c'.") + endif () + run_ninja("${RunCMake_TEST_BINARY_DIR}" "target-no-depends.c") + if (EXISTS "${RunCMake_TEST_BINARY_DIR}/target-no-depends.c") + message(FATAL_ERROR + "Dependencies for an assumed source were magically hooked up for 'target-no-depends.c'.") + endif () +endfunction () +run_AssumedSources() + function(sleep delay) execute_process( COMMAND ${CMAKE_COMMAND} -E sleep ${delay} diff --git a/Tests/RunCMake/Ninja/dep.c b/Tests/RunCMake/Ninja/dep.c new file mode 100644 index 0000000..728f031 --- /dev/null +++ b/Tests/RunCMake/Ninja/dep.c @@ -0,0 +1,4 @@ +int dep() +{ + return 0; +} diff --git a/Tests/RunCMake/Ninja/top.c b/Tests/RunCMake/Ninja/top.c new file mode 100644 index 0000000..4a88eb2 --- /dev/null +++ b/Tests/RunCMake/Ninja/top.c @@ -0,0 +1,7 @@ +#include "command.h" +#include "target.h" + +int top() +{ + return 0; +} diff --git a/Tests/RunCMake/ObjectLibrary/Dependencies.cmake b/Tests/RunCMake/ObjectLibrary/Dependencies.cmake new file mode 100644 index 0000000..6ddf545 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/Dependencies.cmake @@ -0,0 +1,7 @@ +add_library(myobj OBJECT ${CMAKE_BINARY_DIR}/depends_obj.c) +add_library(mylib STATIC $<TARGET_OBJECTS:myobj> depends_lib.c) +add_executable(myexe depends_main.c) +target_link_libraries(myexe mylib) + +enable_testing() +add_test(NAME myexe COMMAND $<TARGET_FILE:myexe>) diff --git a/Tests/RunCMake/ObjectLibrary/Export-stderr.txt b/Tests/RunCMake/ObjectLibrary/Export-stderr.txt deleted file mode 100644 index bdadca4..0000000 --- a/Tests/RunCMake/ObjectLibrary/Export-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at Export.cmake:2 \(export\): - export given OBJECT library "A" which may not be exported. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt new file mode 100644 index 0000000..5420159 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at ExportNotSupported.cmake:[0-9]+ \(export\): + export given OBJECT library "A" which may not be exported under Xcode with + multiple architectures. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake new file mode 100644 index 0000000..a3f104e --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake @@ -0,0 +1,2 @@ +add_library(A OBJECT a.c) +export(TARGETS A FILE AExport.cmake) diff --git a/Tests/RunCMake/ObjectLibrary/Import.cmake b/Tests/RunCMake/ObjectLibrary/Import.cmake index 806b44a..42f4468 100644 --- a/Tests/RunCMake/ObjectLibrary/Import.cmake +++ b/Tests/RunCMake/ObjectLibrary/Import.cmake @@ -1 +1,12 @@ + add_library(A OBJECT IMPORTED) + +# We don't actually build this example so just configure dummy +# object files to test. They do not have to exist. +set_property(TARGET A APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(A PROPERTIES + IMPORTED_OBJECTS_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o" + IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o" + ) + +add_library(B $<TARGET_OBJECTS:A> b.c) diff --git a/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ObjectLibrary/Import-stderr.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt index 74b496a..0fadac2 100644 --- a/Tests/RunCMake/ObjectLibrary/Import-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt @@ -1,4 +1,5 @@ -CMake Error at Import.cmake:1 \(add_library\): - The OBJECT library type may not be used for IMPORTED libraries. +CMake Error at ImportNotSupported.cmake:[0-9]+ \(add_library\): + The OBJECT library type may not be used for IMPORTED libraries under Xcode + with multiple architectures. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake new file mode 100644 index 0000000..806b44a --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake @@ -0,0 +1 @@ +add_library(A OBJECT IMPORTED) diff --git a/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ObjectLibrary/Install-stderr.txt b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt index d2f9f4a..35a0e4f 100644 --- a/Tests/RunCMake/ObjectLibrary/Install-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt @@ -1,4 +1,5 @@ -CMake Error at Install.cmake:2 \(install\): - install TARGETS given OBJECT library "A" which may not be installed. +CMake Error at InstallNotSupported.cmake:[0-9]+ \(install\): + install TARGETS given OBJECT library "A" which may not be installed under + Xcode with multiple architectures. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake new file mode 100644 index 0000000..c1d214b --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake @@ -0,0 +1,2 @@ +add_library(A OBJECT a.c) +install(TARGETS A DESTINATION lib) diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake index 42973f8..fe708ce 100644 --- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake +++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake @@ -5,9 +5,15 @@ run_cmake(BadSourceExpression2) run_cmake(BadSourceExpression3) run_cmake(BadObjSource1) run_cmake(BadObjSource2) -run_cmake(Export) -run_cmake(Import) -run_cmake(Install) +if(RunCMake_GENERATOR STREQUAL "Xcode" AND "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") + run_cmake(ExportNotSupported) + run_cmake(ImportNotSupported) + run_cmake(InstallNotSupported) +else() + run_cmake(Export) + run_cmake(Import) + run_cmake(Install) +endif() run_cmake(LinkObjLHS) run_cmake(LinkObjRHS1) run_cmake(LinkObjRHS2) @@ -16,3 +22,28 @@ run_cmake(ObjWithObj) run_cmake(PostBuild) run_cmake(PreBuild) run_cmake(PreLink) + +function(run_Dependencies) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Dependencies-build) + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + if(RunCMake_GENERATOR STREQUAL "Borland Makefiles" OR + RunCMake_GENERATOR STREQUAL "Watcom WMake") + set(fs_delay 3) + else() + set(fs_delay 1.125) + endif() + + run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj1.c ${RunCMake_TEST_BINARY_DIR}/depends_obj.c) + run_cmake(Dependencies) + run_cmake_command(Dependencies-build ${CMAKE_COMMAND} --build . --config Debug) + run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E sleep ${fs_delay}) + run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj0.c ${RunCMake_TEST_BINARY_DIR}/depends_obj.c) + run_cmake_command(Dependencies-build ${CMAKE_COMMAND} --build . --config Debug) + run_cmake_command(Dependencies-build ${CMAKE_CTEST_COMMAND} -C Debug -V) +endfunction() + +run_Dependencies() diff --git a/Tests/RunCMake/ObjectLibrary/b.c b/Tests/RunCMake/ObjectLibrary/b.c new file mode 100644 index 0000000..6751907 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/b.c @@ -0,0 +1,4 @@ +int b(void) +{ + return 0; +} diff --git a/Tests/RunCMake/ObjectLibrary/depends_lib.c b/Tests/RunCMake/ObjectLibrary/depends_lib.c new file mode 100644 index 0000000..a41b32c --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/depends_lib.c @@ -0,0 +1,7 @@ +#include <stdlib.h> +extern int myobj_foo(void); + +void mylib_foo(void) +{ + exit(myobj_foo()); +} diff --git a/Tests/RunCMake/ObjectLibrary/depends_main.c b/Tests/RunCMake/ObjectLibrary/depends_main.c new file mode 100644 index 0000000..acc66c7 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/depends_main.c @@ -0,0 +1,7 @@ +extern void mylib_foo(void); + +int main(void) +{ + mylib_foo(); + return 0; +} diff --git a/Tests/RunCMake/ObjectLibrary/depends_obj0.c b/Tests/RunCMake/ObjectLibrary/depends_obj0.c new file mode 100644 index 0000000..649d507 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/depends_obj0.c @@ -0,0 +1,4 @@ +int myobj_foo(void) +{ + return 0; +} diff --git a/Tests/RunCMake/ObjectLibrary/depends_obj1.c b/Tests/RunCMake/ObjectLibrary/depends_obj1.c new file mode 100644 index 0000000..e1f9f6a --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/depends_obj1.c @@ -0,0 +1,4 @@ +int myobj_foo(void) +{ + return 1; +} diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 5f66da0..26312c4 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -51,8 +51,8 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() - if(RunCMake_GENERATOR STREQUAL "Visual Studio 7 .NET 2003" AND NOT RunCMake_WARN_VS71) - list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS71=OFF) + if(RunCMake_GENERATOR MATCHES "^Visual Studio 8 2005" AND NOT RunCMake_WARN_VS8) + list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS8=OFF) endif() if(RunCMake_MAKE_PROGRAM) list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") @@ -101,7 +101,7 @@ function(run_cmake test) endif() foreach(o out err) string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}") - string(REGEX REPLACE "(^|\n)((==[0-9]+==|BullseyeCoverage|[a-z]+\\([0-9]+\\) malloc:|Error kstat returned|[^\n]*is a member of multiple groups|[^\n]*from Time Machine by path|[^\n]*Bullseye Testing Technology)[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}") + string(REGEX REPLACE "(^|\n)((==[0-9]+==|BullseyeCoverage|[a-z]+\\([0-9]+\\) malloc:|Error kstat returned|Hit xcodebuild bug|[^\n]*is a member of multiple groups|[^\n]*from Time Machine by path|[^\n]*Bullseye Testing Technology)[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}") string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}") set(expect_${o} "") if(DEFINED expect_std${o}) diff --git a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt deleted file mode 100644 index b78189e..0000000 --- a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt +++ /dev/null @@ -1,27 +0,0 @@ -(CMake Error at BadContext.cmake:4 \(file\): - Error evaluating generator expression: - - \$<TARGET_OBJECTS:NoTarget> - - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -*)+ -(CMake Error at BadContext.cmake:5 \(file\): - Error evaluating generator expression: - - \$<TARGET_OBJECTS:NoTarget> - - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -*)+ -CMake Error: - Error evaluating generator expression: - - \$<TARGET_OBJECTS:NoTarget> - - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. diff --git a/Tests/RunCMake/TargetObjects/NoTarget-result.txt b/Tests/RunCMake/TargetObjects/NoTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NoTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt new file mode 100644 index 0000000..eadccaf --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt @@ -0,0 +1,24 @@ +(CMake Error at NoTarget.cmake:4 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +*)+ +(CMake Error at NoTarget.cmake:5 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +*)+ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. diff --git a/Tests/RunCMake/TargetObjects/BadContext.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake index 5d7e33e..5d7e33e 100644 --- a/Tests/RunCMake/TargetObjects/BadContext.cmake +++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt new file mode 100644 index 0000000..a66794c --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NotObjlibTarget.cmake:3 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:StaticLib> + + Objects of target "StaticLib" referenced but is not an OBJECT library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake new file mode 100644 index 0000000..8e5fdd0 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake @@ -0,0 +1,3 @@ +add_library(StaticLib empty.cpp) + +file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:StaticLib>) diff --git a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake index 85c76e2..30b9fee 100644 --- a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) -run_cmake(BadContext) +run_cmake(NoTarget) +run_cmake(NotObjlibTarget) diff --git a/Tests/RunCMake/TargetObjects/empty.cpp b/Tests/RunCMake/TargetObjects/empty.cpp new file mode 100644 index 0000000..4086dcc --- /dev/null +++ b/Tests/RunCMake/TargetObjects/empty.cpp @@ -0,0 +1,4 @@ +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 57047fb..5f6be87 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -20,6 +20,8 @@ \* CMP0060 \* CMP0063 \* CMP0065 + \* CMP0068 + \* CMP0069 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt new file mode 100644 index 0000000..d7ccedb --- /dev/null +++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0026-LOCATION.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0026 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake index 4416ef9..bb55a6e 100644 --- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake @@ -1,6 +1,6 @@ include(RunCMake) -if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode" AND NOT XCODE_BELOW_2) +if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode") run_cmake(ConfigNotAllowed) run_cmake(OriginDebugIDE) else() diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake index 4ec3e3b..3a04db4 100644 --- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake +++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake @@ -12,6 +12,6 @@ run_cmake(StartupProject) run_cmake(StartupProjectMissing) run_cmake(AddPackageToDefault) -if(RunCMake_GENERATOR MATCHES "Visual Studio ([^7]|[7][0-9])" AND NOT NO_USE_FOLDERS) +if(NOT NO_USE_FOLDERS) run_cmake(StartupProjectUseFolders) endif() diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index f51a107..5f4bdc3 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -187,3 +187,19 @@ if(NOT XCODE_VERSION VERSION_LESS 5) unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_OPTIONS) endif() + +function(XcodeSchemaGeneration) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeSchemaGeneration) + run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build) +endfunction() + +if(NOT XCODE_VERSION VERSION_LESS 7) + XcodeSchemaGeneration() +endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake index 833eb85..0b854d8 100644 --- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake @@ -58,6 +58,10 @@ if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(SharedFrameworkTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:SharedFramework>" "$<TARGET_BUNDLE_DIR:SharedFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:SharedFramework>" "$<TARGET_BUNDLE_CONTENT_DIR:SharedFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:SharedFramework>" "$<TARGET_FILE:SharedFramework>.old") add_dependencies(SharedFrameworkTest SharedFramework) @@ -71,6 +75,10 @@ if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(SharedFrameworkExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:SharedFrameworkExt>" "$<TARGET_BUNDLE_DIR:SharedFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:SharedFrameworkExt>" "$<TARGET_BUNDLE_CONTENT_DIR:SharedFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:SharedFrameworkExt>" "$<TARGET_FILE:SharedFrameworkExt>.old") add_dependencies(SharedFrameworkExtTest SharedFrameworkExt) @@ -84,6 +92,10 @@ if(NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(StaticFrameworkTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:StaticFramework>" "$<TARGET_BUNDLE_DIR:StaticFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:StaticFramework>" "$<TARGET_BUNDLE_CONTENT_DIR:StaticFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:StaticFramework>" "$<TARGET_FILE:StaticFramework>.old") add_dependencies(StaticFrameworkTest StaticFramework) @@ -97,6 +109,10 @@ if(NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(StaticFrameworkExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:StaticFrameworkExt>" "$<TARGET_BUNDLE_DIR:StaticFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:StaticFrameworkExt>" "$<TARGET_BUNDLE_CONTENT_DIR:StaticFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:StaticFrameworkExt>" "$<TARGET_FILE:StaticFrameworkExt>.old") add_dependencies(StaticFrameworkExtTest StaticFrameworkExt) @@ -110,6 +126,10 @@ if(NOT CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE) add_custom_target(BundleTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:Bundle>" "$<TARGET_BUNDLE_DIR:Bundle>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:Bundle>" "$<TARGET_BUNDLE_CONTENT_DIR:Bundle>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:Bundle>" "$<TARGET_FILE:Bundle>.old") add_dependencies(BundleTest Bundle) @@ -123,6 +143,10 @@ if(NOT CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE) add_custom_target(BundleExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:BundleExt>" "$<TARGET_BUNDLE_DIR:BundleExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:BundleExt>" "$<TARGET_BUNDLE_CONTENT_DIR:BundleExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:BundleExt>" "$<TARGET_FILE:BundleExt>.old") add_dependencies(BundleExtTest BundleExt) diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake new file mode 100644 index 0000000..2fe5a9f --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.7) + +project(XcodeSchemaGeneration CXX) + +add_executable(foo main.cpp) diff --git a/Tests/RunCMake/ctest_disabled_test/CMakeLists.txt.in b/Tests/RunCMake/ctest_disabled_test/CMakeLists.txt.in new file mode 100644 index 0000000..d34fcac --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/CMakeLists.txt.in @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.7) +project(@CASE_NAME@ NONE) +include(CTest) + +add_test(NAME SuccessfulTest COMMAND "${CMAKE_COMMAND}" --version) +@CASE_CMAKELISTS_SUFFIX_CODE@ diff --git a/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in new file mode 100644 index 0000000..c0d7e42 --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in @@ -0,0 +1 @@ +set(CTEST_PROJECT_NAME "@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_disabled_test/DisableAllTests-result.txt b/Tests/RunCMake/ctest_disabled_test/DisableAllTests-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableAllTests-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_disabled_test/DisableAllTests-stderr.txt b/Tests/RunCMake/ctest_disabled_test/DisableAllTests-stderr.txt new file mode 100644 index 0000000..eafba1c --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableAllTests-stderr.txt @@ -0,0 +1 @@ +No tests were found!!! diff --git a/Tests/RunCMake/ctest_disabled_test/DisableAllTests-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisableAllTests-stdout.txt new file mode 100644 index 0000000..6c824f6 --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableAllTests-stdout.txt @@ -0,0 +1,2 @@ + Start 1: SuccessfulTest +1/1 Test #1: SuccessfulTest ...................\*\*\*\Not Run \(Disabled\) +[0-9.]+ sec diff --git a/Tests/RunCMake/ctest_disabled_test/DisableCleanupTest-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisableCleanupTest-stdout.txt new file mode 100644 index 0000000..9449e65 --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableCleanupTest-stdout.txt @@ -0,0 +1,11 @@ + Start 1: SuccessfulTest +1/2 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: CleanupTest +2/2 Test #2: CleanupTest ......................\*\*\*\Not Run \(Disabled\) +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- CleanupTest \(Disabled\) diff --git a/Tests/RunCMake/ctest_disabled_test/DisableFailingTest-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisableFailingTest-stdout.txt new file mode 100644 index 0000000..486722e --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableFailingTest-stdout.txt @@ -0,0 +1,9 @@ +50% tests passed, 1 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*3 \- DisabledFailingTest \(Disabled\) ++ +The following tests FAILED: +.*2 \- FailingTest \(Failed\) diff --git a/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-result.txt b/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-stderr.txt b/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-stderr.txt new file mode 100644 index 0000000..83c332b --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-stderr.txt @@ -0,0 +1 @@ +Unable to find executable: invalidCommand diff --git a/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-stdout.txt new file mode 100644 index 0000000..9078aeb --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableNotRunTest-stdout.txt @@ -0,0 +1,17 @@ + Start 1: SuccessfulTest +1/3 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: DisabledTest +2/3 Test #2: DisabledTest .....................\*\*\*\Not Run \(Disabled\) +[0-9.]+ sec + Start 3: NotRunTest +.* +3/3 Test #3: NotRunTest .......................\*\*\*\Not Run +[0-9.]+ sec ++ +50% tests passed, 1 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- DisabledTest \(Disabled\) ++ +The following tests FAILED: +.*3 - NotRunTest \(Not Run\) diff --git a/Tests/RunCMake/ctest_disabled_test/DisableRequiredTest-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisableRequiredTest-stdout.txt new file mode 100644 index 0000000..10d385e --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableRequiredTest-stdout.txt @@ -0,0 +1,13 @@ + Start 1: SuccessfulTest +1/3 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: DisabledTest +2/3 Test #2: DisabledTest .....................\*\*\*\Not Run \(Disabled\) +[0-9.]+ sec + Start 3: SuccessfulCleanupTest +3/3 Test #3: SuccessfulCleanupTest ............ Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- DisabledTest \(Disabled\) diff --git a/Tests/RunCMake/ctest_disabled_test/DisableSetupTest-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisableSetupTest-stdout.txt new file mode 100644 index 0000000..2dfd10d --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisableSetupTest-stdout.txt @@ -0,0 +1,13 @@ + Start 2: DisabledTest +1/3 Test #2: DisabledTest .....................\*\*\*\Not Run \(Disabled\) +[0-9.]+ sec + Start 1: SuccessfulTest +2/3 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 3: SuccessfulCleanupTest +3/3 Test #3: SuccessfulCleanupTest ............ Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- DisabledTest \(Disabled\) diff --git a/Tests/RunCMake/ctest_disabled_test/DisabledTest-result.txt b/Tests/RunCMake/ctest_disabled_test/DisabledTest-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisabledTest-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_disabled_test/DisabledTest-stderr.txt b/Tests/RunCMake/ctest_disabled_test/DisabledTest-stderr.txt new file mode 100644 index 0000000..83c332b --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisabledTest-stderr.txt @@ -0,0 +1 @@ +Unable to find executable: invalidCommand diff --git a/Tests/RunCMake/ctest_disabled_test/DisabledTest-stdout.txt b/Tests/RunCMake/ctest_disabled_test/DisabledTest-stdout.txt new file mode 100644 index 0000000..9078aeb --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/DisabledTest-stdout.txt @@ -0,0 +1,17 @@ + Start 1: SuccessfulTest +1/3 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: DisabledTest +2/3 Test #2: DisabledTest .....................\*\*\*\Not Run \(Disabled\) +[0-9.]+ sec + Start 3: NotRunTest +.* +3/3 Test #3: NotRunTest .......................\*\*\*\Not Run +[0-9.]+ sec ++ +50% tests passed, 1 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- DisabledTest \(Disabled\) ++ +The following tests FAILED: +.*3 - NotRunTest \(Not Run\) diff --git a/Tests/RunCMake/ctest_disabled_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_disabled_test/RunCMakeTest.cmake new file mode 100644 index 0000000..12541c4 --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/RunCMakeTest.cmake @@ -0,0 +1,89 @@ +include(RunCTest) + +function(run_DisableNotRunTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME DisabledTest COMMAND notACommand --version) +add_test(NAME NotRunTest COMMAND invalidCommand --version) + +set_tests_properties(SuccessfulTest PROPERTIES DISABLED false) +set_tests_properties(DisabledTest PROPERTIES DISABLED true) + ]]) + run_ctest(DisableNotRunTest) +endfunction() +run_DisableNotRunTest() + +function(run_DisableFailingTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +set(someFile "${CMAKE_CURRENT_SOURCE_DIR}/test.cmake") +add_test(NAME FailingTest + COMMAND ${CMAKE_COMMAND} -E compare_files "${someFile}" "${someFile}xxx") +add_test(NAME DisabledFailingTest + COMMAND ${CMAKE_COMMAND} -E compare_files "${someFile}" "${someFile}xxx") + +set_tests_properties(FailingTest PROPERTIES DISABLED false) +set_tests_properties(DisabledFailingTest PROPERTIES DISABLED true) + ]]) + run_ctest(DisableFailingTest) +endfunction() +run_DisableFailingTest() + +function(run_DisableSetupTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME DisabledTest COMMAND "${CMAKE_COMMAND}" --version) +add_test(NAME SuccessfulCleanupTest COMMAND "${CMAKE_COMMAND}" --version) + +set_tests_properties(DisabledTest PROPERTIES DISABLED true + FIXTURES_SETUP "Foo") +set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_REQUIRED "Foo") +set_tests_properties(SuccessfulCleanupTest PROPERTIES FIXTURES_CLEANUP "Foo") + ]]) +run_ctest(DisableSetupTest) +endfunction() +run_DisableSetupTest() + +function(run_DisableRequiredTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME DisabledTest COMMAND "${CMAKE_COMMAND}" --version) +add_test(NAME SuccessfulCleanupTest COMMAND "${CMAKE_COMMAND}" --version) + +set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_SETUP "Foo") +set_tests_properties(DisabledTest PROPERTIES DISABLED true + FIXTURES_REQUIRED "Foo") +set_tests_properties(SuccessfulCleanupTest PROPERTIES FIXTURES_CLEANUP "Foo") + ]]) +run_ctest(DisableRequiredTest) +endfunction() +run_DisableRequiredTest() + +function(run_DisableCleanupTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME CleanupTest COMMAND "${CMAKE_COMMAND}" --version) + +set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_REQUIRED "Foo") +set_tests_properties(CleanupTest PROPERTIES DISABLED true + FIXTURES_CLEANUP "Foo") + ]]) +run_ctest(DisableCleanupTest) +endfunction() +run_DisableCleanupTest() + +# Consider a fixture that has a setup test, a cleanup test and a disabled test +# which requires that fixture. Limit the test list with a regular expression +# that matches the disabled test but not the setup or cleanup tests, so the +# initial set of tests to be executed contains just the disabled test. Since +# the only test requiring the fixture is disabled, CTest should not +# automatically add in the setup and cleanup tests for the fixture, since no +# enabled test requires them. +function(run_DisableAllTests) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME SetupTest COMMAND "${CMAKE_COMMAND}" --version) +add_test(NAME CleanupTest COMMAND "${CMAKE_COMMAND}" --version) + +set_tests_properties(SetupTest PROPERTIES FIXTURES_SETUP "Foo") +set_tests_properties(SuccessfulTest PROPERTIES DISABLED true + FIXTURES_REQUIRED "Foo") +set_tests_properties(CleanupTest PROPERTIES FIXTURES_CLEANUP "Foo") + ]]) +run_ctest(DisableAllTests -R Successful) +endfunction() +run_DisableAllTests() diff --git a/Tests/RunCMake/ctest_disabled_test/test.cmake.in b/Tests/RunCMake/ctest_disabled_test/test.cmake.in new file mode 100644 index 0000000..ca23c83 --- /dev/null +++ b/Tests/RunCMake/ctest_disabled_test/test.cmake.in @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.7) + +set(CTEST_SITE "test-site") +set(CTEST_BUILD_NAME "test-build-name") +set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@") +set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build") +set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") + +set(ctest_test_args "@CASE_CTEST_TEST_ARGS@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test(${ctest_test_args}) diff --git a/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in b/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in index ab50fdd..5cb0b4e 100644 --- a/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in +++ b/Tests/RunCMake/ctest_fixtures/CMakeLists.txt.in @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.6.2) +cmake_minimum_required (VERSION 3.8.0) project(ctest_fixtures LANGUAGES NONE) include(CTest) diff --git a/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake b/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake index 673cf57..1754203 100644 --- a/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake @@ -19,6 +19,41 @@ run_ctest_test(setupFoo INCLUDE setupFoo) run_ctest_test(wontRun INCLUDE wontRun) run_ctest_test(unused INCLUDE Unused) +run_ctest_test(exclude_setup_foo + INCLUDE "one|two" + EXCLUDE_FIXTURE_SETUP "Foo" +) + +run_ctest_test(exclude_setup_bar + INCLUDE "one|two" + EXCLUDE_FIXTURE_SETUP "Bar" +) + +run_ctest_test(exclude_cleanup_foo + INCLUDE "one|two" + EXCLUDE_FIXTURE_CLEANUP "Foo" +) + +run_ctest_test(exclude_cleanup_bar + INCLUDE "one|two" + EXCLUDE_FIXTURE_CLEANUP "Bar" +) + +run_ctest_test(exclude_any_foo + INCLUDE "one|two" + EXCLUDE_FIXTURE "Foo" +) + +run_ctest_test(exclude_any_bar + INCLUDE "one|two" + EXCLUDE_FIXTURE "Bar" +) + +run_ctest_test(exclude_any_foobar + INCLUDE "one|two" + EXCLUDE_FIXTURE "Foo|Bar" +) + #------------------------------------------------------------ # CMake configure will fail due to cyclic test dependencies #------------------------------------------------------------ @@ -35,3 +70,18 @@ set(CASE_CMAKELISTS_CYCLIC_CODE [[ FIXTURES_REQUIRED "Foo") ]]) run_ctest(cyclicCleanup) + +#------------------------------------------------------------ +# Repeat some of the exclusion tests with ctest command line +# options instead of arguments to ctest_test(). This verifies +# that the command line options make it through as well. +#------------------------------------------------------------ +unset(CASE_CMAKELISTS_CYCLIC_CODE) +set(CASE_CTEST_FIXTURES_ARGS "") + +run_ctest(exclude_setup_foo -R "one|two" -FS Foo) +run_ctest(exclude_setup_foo -R "one|two" --fixture-exclude-setup Foo) +run_ctest(exclude_cleanup_foo -R "one|two" -FC Foo) +run_ctest(exclude_cleanup_foo -R "one|two" --fixture-exclude-cleanup Foo) +run_ctest(exclude_any_foo -R "one|two" -FA Foo) +run_ctest(exclude_any_foo -R "one|two" --fixture-exclude-any Foo) diff --git a/Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt new file mode 100644 index 0000000..82663d5 --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_any_bar-stdout.txt @@ -0,0 +1,15 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_any_bar-build + Start 3: setupFoo +1/5 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec + Start 2: setupBoth +2/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec + Start 1: one +3/5 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 5: cleanupFoo +4/5 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec + Start 6: two +5/5 Test #6: two +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 5 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt new file mode 100644 index 0000000..8c08d08 --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_any_foo-stdout.txt @@ -0,0 +1,13 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_any_foo-build + Start 2: setupBoth +1/4 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec + Start 1: one +2/4 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 6: two +3/4 Test #6: two +\.+ +Passed +[0-9.]+ sec + Start 7: cleanupBar +4/4 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 4 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt new file mode 100644 index 0000000..876768b --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-stdout.txt @@ -0,0 +1,9 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_any_foobar-build + Start 1: one +1/2 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 6: two +2/2 Test #6: two +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt new file mode 100644 index 0000000..0d27198 --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-stdout.txt @@ -0,0 +1,15 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_cleanup_bar-build + Start 3: setupFoo +1/5 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec + Start 2: setupBoth +2/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec + Start 1: one +3/5 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 5: cleanupFoo +4/5 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec + Start 6: two +5/5 Test #6: two +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 5 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt new file mode 100644 index 0000000..5b201a3 --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-stdout.txt @@ -0,0 +1,15 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_cleanup_foo-build + Start 3: setupFoo +1/5 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec + Start 2: setupBoth +2/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec + Start 1: one +3/5 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 6: two +4/5 Test #6: two +\.+ +Passed +[0-9.]+ sec + Start 7: cleanupBar +5/5 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 5 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt new file mode 100644 index 0000000..5357fef --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-stdout.txt @@ -0,0 +1,17 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_setup_bar-build + Start 3: setupFoo +1/6 Test #3: setupFoo +\.+ +Passed +[0-9.]+ sec + Start 2: setupBoth +2/6 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec + Start 1: one +3/6 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 5: cleanupFoo +4/6 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec + Start 6: two +5/6 Test #6: two +\.+ +Passed +[0-9.]+ sec + Start 7: cleanupBar +6/6 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 6 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt b/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt new file mode 100644 index 0000000..89f7f44 --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-stdout.txt @@ -0,0 +1,15 @@ +Test project .*/Tests/RunCMake/ctest_fixtures/exclude_setup_foo-build + Start 2: setupBoth +1/5 Test #2: setupBoth +\.+ +Passed +[0-9.]+ sec + Start 1: one +2/5 Test #1: one +\.+ +Passed +[0-9.]+ sec + Start 5: cleanupFoo +3/5 Test #5: cleanupFoo +\.+ +Passed +[0-9.]+ sec + Start 6: two +4/5 Test #6: two +\.+ +Passed +[0-9.]+ sec + Start 7: cleanupBar +5/5 Test #7: cleanupBar +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 5 ++ +Total Test time \(real\) = +[0-9.]+ sec$ diff --git a/Tests/RunCMake/ctest_fixtures/test.cmake.in b/Tests/RunCMake/ctest_fixtures/test.cmake.in index 43df172..7067117 100644 --- a/Tests/RunCMake/ctest_fixtures/test.cmake.in +++ b/Tests/RunCMake/ctest_fixtures/test.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6.2) +cmake_minimum_required(VERSION 3.8.0) set(CTEST_SITE "test-site") set(CTEST_BUILD_NAME "test-build-name") diff --git a/Tests/RunCMake/ctest_skipped_test/CMakeLists.txt.in b/Tests/RunCMake/ctest_skipped_test/CMakeLists.txt.in new file mode 100644 index 0000000..cc4b8ed --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/CMakeLists.txt.in @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(@CASE_NAME@ C) +include(CTest) + +if (WIN32) + set(skip_command "@CMAKE_CURRENT_LIST_DIR@/skip.bat") +else () + set(skip_command "@CMAKE_CURRENT_LIST_DIR@/skip.sh") +endif () + +add_test(NAME SuccessfulTest COMMAND "${CMAKE_COMMAND}" --version) +@CASE_CMAKELISTS_SUFFIX_CODE@ diff --git a/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in new file mode 100644 index 0000000..c0d7e42 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in @@ -0,0 +1 @@ +set(CTEST_PROJECT_NAME "@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_skipped_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_skipped_test/RunCMakeTest.cmake new file mode 100644 index 0000000..dcf5cd4 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/RunCMakeTest.cmake @@ -0,0 +1,51 @@ +include(RunCTest) + +function(run_SkipTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME SkipTest COMMAND ${skip_command}) + +set_tests_properties(SkipTest PROPERTIES SKIP_RETURN_CODE 125) + ]]) + run_ctest(SkipTest) +endfunction() +run_SkipTest() + +function(run_SkipSetupTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME SkipTest COMMAND ${skip_command}) +add_test(NAME SuccessfulCleanupTest COMMAND "${CMAKE_COMMAND}" --version) + +set_tests_properties(SkipTest PROPERTIES SKIP_RETURN_CODE 125 + FIXTURES_SETUP "Foo") +set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_REQUIRED "Foo") +set_tests_properties(SuccessfulCleanupTest PROPERTIES FIXTURES_CLEANUP "Foo") + ]]) + run_ctest(SkipSetupTest) +endfunction() +run_SkipSetupTest() + +function(run_SkipRequiredTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME SkipTest COMMAND ${skip_command}) +add_test(NAME SuccessfulCleanupTest COMMAND "${CMAKE_COMMAND}" --version) + +set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_SETUP "Foo") +set_tests_properties(SkipTest PROPERTIES SKIP_RETURN_CODE 125 + FIXTURES_REQUIRED "Foo") +set_tests_properties(SuccessfulCleanupTest PROPERTIES FIXTURES_CLEANUP "Foo") + ]]) + run_ctest(SkipRequiredTest) +endfunction() +run_SkipRequiredTest() + +function(run_SkipCleanupTest) + set(CASE_CMAKELISTS_SUFFIX_CODE [[ +add_test(NAME CleanupTest COMMAND ${skip_command}) + +set_tests_properties(SuccessfulTest PROPERTIES FIXTURES_REQUIRED "Foo") +set_tests_properties(CleanupTest PROPERTIES SKIP_RETURN_CODE 125 + FIXTURES_CLEANUP "Foo") + ]]) + run_ctest(SkipCleanupTest) +endfunction() +run_SkipCleanupTest() diff --git a/Tests/RunCMake/ctest_skipped_test/SkipCleanupTest-stdout.txt b/Tests/RunCMake/ctest_skipped_test/SkipCleanupTest-stdout.txt new file mode 100644 index 0000000..3b14b7a --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/SkipCleanupTest-stdout.txt @@ -0,0 +1,11 @@ + Start 1: SuccessfulTest +1/2 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: CleanupTest +2/2 Test #2: CleanupTest ......................\*\*\*\Skipped +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- CleanupTest \(Skipped\) diff --git a/Tests/RunCMake/ctest_skipped_test/SkipRequiredTest-stdout.txt b/Tests/RunCMake/ctest_skipped_test/SkipRequiredTest-stdout.txt new file mode 100644 index 0000000..8ecc6e3 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/SkipRequiredTest-stdout.txt @@ -0,0 +1,13 @@ + Start 1: SuccessfulTest +1/3 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: SkipTest +2/3 Test #2: SkipTest .........................\*\*\*\Skipped +[0-9.]+ sec + Start 3: SuccessfulCleanupTest +3/3 Test #3: SuccessfulCleanupTest ............ Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 3 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- SkipTest \(Skipped\) diff --git a/Tests/RunCMake/ctest_skipped_test/SkipSetupTest-stdout.txt b/Tests/RunCMake/ctest_skipped_test/SkipSetupTest-stdout.txt new file mode 100644 index 0000000..fe9bf34 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/SkipSetupTest-stdout.txt @@ -0,0 +1,13 @@ + Start 2: SkipTest +1/3 Test #2: SkipTest .........................\*\*\*\Skipped +[0-9.]+ sec + Start 1: SuccessfulTest +2/3 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 3: SuccessfulCleanupTest +3/3 Test #3: SuccessfulCleanupTest ............ Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 3 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- SkipTest \(Skipped\) diff --git a/Tests/RunCMake/ctest_skipped_test/SkipTest-stdout.txt b/Tests/RunCMake/ctest_skipped_test/SkipTest-stdout.txt new file mode 100644 index 0000000..52e7a0b --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/SkipTest-stdout.txt @@ -0,0 +1,11 @@ + Start 1: SuccessfulTest +1/2 Test #1: SuccessfulTest ................... Passed +[0-9.]+ sec + Start 2: SkipTest +2/2 Test #2: SkipTest .........................\*\*\*\Skipped +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 2 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests did not run: +.*2 \- SkipTest \(Skipped\) diff --git a/Tests/RunCMake/ctest_skipped_test/skip.bat b/Tests/RunCMake/ctest_skipped_test/skip.bat new file mode 100755 index 0000000..80e1290 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/skip.bat @@ -0,0 +1 @@ +EXIT 125 diff --git a/Tests/RunCMake/ctest_skipped_test/skip.sh b/Tests/RunCMake/ctest_skipped_test/skip.sh new file mode 100755 index 0000000..f9c4603 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/skip.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 125 diff --git a/Tests/RunCMake/ctest_skipped_test/test.cmake.in b/Tests/RunCMake/ctest_skipped_test/test.cmake.in new file mode 100644 index 0000000..ca23c83 --- /dev/null +++ b/Tests/RunCMake/ctest_skipped_test/test.cmake.in @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.7) + +set(CTEST_SITE "test-site") +set(CTEST_BUILD_NAME "test-build-name") +set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@") +set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build") +set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") + +set(ctest_test_args "@CASE_CTEST_TEST_ARGS@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test(${ctest_test_args}) diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-result.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt new file mode 100644 index 0000000..4825d7a --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt @@ -0,0 +1,3 @@ + *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/CDashSubmitHeaders-stdout.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stdout.txt new file mode 100644 index 0000000..3973872 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stdout.txt @@ -0,0 +1 @@ +Add HTTP Header: "Authorization: Bearer asdf" diff --git a/Tests/RunCMake/ctest_submit/CDashUploadHeaders-result.txt b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stderr.txt b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stderr.txt new file mode 100644 index 0000000..706e1f5 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stderr.txt @@ -0,0 +1 @@ +Error in HttpRequest diff --git a/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stdout.txt b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stdout.txt new file mode 100644 index 0000000..3973872 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stdout.txt @@ -0,0 +1 @@ +Add HTTP Header: "Authorization: Bearer asdf" diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index e104f8a..b5d90d2 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -25,6 +25,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") function(run_ctest_CDashUploadFTP) set(CASE_DROP_METHOD ftp) diff --git a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake index ca72692..a91b217 100644 --- a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake +++ b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake @@ -1,5 +1,8 @@ +if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/") + set(slash /) +endif() file(DOWNLOAD - "file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-hash-mismatch.txt" + "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-hash-mismatch.txt" ${CMAKE_CURRENT_BINARY_DIR}/hash-mismatch.txt EXPECTED_HASH SHA1=0123456789abcdef0123456789abcdef01234567 STATUS status diff --git a/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake b/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake index 2e3fbe1..2fa5482 100644 --- a/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake +++ b/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake @@ -1,5 +1,8 @@ +if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/") + set(slash /) +endif() file(DOWNLOAD - "file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-unused-argument.txt" + "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-unused-argument.txt" "${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt" JUNK ) diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-result.txt b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-stderr.txt b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-stderr.txt new file mode 100644 index 0000000..9d5f876 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-stderr.txt @@ -0,0 +1,15 @@ +^CMake Error at INSTALL-FILES_FROM_DIR-bad.cmake:[0-9]+ \(file\): + file option FILES_FROM_DIR requires all files to be specified as relative + paths\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at INSTALL-FILES_FROM_DIR-bad.cmake:[0-9]+ \(file\): + file INSTALL option RENAME may not be combined with FILES_FROM_DIR\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at INSTALL-FILES_FROM_DIR-bad.cmake:[0-9]+ \(file\): + file option FILES_FROM_DIR may not appear after PATTERN or REGEX\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad.cmake b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad.cmake new file mode 100644 index 0000000..807b704 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad.cmake @@ -0,0 +1,5 @@ +set(src ${CMAKE_CURRENT_SOURCE_DIR}/from) +set(dst ${CMAKE_CURRENT_BINARY_DIR}/from) +file(INSTALL FILES ${src}/a.txt FILES_FROM_DIR ${src} DESTINATION ${dst}) +file(INSTALL FILES a.txt FILES_FROM_DIR ${src} DESTINATION ${dst} RENAME b.txt) +file(INSTALL FILES a.txt DESTINATION ${dst} PATTERN *.txt FILES_FROM_DIR) diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-stdout.txt b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-stdout.txt new file mode 100644 index 0000000..1c3c693 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-stdout.txt @@ -0,0 +1,8 @@ +-- Before Installing +-- Installing: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a.txt +-- Installing: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b.txt +-- Installing: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b/c.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b/c.txt +-- After Installing diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR.cmake b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR.cmake new file mode 100644 index 0000000..24e5282 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR.cmake @@ -0,0 +1,7 @@ +set(src ${CMAKE_CURRENT_SOURCE_DIR}/from) +set(dst ${CMAKE_CURRENT_BINARY_DIR}/from) +file(REMOVE RECURSE ${dst}) +message(STATUS "Before Installing") +file(INSTALL FILES a.txt a/b.txt a/b/c.txt FILES_FROM_DIR ${src} DESTINATION ${dst}) +file(INSTALL FILES a.txt a/b.txt a/b/c.txt FILES_FROM_DIR from DESTINATION ${dst}) +message(STATUS "After Installing") diff --git a/Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt b/Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt new file mode 100644 index 0000000..9fb8e10 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt @@ -0,0 +1,3 @@ +-- Before Installing +-- Installing: .*/Tests/RunCMake/file/INSTALL-SYMLINK-build/dst/current_dir_symlink +-- After Installing diff --git a/Tests/RunCMake/file/INSTALL-SYMLINK.cmake b/Tests/RunCMake/file/INSTALL-SYMLINK.cmake new file mode 100644 index 0000000..5a4284a --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-SYMLINK.cmake @@ -0,0 +1,13 @@ +set(src "${CMAKE_CURRENT_BINARY_DIR}/src") +set(dst "${CMAKE_CURRENT_BINARY_DIR}/dst") +file(REMOVE RECURSE "${src}") +file(REMOVE RECURSE "${dst}") + +file(MAKE_DIRECTORY "${src}") +execute_process(COMMAND + ${CMAKE_COMMAND} -E create_symlink source "${src}/current_dir_symlink") + +message(STATUS "Before Installing") +file(INSTALL FILES "${src}/current_dir_symlink" + DESTINATION ${dst} TYPE DIRECTORY) +message(STATUS "After Installing") diff --git a/Tests/RunCMake/file/READ_ELF-result.txt b/Tests/RunCMake/file/READ_ELF-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/READ_ELF-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/READ_ELF-stderr.txt b/Tests/RunCMake/file/READ_ELF-stderr.txt new file mode 100644 index 0000000..7b32804 --- /dev/null +++ b/Tests/RunCMake/file/READ_ELF-stderr.txt @@ -0,0 +1,2 @@ +.*file READ_ELF must be called with at least three additional arguments\. +.*file READ_ELF given FILE "XXX" that does not exist\. diff --git a/Tests/RunCMake/file/READ_ELF.cmake b/Tests/RunCMake/file/READ_ELF.cmake new file mode 100644 index 0000000..cd02c9b --- /dev/null +++ b/Tests/RunCMake/file/READ_ELF.cmake @@ -0,0 +1,2 @@ +file(READ_ELF XXX) +file(READ_ELF XXX RPATH YYY) diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index 7497544..26051b4 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -8,6 +8,8 @@ run_cmake(UPLOAD-unused-argument) run_cmake(UPLOAD-httpheader-not-set) run_cmake(UPLOAD-pass-not-set) run_cmake(INSTALL-DIRECTORY) +run_cmake(INSTALL-FILES_FROM_DIR) +run_cmake(INSTALL-FILES_FROM_DIR-bad) run_cmake(INSTALL-MESSAGE-bad) run_cmake(FileOpenFailRead) run_cmake(LOCK) @@ -25,6 +27,7 @@ run_cmake(LOCK-error-no-timeout) run_cmake(LOCK-error-timeout) run_cmake(LOCK-error-unknown-option) run_cmake(LOCK-lowercase) +run_cmake(READ_ELF) run_cmake(GLOB) run_cmake(GLOB_RECURSE) # test is valid both for GLOB and GLOB_RECURSE @@ -35,4 +38,5 @@ run_cmake(GLOB-noexp-LIST_DIRECTORIES) if(NOT WIN32 OR CYGWIN) run_cmake(GLOB_RECURSE-cyclic-recursion) + run_cmake(INSTALL-SYMLINK) endif() diff --git a/Tests/RunCMake/file/UPLOAD-unused-argument.cmake b/Tests/RunCMake/file/UPLOAD-unused-argument.cmake index 94ac9ac..92c878c 100644 --- a/Tests/RunCMake/file/UPLOAD-unused-argument.cmake +++ b/Tests/RunCMake/file/UPLOAD-unused-argument.cmake @@ -1,5 +1,8 @@ +if(NOT "${CMAKE_CURRENT_BINARY_DIR}" MATCHES "^/") + set(slash /) +endif() file(UPLOAD "${CMAKE_CURRENT_SOURCE_DIR}/UPLOAD-unused-argument.txt" - "file://${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt" + "file://${slash}${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt" JUNK ) diff --git a/Tests/RunCMake/file/from/a.txt b/Tests/RunCMake/file/from/a.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/file/from/a.txt diff --git a/Tests/RunCMake/file/from/a/b.txt b/Tests/RunCMake/file/from/a/b.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/file/from/a/b.txt diff --git a/Tests/RunCMake/file/from/a/b/c.txt b/Tests/RunCMake/file/from/a/b/c.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/file/from/a/b/c.txt diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt index 04d09f2..12cd3c7 100644 --- a/Tests/RunCMake/find_dependency/CMakeLists.txt +++ b/Tests/RunCMake/find_dependency/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) -set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt deleted file mode 100644 index 348f8bb..0000000 --- a/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency. EXACT may only be specified if a - VERSION is specified -Call Stack \(most recent call first\): - EXACT-no-version.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version.cmake b/Tests/RunCMake/find_dependency/EXACT-no-version.cmake deleted file mode 100644 index b05665b7..0000000 --- a/Tests/RunCMake/find_dependency/EXACT-no-version.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 EXACT) diff --git a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake index 9403136..a72d189 100644 --- a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake @@ -1,7 +1,10 @@ include(RunCMake) -run_cmake(EXACT-no-version) -run_cmake(empty-version) -run_cmake(empty-arg-3) -run_cmake(invalid-arg-3) -run_cmake(extra-args) +# Success tests +run_cmake(realistic) +run_cmake(basic) + +# Failure tests +run_cmake(invalid-arg) +run_cmake(bad-version-fuzzy) +run_cmake(bad-version-exact) diff --git a/Tests/RunCMake/find_dependency/bad-version-exact-result.txt b/Tests/RunCMake/find_dependency/bad-version-exact-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-exact-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/bad-version-exact-stderr.txt b/Tests/RunCMake/find_dependency/bad-version-exact-stderr.txt new file mode 100644 index 0000000..0929f84 --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-exact-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(find_package\): + Could not find a configuration file for package "Pack1" that exactly + matches requested version "1.1". + + The following configuration files were considered but not accepted: + + .*/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake, version: 1.3 + +Call Stack \(most recent call first\): + bad-version-exact.cmake:5 \(find_dependency\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_dependency/bad-version-exact.cmake b/Tests/RunCMake/find_dependency/bad-version-exact.cmake new file mode 100644 index 0000000..c4ca5e2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-exact.cmake @@ -0,0 +1,5 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.1 EXACT REQUIRED) diff --git a/Tests/RunCMake/find_dependency/bad-version-fuzzy-result.txt b/Tests/RunCMake/find_dependency/bad-version-fuzzy-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-fuzzy-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/bad-version-fuzzy-stderr.txt b/Tests/RunCMake/find_dependency/bad-version-fuzzy-stderr.txt new file mode 100644 index 0000000..c63256f --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-fuzzy-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(find_package\): + Could not find a configuration file for package "Pack1" that is compatible + with requested version "1.4". + + The following configuration files were considered but not accepted: + + .*/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake, version: 1.3 + +Call Stack \(most recent call first\): + bad-version-fuzzy.cmake:5 \(find_dependency\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_dependency/bad-version-fuzzy.cmake b/Tests/RunCMake/find_dependency/bad-version-fuzzy.cmake new file mode 100644 index 0000000..c7cf4ee --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-fuzzy.cmake @@ -0,0 +1,5 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.4 REQUIRED) diff --git a/Tests/RunCMake/find_dependency/basic.cmake b/Tests/RunCMake/find_dependency/basic.cmake new file mode 100644 index 0000000..c7795f2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/basic.cmake @@ -0,0 +1,5 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.1) diff --git a/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt deleted file mode 100644 index bf9b02b..0000000 --- a/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency -Call Stack \(most recent call first\): - empty-arg-3.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/empty-arg-3.cmake b/Tests/RunCMake/find_dependency/empty-arg-3.cmake deleted file mode 100644 index b08200a..0000000 --- a/Tests/RunCMake/find_dependency/empty-arg-3.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 1.2 "") diff --git a/Tests/RunCMake/find_dependency/empty-version-stderr.txt b/Tests/RunCMake/find_dependency/empty-version-stderr.txt deleted file mode 100644 index b5e9f46..0000000 --- a/Tests/RunCMake/find_dependency/empty-version-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency. VERSION is empty -Call Stack \(most recent call first\): - empty-version.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/empty-version.cmake b/Tests/RunCMake/find_dependency/empty-version.cmake deleted file mode 100644 index e6f17cd..0000000 --- a/Tests/RunCMake/find_dependency/empty-version.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 "") diff --git a/Tests/RunCMake/find_dependency/extra-args-stderr.txt b/Tests/RunCMake/find_dependency/extra-args-stderr.txt deleted file mode 100644 index 83a7f02..0000000 --- a/Tests/RunCMake/find_dependency/extra-args-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency -Call Stack \(most recent call first\): - extra-args.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/extra-args.cmake b/Tests/RunCMake/find_dependency/extra-args.cmake deleted file mode 100644 index 209645a..0000000 --- a/Tests/RunCMake/find_dependency/extra-args.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 1.2 EXACT PATHS "${CMAKE_BINARY_DIR}") diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt deleted file mode 100644 index fee8d5d..0000000 --- a/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency -Call Stack \(most recent call first\): - invalid-arg-3.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/invalid-arg-result.txt b/Tests/RunCMake/find_dependency/invalid-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/invalid-arg-stderr.txt b/Tests/RunCMake/find_dependency/invalid-arg-stderr.txt new file mode 100644 index 0000000..16077b2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(find_package\): + find_package called with invalid argument "EXACTYPO" +Call Stack \(most recent call first\): + invalid-arg.cmake:5 \(find_dependency\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3.cmake b/Tests/RunCMake/find_dependency/invalid-arg.cmake index 40ede07..daaf569 100644 --- a/Tests/RunCMake/find_dependency/invalid-arg-3.cmake +++ b/Tests/RunCMake/find_dependency/invalid-arg.cmake @@ -1,3 +1,4 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include(CMakeFindDependencyMacro) diff --git a/Tests/RunCMake/find_dependency/realistic.cmake b/Tests/RunCMake/find_dependency/realistic.cmake new file mode 100644 index 0000000..e633a31 --- /dev/null +++ b/Tests/RunCMake/find_dependency/realistic.cmake @@ -0,0 +1,3 @@ +set(Pack2_DIR "${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/Pack2") + +find_package(Pack2 1.2 REQUIRED) diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake index 7d55ef6..7d55ef6 100644 --- a/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1ConfigVersion.cmake index dfb7b6c..dfb7b6c 100644 --- a/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1ConfigVersion.cmake diff --git a/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2Config.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2Config.cmake new file mode 100644 index 0000000..7e8a60b --- /dev/null +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2Config.cmake @@ -0,0 +1,6 @@ +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 PATHS ${CMAKE_CURRENT_LIST_DIR}/..) + +add_library(Pack2::Lib INTERFACE IMPORTED) +set_target_properties(Pack2::Lib PROPERTIES INTERFACE_LINK_LIBRARIES Pack1::Lib) diff --git a/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2ConfigVersion.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2ConfigVersion.cmake new file mode 100644 index 0000000..dfb7b6c --- /dev/null +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "1.3") + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/find_package/MissingConfig-stderr.txt b/Tests/RunCMake/find_package/MissingConfig-stderr.txt index 1eae0bb..33ff545 100644 --- a/Tests/RunCMake/find_package/MissingConfig-stderr.txt +++ b/Tests/RunCMake/find_package/MissingConfig-stderr.txt @@ -1,18 +1,3 @@ -CMake Warning at MissingConfig.cmake:1 \(find_package\): - Could not find a package configuration file provided by "NotHere" with any - of the following names: - - NotHereConfig.cmake - nothere-config.cmake - - Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set - "NotHere_DIR" to a directory containing one of the above files. If - "NotHere" provides a separate development package or SDK, be sure it has - been installed. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) - - CMake Warning at MissingConfig.cmake:2 \(message\): This warning must be reachable. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/find_package/MissingConfig-stdout.txt b/Tests/RunCMake/find_package/MissingConfig-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfig-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/MissingConfigNormal-stdout.txt b/Tests/RunCMake/find_package/MissingConfigNormal-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfigNormal-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/MissingConfigOneName-stderr.txt b/Tests/RunCMake/find_package/MissingConfigOneName-stderr.txt deleted file mode 100644 index 10e71fa..0000000 --- a/Tests/RunCMake/find_package/MissingConfigOneName-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -CMake Warning at MissingConfigOneName.cmake:1 \(find_package\): - Could not find a package configuration file named "NotHereConfig.cmake" - provided by package "NotHere". - - Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set - "NotHere_DIR" to a directory containing one of the above files. If - "NotHere" provides a separate development package or SDK, be sure it has - been installed. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/MissingConfigOneName-stdout.txt b/Tests/RunCMake/find_package/MissingConfigOneName-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfigOneName-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/MissingConfigVersion-stderr.txt b/Tests/RunCMake/find_package/MissingConfigVersion-stderr.txt deleted file mode 100644 index 2f5086e..0000000 --- a/Tests/RunCMake/find_package/MissingConfigVersion-stderr.txt +++ /dev/null @@ -1,13 +0,0 @@ -CMake Warning at MissingConfigVersion.cmake:1 \(find_package\): - Could not find a package configuration file provided by "NotHere" - \(requested version 1\.2\) with any of the following names: - - NotHereConfig.cmake - nothere-config.cmake - - Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set - "NotHere_DIR" to a directory containing one of the above files. If - "NotHere" provides a separate development package or SDK, be sure it has - been installed. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/MissingConfigVersion-stdout.txt b/Tests/RunCMake/find_package/MissingConfigVersion-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfigVersion-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/PackageRoot-stderr.txt b/Tests/RunCMake/find_package/PackageRoot-stderr.txt new file mode 100644 index 0000000..07b27bd --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot-stderr.txt @@ -0,0 +1,319 @@ +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :BAR_TEST_FILE_BAR-NOTFOUND +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :BAR_TEST_PATH_BAR-NOTFOUND +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :BAR_TEST_PROG_BAR-NOTFOUND + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/foo/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/foo/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/foo/env_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot.cmake b/Tests/RunCMake/find_package/PackageRoot.cmake new file mode 100644 index 0000000..d9f41f8 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot.cmake @@ -0,0 +1,143 @@ +cmake_policy(SET CMP0057 NEW) +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) +set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) + +macro(CleanUpPackageRootTest) + unset(Foo_ROOT) + unset(ENV{Foo_ROOT}) + unset(Bar_ROOT) + unset(ENV{Bar_ROOT}) + unset(FOO_TEST_FILE_FOO) + unset(FOO_TEST_PATH_FOO) + unset(FOO_TEST_PROG_FOO) + unset(BAR_TEST_FILE_FOO) + unset(BAR_TEST_FILE_BAR) + unset(BAR_TEST_PATH_FOO) + unset(BAR_TEST_PATH_BAR) + unset(BAR_TEST_PROG_FOO) + unset(BAR_TEST_PROG_BAR) + unset(FOO_TEST_FILE_FOO CACHE) + unset(FOO_TEST_PATH_FOO CACHE) + unset(FOO_TEST_PROG_FOO CACHE) + unset(BAR_TEST_FILE_FOO CACHE) + unset(BAR_TEST_FILE_BAR CACHE) + unset(BAR_TEST_PATH_FOO CACHE) + unset(BAR_TEST_PATH_BAR CACHE) + unset(BAR_TEST_PROG_FOO CACHE) + unset(BAR_TEST_PROG_BAR CACHE) +endmacro() + +macro(RunPackageRootTest) + set(orig_foo_cmake_root ${Foo_ROOT}) + set(orig_foo_env_root $ENV{Foo_ROOT}) + set(orig_bar_cmake_root ${Bar_ROOT}) + set(orig_bar_env_root $ENV{Bar_ROOT}) + + find_package(Foo) + message("Foo_ROOT :${Foo_ROOT}") + message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") + message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") + message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") + message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") + CleanUpPackageRootTest() + message("") + + set(Foo_ROOT ${orig_foo_cmake_root}) + set(ENV{Foo_ROOT} ${orig_foo_env_root}) + set(Bar_ROOT ${orig_bar_cmake_root}) + set(ENV{Bar_ROOT} ${orig_bar_env_root}) + + find_package(Foo COMPONENTS Bar) + message("Foo_ROOT :${Foo_ROOT}") + message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") + message("Bar_ROOT :${Bar_ROOT}") + message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}") + message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") + message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") + message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") + message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}") + message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}") + message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}") + message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}") + message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}") + message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}") + CleanUpPackageRootTest() + message("") + + unset(orig_foo_cmake_root) + unset(orig_foo_env_root) + unset(orig_bar_cmake_root) + unset(orig_bar_env_root) +endmacro() + +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +RunPackageRootTest() + +## + +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +## + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +## + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +## + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() diff --git a/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake new file mode 100644 index 0000000..eefa49c --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake @@ -0,0 +1,6 @@ +find_file(BAR_TEST_FILE_FOO foo.h) +find_file(BAR_TEST_FILE_BAR bar.h) +find_path(BAR_TEST_PATH_FOO foo.h) +find_path(BAR_TEST_PATH_BAR bar.h) +find_program(BAR_TEST_PROG_FOO foo.exe) +find_program(BAR_TEST_PROG_BAR bar.exe) diff --git a/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake new file mode 100644 index 0000000..cb62390 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake @@ -0,0 +1,7 @@ +find_file(FOO_TEST_FILE_FOO foo.h) +find_path(FOO_TEST_PATH_FOO foo.h) +find_program(FOO_TEST_PROG_FOO foo.exe) + +if ("Bar" IN_LIST Foo_FIND_COMPONENTS) + find_package(Bar) +endif () diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/env_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/foo.exe b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/foo.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/foo.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/foo.h b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/foo.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/foo.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/foo.exe b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/foo.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/foo.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/foo.h b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/foo.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/foo.h diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 81b2906..72f9c4d 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -13,6 +13,7 @@ run_cmake(MissingConfigOneName) run_cmake(MissingConfigRequired) run_cmake(MissingConfigVersion) run_cmake(MixedModeOptions) +run_cmake(PackageRoot) run_cmake(PolicyPush) run_cmake(PolicyPop) run_cmake(SetFoundFALSE) diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt deleted file mode 100644 index 695f645..0000000 --- a/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt +++ /dev/null @@ -1,9 +0,0 @@ -CMake Warning at SetFoundFALSE.cmake:2 \(find_package\): - Found package configuration file: - - .*/Tests/RunCMake/find_package/SetFoundFALSEConfig.cmake - - but it set SetFoundFALSE_FOUND to FALSE so package "SetFoundFALSE" is - considered to be NOT FOUND. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt new file mode 100644 index 0000000..37e6e7e --- /dev/null +++ b/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find SetFoundFALSE \(missing: SetFoundFALSE_DIR\) diff --git a/Tests/RunCMake/get_property/IsMultiConfig-stdout.txt b/Tests/RunCMake/get_property/IsMultiConfig-stdout.txt new file mode 100644 index 0000000..9808674 --- /dev/null +++ b/Tests/RunCMake/get_property/IsMultiConfig-stdout.txt @@ -0,0 +1 @@ +-- GENERATOR_IS_MULTI_CONFIG=1 diff --git a/Tests/RunCMake/get_property/IsMultiConfig.cmake b/Tests/RunCMake/get_property/IsMultiConfig.cmake new file mode 100644 index 0000000..64d5ff6 --- /dev/null +++ b/Tests/RunCMake/get_property/IsMultiConfig.cmake @@ -0,0 +1,2 @@ +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +message(STATUS "GENERATOR_IS_MULTI_CONFIG=${is_multi_config}") diff --git a/Tests/RunCMake/get_property/NotMultiConfig-stdout.txt b/Tests/RunCMake/get_property/NotMultiConfig-stdout.txt new file mode 100644 index 0000000..8e0f895 --- /dev/null +++ b/Tests/RunCMake/get_property/NotMultiConfig-stdout.txt @@ -0,0 +1 @@ +-- GENERATOR_IS_MULTI_CONFIG=0 diff --git a/Tests/RunCMake/get_property/NotMultiConfig.cmake b/Tests/RunCMake/get_property/NotMultiConfig.cmake new file mode 100644 index 0000000..59172d5 --- /dev/null +++ b/Tests/RunCMake/get_property/NotMultiConfig.cmake @@ -0,0 +1 @@ +include(IsMultiConfig.cmake) diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake index 00eef34..017990f 100644 --- a/Tests/RunCMake/get_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -22,3 +22,9 @@ run_cmake(NoTarget) run_cmake(NoSource) run_cmake(NoProperty) run_cmake(NoCache) + +if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode") + run_cmake(IsMultiConfig) +else() + run_cmake(NotMultiConfig) +endif() diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake index 077d00a..f54edf7 100644 --- a/Tests/RunCMake/if/RunCMakeTest.cmake +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -3,7 +3,11 @@ include(RunCMake) run_cmake(InvalidArgument1) run_cmake(IsDirectory) run_cmake(IsDirectoryLong) +run_cmake(duplicate-deep-else) +run_cmake(duplicate-else) +run_cmake(duplicate-else-after-elseif) run_cmake(elseif-message) +run_cmake(misplaced-elseif) run_cmake(MatchesSelf) diff --git a/Tests/RunCMake/if/duplicate-deep-else-result.txt b/Tests/RunCMake/if/duplicate-deep-else-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/if/duplicate-deep-else-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/duplicate-deep-else-stderr.txt b/Tests/RunCMake/if/duplicate-deep-else-stderr.txt new file mode 100644 index 0000000..ac2335c --- /dev/null +++ b/Tests/RunCMake/if/duplicate-deep-else-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at duplicate-deep-else.cmake:[0-9]+ \(else\): + A duplicate ELSE command was found inside an IF block. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/if/duplicate-deep-else.cmake b/Tests/RunCMake/if/duplicate-deep-else.cmake new file mode 100644 index 0000000..94f06de --- /dev/null +++ b/Tests/RunCMake/if/duplicate-deep-else.cmake @@ -0,0 +1,7 @@ +if(0) +else() + if(0) + else() + else() + endif() +endif() diff --git a/Tests/RunCMake/if/duplicate-else-after-elseif-result.txt b/Tests/RunCMake/if/duplicate-else-after-elseif-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/if/duplicate-else-after-elseif-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt b/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt new file mode 100644 index 0000000..ba6765c --- /dev/null +++ b/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at duplicate-else-after-elseif.cmake:[0-9]+ \(else\): + A duplicate ELSE command was found inside an IF block. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/if/duplicate-else-after-elseif.cmake b/Tests/RunCMake/if/duplicate-else-after-elseif.cmake new file mode 100644 index 0000000..d1d4ac1 --- /dev/null +++ b/Tests/RunCMake/if/duplicate-else-after-elseif.cmake @@ -0,0 +1,5 @@ +if(0) +elseif(0) +else() +else() +endif() diff --git a/Tests/RunCMake/if/duplicate-else-result.txt b/Tests/RunCMake/if/duplicate-else-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/if/duplicate-else-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/duplicate-else-stderr.txt b/Tests/RunCMake/if/duplicate-else-stderr.txt new file mode 100644 index 0000000..e0dd01f --- /dev/null +++ b/Tests/RunCMake/if/duplicate-else-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at duplicate-else.cmake:[0-9]+ \(else\): + A duplicate ELSE command was found inside an IF block. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/if/duplicate-else.cmake b/Tests/RunCMake/if/duplicate-else.cmake new file mode 100644 index 0000000..14a03ac --- /dev/null +++ b/Tests/RunCMake/if/duplicate-else.cmake @@ -0,0 +1,4 @@ +if(0) +else() +else() +endif() diff --git a/Tests/RunCMake/if/misplaced-elseif-result.txt b/Tests/RunCMake/if/misplaced-elseif-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/if/misplaced-elseif-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/misplaced-elseif-stderr.txt b/Tests/RunCMake/if/misplaced-elseif-stderr.txt new file mode 100644 index 0000000..c4b0266 --- /dev/null +++ b/Tests/RunCMake/if/misplaced-elseif-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at misplaced-elseif.cmake:[0-9]+ \(elseif\): + An ELSEIF command was found after an ELSE command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/if/misplaced-elseif.cmake b/Tests/RunCMake/if/misplaced-elseif.cmake new file mode 100644 index 0000000..d27f24e --- /dev/null +++ b/Tests/RunCMake/if/misplaced-elseif.cmake @@ -0,0 +1,4 @@ +if(0) +else() +elseif(1) +endif() diff --git a/Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake b/Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake new file mode 100644 index 0000000..1a940b8 --- /dev/null +++ b/Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake @@ -0,0 +1 @@ +check_project(CustomConfig external "aaa-bbb-ccc-000" "" "" "Custom - Release") diff --git a/Tests/RunCMake/include_external_msproject/CustomConfig.cmake b/Tests/RunCMake/include_external_msproject/CustomConfig.cmake new file mode 100644 index 0000000..1f935cd --- /dev/null +++ b/Tests/RunCMake/include_external_msproject/CustomConfig.cmake @@ -0,0 +1,3 @@ +include_external_msproject(external external.project + GUID aaa-bbb-ccc-000) +set_target_properties(external PROPERTIES MAP_IMPORTED_CONFIG_RELEASE "Custom - Release") diff --git a/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake b/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake index 68dec4c..3747934 100644 --- a/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake +++ b/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake @@ -1 +1 @@ -check_project(CustomGuid external "aaa-bbb-ccc-000" "" "") +check_project(CustomGuid external "aaa-bbb-ccc-000" "" "" "") diff --git a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake index 614712e..0b2ac1d 100644 --- a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake +++ b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake @@ -1 +1 @@ -check_project(CustomGuidTypePlatform external "aaa-bbb-ccc-111" "aaa-bbb-ccc-ddd-eee" "Custom Platform") +check_project(CustomGuidTypePlatform external "aaa-bbb-ccc-111" "aaa-bbb-ccc-ddd-eee" "Custom Platform" "") diff --git a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake index 054eeb0..c431b03 100644 --- a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake +++ b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake @@ -1 +1 @@ -check_project(CustomTypePlatform external "" "aaa-bbb-ccc-ddd-eee" "Custom Platform") +check_project(CustomTypePlatform external "" "aaa-bbb-ccc-ddd-eee" "Custom Platform" "") diff --git a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake index 90710f9..47dac34 100644 --- a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake @@ -4,3 +4,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/check_utils.cmake) run_cmake(CustomGuid) run_cmake(CustomTypePlatform) run_cmake(CustomGuidTypePlatform) +run_cmake(CustomConfig) diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake index 5dd92f9..e9e9cac 100644 --- a/Tests/RunCMake/include_external_msproject/check_utils.cmake +++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake @@ -71,8 +71,24 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) set(${RESULT} ${IS_FOUND} PARENT_SCOPE) endfunction() +# Search project's build configuration line by project name and target configuration name. +# Returns TRUE if found and FALSE otherwise +function(check_custom_configuration TARGET_FILE PROJECT_NAME SLN_CONFIG DST_CONFIG RESULT) + set(${RESULT} "FALSE" PARENT_SCOPE) + # extract project guid + parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) + if(NOT IS_FOUND) + return() + endif() + + set(REG_EXP "^(\t)*\\{${FOUND_GUID}\\}\\.${SLN_CONFIG}[^ ]*\\.ActiveCfg = ${DST_CONFIG}\\|.*$") + check_line_exists(${TARGET_FILE} REG_EXP) + + set(${RESULT} ${IS_FOUND} PARENT_SCOPE) +endfunction() + # RunCMake test check helper -function(check_project test name guid type platform) +function(check_project test name guid type platform imported_release_config_name) set(sln "${RunCMake_TEST_BINARY_DIR}/${test}.sln") set(sep "") set(failed "") @@ -88,6 +104,9 @@ function(check_project test name guid type platform) set(platform "Win32") endif() endif() + if(NOT imported_release_config_name) + set(imported_release_config_name "Release") + endif() if(guid) check_project_guid("${sln}" "${name}" "${guid}" passed_guid) if(NOT passed_guid) @@ -107,5 +126,11 @@ function(check_project test name guid type platform) string(APPEND failed "${sep}${name} solution has no project with expected PLATFORM=${platform}") set(sep "\n") endif() + check_custom_configuration("${sln}" "${name}" "Release" "${imported_release_config_name}" passed_configuration) + if(NOT passed_configuration) + string(APPEND failed "${sep}${name} solution has no project with expected CONFIG=${imported_release_config_name}") + set(sep "\n") + endif() + set(RunCMake_TEST_FAILED "${failed}" PARENT_SCOPE) endfunction() diff --git a/Tests/RunCMake/install/EXPORT-OldIFace.cmake b/Tests/RunCMake/install/EXPORT-OldIFace.cmake index 033f684..ee3fb23 100644 --- a/Tests/RunCMake/install/EXPORT-OldIFace.cmake +++ b/Tests/RunCMake/install/EXPORT-OldIFace.cmake @@ -1,5 +1,6 @@ enable_language(C) set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR 1) add_subdirectory(EXPORT-OldIFace) add_library(foo SHARED empty.c) target_link_libraries(foo bar) diff --git a/Tests/RunCMake/install/FILES-TARGET_OBJECTS-all-check.cmake b/Tests/RunCMake/install/FILES-TARGET_OBJECTS-all-check.cmake new file mode 100644 index 0000000..f7f2a3a --- /dev/null +++ b/Tests/RunCMake/install/FILES-TARGET_OBJECTS-all-check.cmake @@ -0,0 +1 @@ +check_installed([[^objs;objs/obj1(\.c)?\.(o|obj);objs/obj2(\.c)?\.(o|obj)$]]) diff --git a/Tests/RunCMake/install/FILES-TARGET_OBJECTS.cmake b/Tests/RunCMake/install/FILES-TARGET_OBJECTS.cmake new file mode 100644 index 0000000..40c58ad --- /dev/null +++ b/Tests/RunCMake/install/FILES-TARGET_OBJECTS.cmake @@ -0,0 +1,3 @@ +enable_language(C) +add_library(objs OBJECT obj1.c obj2.c) +install(FILES $<TARGET_OBJECTS:objs> DESTINATION objs) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 45693b5..1a60f0c 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -13,12 +13,15 @@ function(run_install_test case) # Check "all" components. set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-all) run_cmake_command(${case}-all ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -P cmake_install.cmake) - # Check unspecified component. - set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-uns) - run_cmake_command(${case}-uns ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=Unspecified -P cmake_install.cmake) - # Check explicit component. - set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-exc) - run_cmake_command(${case}-exc ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=exc -P cmake_install.cmake) + + if(run_install_test_components) + # Check unspecified component. + set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-uns) + run_cmake_command(${case}-uns ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=Unspecified -P cmake_install.cmake) + # Check explicit component. + set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-exc) + run_cmake_command(${case}-exc ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=exc -P cmake_install.cmake) + endif() endfunction() # Function called in *-check.cmake scripts to check installed files. @@ -57,5 +60,10 @@ run_cmake(CMP0062-OLD) run_cmake(CMP0062-NEW) run_cmake(CMP0062-WARN) +if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") + run_install_test(FILES-TARGET_OBJECTS) +endif() + +set(run_install_test_components 1) run_install_test(FILES-EXCLUDE_FROM_ALL) run_install_test(TARGETS-EXCLUDE_FROM_ALL) diff --git a/Tests/RunCMake/install/obj1.c b/Tests/RunCMake/install/obj1.c new file mode 100644 index 0000000..2411aab --- /dev/null +++ b/Tests/RunCMake/install/obj1.c @@ -0,0 +1,4 @@ +int obj1(void) +{ + return 0; +} diff --git a/Tests/RunCMake/install/obj2.c b/Tests/RunCMake/install/obj2.c new file mode 100644 index 0000000..2dad71e --- /dev/null +++ b/Tests/RunCMake/install/obj2.c @@ -0,0 +1,4 @@ +int obj2(void) +{ + return 0; +} diff --git a/Tests/RunCMake/project/ProjectDescription-stdout.txt b/Tests/RunCMake/project/ProjectDescription-stdout.txt new file mode 100644 index 0000000..ffa9092 --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription-stdout.txt @@ -0,0 +1 @@ +PROJECT_DESCRIPTION=Test Project diff --git a/Tests/RunCMake/project/ProjectDescription.cmake b/Tests/RunCMake/project/ProjectDescription.cmake new file mode 100644 index 0000000..3a47362 --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" LANGUAGES) +if(NOT PROJECT_DESCRIPTION) + message(FATAL_ERROR "PROJECT_DESCRIPTION expected to be set") +endif() +message(STATUS "PROJECT_DESCRIPTION=${PROJECT_DESCRIPTION}") diff --git a/Tests/RunCMake/project/ProjectDescription2-result.txt b/Tests/RunCMake/project/ProjectDescription2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/ProjectDescription2-stderr.txt b/Tests/RunCMake/project/ProjectDescription2-stderr.txt new file mode 100644 index 0000000..558e2df --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2-stderr.txt @@ -0,0 +1 @@ + DESCRITPION may be specified at most once. diff --git a/Tests/RunCMake/project/ProjectDescription2.cmake b/Tests/RunCMake/project/ProjectDescription2.cmake new file mode 100644 index 0000000..3f186ba --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" DESCRIPTION "Only once allowed" LANGUAGES) diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake index dba97d2..3d13e2e 100644 --- a/Tests/RunCMake/project/RunCMakeTest.cmake +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -7,6 +7,8 @@ run_cmake(LanguagesImplicit) run_cmake(LanguagesEmpty) run_cmake(LanguagesNONE) run_cmake(LanguagesTwice) +run_cmake(ProjectDescription) +run_cmake(ProjectDescription2) run_cmake(VersionAndLanguagesEmpty) run_cmake(VersionEmpty) run_cmake(VersionInvalid) diff --git a/Tests/RunCMake/separate_arguments/CMakeLists.txt b/Tests/RunCMake/separate_arguments/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/separate_arguments/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/separate_arguments/EmptyCommand.cmake b/Tests/RunCMake/separate_arguments/EmptyCommand.cmake new file mode 100644 index 0000000..895b6ac --- /dev/null +++ b/Tests/RunCMake/separate_arguments/EmptyCommand.cmake @@ -0,0 +1,6 @@ +set(nothing) +separate_arguments(nothing) +if(DEFINED nothing) + message(FATAL_ERROR "separate_arguments null-case failed: " + "nothing=[${nothing}]") +endif() diff --git a/Tests/RunCMake/separate_arguments/NativeCommand.cmake b/Tests/RunCMake/separate_arguments/NativeCommand.cmake new file mode 100644 index 0000000..1cb009e --- /dev/null +++ b/Tests/RunCMake/separate_arguments/NativeCommand.cmake @@ -0,0 +1,19 @@ +set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"") +set(unix_exp "a;b c;d e;\;; '\";';\"") + +set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"") +set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"") + +if(CMAKE_HOST_WIN32) + set(native_cmd "${windows_cmd}") + set(native_exp "${windows_exp}") +else() + set(native_cmd "${unix_cmd}") + set(native_exp "${unix_exp}") +endif() +separate_arguments(native_out NATIVE_COMMAND "${native_cmd}") + +if(NOT "${native_out}" STREQUAL "${native_exp}") + message(FATAL_ERROR "separate_arguments native-style failed. " + "Expected\n [${native_exp}]\nbut got\n [${native_out}]\n") +endif() diff --git a/Tests/RunCMake/separate_arguments/PlainCommand.cmake b/Tests/RunCMake/separate_arguments/PlainCommand.cmake new file mode 100644 index 0000000..311a993 --- /dev/null +++ b/Tests/RunCMake/separate_arguments/PlainCommand.cmake @@ -0,0 +1,8 @@ +set(old_out "a b c") +separate_arguments(old_out) +set(old_exp "a;b;;c") + +if(NOT "${old_out}" STREQUAL "${old_exp}") + message(FATAL_ERROR "separate_arguments old-style failed. " + "Expected\n [${old_exp}]\nbut got\n [${old_out}]\n") +endif() diff --git a/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake b/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake new file mode 100644 index 0000000..07951bb --- /dev/null +++ b/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake @@ -0,0 +1,7 @@ +include(RunCMake) + +run_cmake(EmptyCommand) +run_cmake(PlainCommand) +run_cmake(UnixCommand) +run_cmake(WindowsCommand) +run_cmake(NativeCommand) diff --git a/Tests/RunCMake/separate_arguments/UnixCommand.cmake b/Tests/RunCMake/separate_arguments/UnixCommand.cmake new file mode 100644 index 0000000..0b5767a --- /dev/null +++ b/Tests/RunCMake/separate_arguments/UnixCommand.cmake @@ -0,0 +1,8 @@ +set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"") +set(unix_exp "a;b c;d e;\;; '\";';\"") +separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}") + +if(NOT "${unix_out}" STREQUAL "${unix_exp}") + message(FATAL_ERROR "separate_arguments unix-style failed. " + "Expected\n [${unix_exp}]\nbut got\n [${unix_out}]\n") +endif() diff --git a/Tests/RunCMake/separate_arguments/WindowsCommand.cmake b/Tests/RunCMake/separate_arguments/WindowsCommand.cmake new file mode 100644 index 0000000..86aa14a --- /dev/null +++ b/Tests/RunCMake/separate_arguments/WindowsCommand.cmake @@ -0,0 +1,8 @@ +set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"") +set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"") +separate_arguments(windows_out WINDOWS_COMMAND "${windows_cmd}") + +if(NOT "${windows_out}" STREQUAL "${windows_exp}") + message(FATAL_ERROR "separate_arguments windows-style failed. " + "Expected\n [${windows_exp}]\nbut got\n [${windows_out}]\n") +endif() |