diff options
Diffstat (limited to 'Tests')
1018 files changed, 9137 insertions, 2698 deletions
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt index 9467fae..c50b4e6 100644 --- a/Tests/AliasTarget/CMakeLists.txt +++ b/Tests/AliasTarget/CMakeLists.txt @@ -1,7 +1,15 @@ - cmake_minimum_required(VERSION 2.8.11) project(AliasTarget) +set(CMAKE_CXX_STANDARD 98) + +# Those versions of the HP compiler that need a flag to get proper C++98 +# template support also need a flag to use the newer C++ library. +if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () + add_library(foo SHARED empty.cpp) add_library(PREFIX::Foo ALIAS foo) add_library(Another::Alias ALIAS foo) diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 9727930..8df331e 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -68,6 +68,8 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h "#define link_depends_no_shared_exe_value 0\n") set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt) +file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n") + help_xcode_depends() message("Building project first time") @@ -166,9 +168,21 @@ else() "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.") endif() +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out) + file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out) + if("${external_out}" STREQUAL "external original") + message(STATUS "external.out contains '${external_out}'") + else() + message(SEND_ERROR "Project did not initially build properly: " + "external.out contains '${external_out}'") + endif() +else() + message(SEND_ERROR "Project did not initially build properly: " + "external.out is missing") +endif() + message("Waiting 3 seconds...") -# any additional argument will cause ${bar} to wait forever -execute_process(COMMAND ${bar} -infinite TIMEOUT 3 OUTPUT_VARIABLE out) +execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 3) message("Modifying Project/foo.cxx") write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx @@ -191,6 +205,8 @@ if(TEST_LINK_DEPENDS) file(WRITE ${TEST_LINK_DEPENDS} "2") endif() +file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n") + help_xcode_depends() message("Building project second time") @@ -294,3 +310,16 @@ else() message(SEND_ERROR "Project did not rebuild properly. " "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.") endif() + +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out) + file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out) + if("${external_out}" STREQUAL "external changed") + message(STATUS "external.out contains '${external_out}'") + else() + message(SEND_ERROR "Project did not rebuild properly: " + "external.out contains '${external_out}'") + endif() +else() + message(SEND_ERROR "Project did not rebuild properly: " + "external.out is missing") +endif() diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 8806ecd..9ee4a43 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -139,3 +139,15 @@ add_custom_target(header_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dir/header.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(ninjadep ninjadep.cpp) add_dependencies(ninjadep header_tgt) + +include(ExternalProject) +ExternalProject_Add(ExternalBuild + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/External + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/External + STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/External/Stamp + BUILD_ALWAYS 1 + CMAKE_ARGS + -Dexternal_in=${CMAKE_CURRENT_BINARY_DIR}/external.in + -Dexternal_out=${CMAKE_CURRENT_BINARY_DIR}/external.out + INSTALL_COMMAND "" + ) diff --git a/Tests/BuildDepends/Project/External/CMakeLists.txt b/Tests/BuildDepends/Project/External/CMakeLists.txt new file mode 100644 index 0000000..c6015b6 --- /dev/null +++ b/Tests/BuildDepends/Project/External/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.0) +project(BuildDependsExternal NONE) +if(NOT DEFINED external_in) + message(FATAL_ERROR "Define external_in") +endif() +if(NOT DEFINED external_out) + message(FATAL_ERROR "Define external_out") +endif() +add_custom_command( + OUTPUT ${external_out} + COMMAND ${CMAKE_COMMAND} -E copy ${external_in} ${external_out} + DEPENDS ${external_in} + ) +add_custom_target(drive ALL DEPENDS ${external_out}) diff --git a/Tests/BuildDepends/Project/bar.cxx b/Tests/BuildDepends/Project/bar.cxx index 25d8bd2..dadf93d 100644 --- a/Tests/BuildDepends/Project/bar.cxx +++ b/Tests/BuildDepends/Project/bar.cxx @@ -15,11 +15,5 @@ int main(int argc, char** argv) /* Print out the string that should have been regenerated. */ printf("%s\n", regen_string); fflush(stdout); - // if any argument is used, wait forever - if (argc>1) - { - // wait that we get killed... - for(;;); - } return 0; } diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in index 0f7074b..71bcb18 100644 --- a/Tests/CMakeBuildTest.cmake.in +++ b/Tests/CMakeBuildTest.cmake.in @@ -11,8 +11,9 @@ file(REMOVE "@CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt") message("running: ${CMAKE_COMMAND}") execute_process(COMMAND "${CMAKE_COMMAND}" "@CMAKE_BUILD_TEST_SOURCE_DIR@" - "-G@CMAKE_TEST_GENERATOR@" - -T "@CMAKE_TEST_GENERATOR_TOOLSET@" + "-G@CMAKE_GENERATOR@" + -A "@CMAKE_GENERATOR_PLATFORM@" + -T "@CMAKE_GENERATOR_TOOLSET@" WORKING_DIRECTORY "@CMAKE_BUILD_TEST_BINARY_DIR@" RESULT_VARIABLE RESULT) if(RESULT) diff --git a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt new file mode 100644 index 0000000..9b35f27 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.0) +project(target_compile_features) + +if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_dummy.cpp" + "int main(int,char**) { return 0; }\n" + ) + add_executable(target_compile_features "${CMAKE_CURRENT_BINARY_DIR}/test_dummy.cpp") + return() +endif() + +set(CMAKE_VERBOSE_MAKEFILE ON) + +if (CMAKE_C_COMPILE_FEATURES) + add_executable(target_compile_features main.c) + target_compile_features(target_compile_features + PRIVATE c_restrict + ) + + add_library(lib_restrict lib_restrict.c) + target_compile_features(lib_restrict + PUBLIC c_restrict + ) + + add_executable(restrict_user restrict_user.c) + target_link_libraries(restrict_user lib_restrict) +endif() + +if (CMAKE_CXX_COMPILE_FEATURES) + if (CMAKE_C_COMPILE_FEATURES) + set(target_suffix _cxx) + endif() + add_executable(target_compile_features${target_suffix} main.cpp) + target_compile_features(target_compile_features${target_suffix} + PRIVATE cxx_auto_type + ) + + add_library(lib_auto_type lib_auto_type.cpp) + target_compile_features(lib_auto_type + PUBLIC cxx_auto_type + ) + + add_executable(lib_user lib_user.cpp) + target_link_libraries(lib_user lib_auto_type) +endif() diff --git a/Tests/CMakeCommands/target_compile_features/dummy.cpp b/Tests/CMakeCommands/target_compile_features/dummy.cpp new file mode 100644 index 0000000..341aaaf --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/dummy.cpp @@ -0,0 +1,5 @@ + +int main(int, char **) +{ + return 0; +} diff --git a/Tests/CMakeCommands/target_compile_features/lib_auto_type.cpp b/Tests/CMakeCommands/target_compile_features/lib_auto_type.cpp new file mode 100644 index 0000000..71b2215 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/lib_auto_type.cpp @@ -0,0 +1,6 @@ + +int getAutoTypeImpl() +{ + auto i = 0; + return i; +} diff --git a/Tests/CMakeCommands/target_compile_features/lib_auto_type.h b/Tests/CMakeCommands/target_compile_features/lib_auto_type.h new file mode 100644 index 0000000..c825b10 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/lib_auto_type.h @@ -0,0 +1,8 @@ + +int getAutoTypeImpl(); + +int getAutoType() +{ + auto i = getAutoTypeImpl(); + return i; +} diff --git a/Tests/CMakeCommands/target_compile_features/lib_restrict.c b/Tests/CMakeCommands/target_compile_features/lib_restrict.c new file mode 100644 index 0000000..049c1b0 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/lib_restrict.c @@ -0,0 +1,9 @@ + +#include "lib_restrict.h" + +int foo(int * restrict a, int * restrict b) +{ + (void)a; + (void)b; + return 0; +} diff --git a/Tests/CMakeCommands/target_compile_features/lib_restrict.h b/Tests/CMakeCommands/target_compile_features/lib_restrict.h new file mode 100644 index 0000000..eca22be --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/lib_restrict.h @@ -0,0 +1,7 @@ + +#ifndef LIB_RESTRICT_H +#define LIB_RESTRICT_H + +int foo(int * restrict a, int * restrict b); + +#endif diff --git a/Tests/CMakeCommands/target_compile_features/lib_user.cpp b/Tests/CMakeCommands/target_compile_features/lib_user.cpp new file mode 100644 index 0000000..976068a --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/lib_user.cpp @@ -0,0 +1,7 @@ + +#include "lib_auto_type.h" + +int main(int argc, char **argv) +{ + return getAutoType(); +} diff --git a/Tests/CMakeCommands/target_compile_features/main.c b/Tests/CMakeCommands/target_compile_features/main.c new file mode 100644 index 0000000..831c5eb2 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/main.c @@ -0,0 +1,12 @@ + +int foo(int * restrict a, int * restrict b) +{ + (void)a; + (void)b; + return 0; +} + +int main() +{ + return 0; +} diff --git a/Tests/CMakeCommands/target_compile_features/main.cpp b/Tests/CMakeCommands/target_compile_features/main.cpp new file mode 100644 index 0000000..fe29b04 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/main.cpp @@ -0,0 +1,6 @@ + +int main(int, char **) +{ + auto i = 0; + return i; +} diff --git a/Tests/CMakeCommands/target_compile_features/restrict_user.c b/Tests/CMakeCommands/target_compile_features/restrict_user.c new file mode 100644 index 0000000..d47b847 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_features/restrict_user.c @@ -0,0 +1,14 @@ + +#include "lib_restrict.h" + +int bar(int * restrict a, int * restrict b) +{ + (void)a; + (void)b; + return foo(a, b); +} + +int main() +{ + return 0; +} diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 0e1fe8d..8c99f64 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -13,6 +13,8 @@ set(CMakeLib_TESTS testXMLSafe ) +set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}) + if(WIN32) list(APPEND CMakeLib_TESTS testVisualStudioSlnParser @@ -39,7 +41,7 @@ if(CMAKE_OSX_ARCHITECTURES AND XCODE endif() foreach(test ${CMakeLib_TESTS}) - add_test(CMakeLib.${test} CMakeLibTests ${test}) + add_test(CMakeLib.${test} CMakeLibTests ${test} ${${test}_ARGS}) endforeach() if(TEST_CompileCommandOutput) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index dc1ce24..279bcd5 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -2,14 +2,14 @@ class CompileCommandParser { public: - class CommandType: public std::map<cmStdString, cmStdString> + class CommandType: public std::map<std::string, std::string> { public: - cmStdString const& at(cmStdString const& k) const + std::string const& at(std::string const& k) const { const_iterator i = this->find(k); if(i != this->end()) { return i->second; } - static cmStdString emptyString; + static std::string emptyString; return emptyString; } }; @@ -127,7 +127,7 @@ int main () it = parser.GetTranslationUnits().begin(), end = parser.GetTranslationUnits().end(); it != end; ++it) { - std::vector<cmStdString> command; + std::vector<std::string> command; cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), command); if (!cmSystemTools::RunSingleCommand( command, 0, 0, it->at("directory").c_str())) diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx index bad9560..37cb3fa 100644 --- a/Tests/CMakeLib/testRST.cxx +++ b/Tests/CMakeLib/testRST.cxx @@ -25,9 +25,14 @@ void reportLine(std::ostream& os, bool ret, std::string line, bool eol) } } -int testRST(int, char*[]) +int testRST(int argc, char* argv[]) { - std::string dir = cmSystemTools::GetFilenamePath(__FILE__); + if(argc != 2) + { + std::cerr << "Usage: testRST <dir>" << std::endl; + return 1; + } + std::string dir = argv[1]; if(dir.empty()) { dir = "."; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8074a01..5b336ce 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -3,7 +3,7 @@ macro(ADD_TEST_MACRO NAME COMMAND) string(REPLACE "." "/" dir "${NAME}") string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") - add_test(${NAME} ${CMAKE_CTEST_COMMAND} + add_test(NAME "${NAME}" COMMAND "${CMAKE_CTEST_COMMAND}" --build-and-test "${CMake_SOURCE_DIR}/Tests/${dir}" "${CMake_BINARY_DIR}/Tests/${dir}" @@ -45,26 +45,27 @@ configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in # Testing if(BUILD_TESTING) - set(CMAKE_TEST_DEVENV "") - if(NOT CMAKE_TEST_DIFFERENT_GENERATOR) - if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio") - set(CMAKE_TEST_MAKEPROGRAM "") - else() - set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}") - endif() - if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio [7-9] " AND - NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]") - set(CMAKE_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}") - endif() + set(CMake_TEST_DEVENV "") + if(CMAKE_GENERATOR MATCHES "Visual Studio [7-9] " AND + NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]") + set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}") endif() - if("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32)) - set(TEST_CompileCommandOutput 1) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "") + else() + set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") + endif() + + if(NOT CMake_TEST_EXTERNAL_CMAKE) + if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_GENERATOR}" MATCHES Ninja AND NOT WIN32)) + set(TEST_CompileCommandOutput 1) + endif() endif() set(MAKE_IS_GNU ) - if(CMAKE_TEST_MAKEPROGRAM MATCHES make) - execute_process(COMMAND ${CMAKE_TEST_MAKEPROGRAM} no_such_target --version + if(CMAKE_MAKE_PROGRAM MATCHES make) + execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} no_such_target --version RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE out) if("${res}" STREQUAL "0") if("${out}" MATCHES "GNU") @@ -75,34 +76,43 @@ if(BUILD_TESTING) # some old versions of make simply cannot handle spaces in paths if (MAKE_IS_GNU OR - CMAKE_TEST_MAKEPROGRAM MATCHES "nmake|gmake|wmake" OR - CMAKE_TEST_GENERATOR MATCHES "Visual Studio|XCode|Borland") + CMAKE_MAKE_PROGRAM MATCHES "nmake|gmake|wmake" OR + CMAKE_GENERATOR MATCHES "Visual Studio|Xcode|Borland") set(MAKE_SUPPORTS_SPACES 1) else() set(MAKE_SUPPORTS_SPACES 0) endif() set(build_generator_args - --build-generator ${CMAKE_TEST_GENERATOR} + --build-generator ${CMAKE_GENERATOR} ) - if(CMAKE_TEST_GENERATOR_TOOLSET) + if(CMAKE_GENERATOR_PLATFORM) list(APPEND build_generator_args - --build-generator-toolset ${CMAKE_TEST_GENERATOR_TOOLSET} + --build-generator-platform ${CMAKE_GENERATOR_PLATFORM} + ) + endif() + if(CMAKE_GENERATOR_TOOLSET) + list(APPEND build_generator_args + --build-generator-toolset ${CMAKE_GENERATOR_TOOLSET} ) endif() set(build_options) - if(CMAKE_TEST_MAKEPROGRAM) - list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}) + if(CMake_TEST_EXPLICIT_MAKE_PROGRAM) + list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) endif() - add_subdirectory(CMakeLib) + if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_subdirectory(CMakeLib) + endif() add_subdirectory(CMakeOnly) add_subdirectory(RunCMake) add_subdirectory(FindPackageModeMakefileTest) - add_subdirectory(CTestTestMemcheck) + if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_subdirectory(CTestTestMemcheck) + endif() # Collect a list of all test build directories. set(TEST_BUILD_DIRS) @@ -192,6 +202,9 @@ if(BUILD_TESTING) ADD_TEST_MACRO(TarTest TarTest) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) + ADD_TEST_MACRO(CompileFeatures CompileFeatures) + ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features) + # assume no resources building to test set(TEST_RESOURCES FALSE) # for windows and cygwin assume we have resources @@ -199,8 +212,8 @@ if(BUILD_TESTING) set(TEST_RESOURCES TRUE) endif() # for borland and watcom there is no resource support - if("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR - "${CMAKE_TEST_GENERATOR}" MATCHES "Borland") + if("${CMAKE_GENERATOR}" MATCHES "WMake" OR + "${CMAKE_GENERATOR}" MATCHES "Borland") set(TEST_RESOURCES FALSE) endif() if(TEST_RESOURCES) @@ -249,7 +262,9 @@ if(BUILD_TESTING) ADD_TEST_MACRO(SetLang SetLang) ADD_TEST_MACRO(EmptyProperty EmptyProperty) ADD_TEST_MACRO(ExternalOBJ ExternalOBJ) - ADD_TEST_MACRO(LoadCommand LoadedCommand) + if(NOT CMake_TEST_EXTERNAL_CMAKE) + ADD_TEST_MACRO(LoadCommand LoadedCommand) + endif() ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory) ADD_TEST_MACRO(LinkLanguage LinkLanguage) ADD_TEST_MACRO(LinkLine LinkLine) @@ -260,7 +275,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(Assembler HelloAsm) ADD_TEST_MACRO(SourceGroups SourceGroups) ADD_TEST_MACRO(Preprocess Preprocess) - set(ExportImport_BUILD_OPTIONS -DCMAKE_TEST_MAKEPROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}) + set(ExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) ADD_TEST_MACRO(ExportImport ExportImport) ADD_TEST_MACRO(Unset Unset) ADD_TEST_MACRO(PolicyScope PolicyScope) @@ -271,12 +286,30 @@ if(BUILD_TESTING) ADD_TEST_MACRO(AliasTarget AliasTarget) ADD_TEST_MACRO(StagingPrefix StagingPrefix) ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary) + if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]") + set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=Debug) + ADD_TEST_MACRO(ConfigSources ConfigSources) + endif() + ADD_TEST_MACRO(SourcesProperty SourcesProperty) + if(CMAKE_CXX_COMPILER_ID STREQUAL GNU + AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + set(runCxxDialectTest 1) + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang + AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.9) + if(NOT APPLE OR POLICY CMP0025) + set(runCxxDialectTest 1) + endif() + endif() + if(runCxxDialectTest) + ADD_TEST_MACRO(CxxDialect CxxDialect) + endif() set_tests_properties(EmptyLibrary PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target: test") ADD_TEST_MACRO(CrossCompile CrossCompile) set_tests_properties(CrossCompile PROPERTIES PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode") - if("${CMAKE_TEST_GENERATOR}" MATCHES "Make") + if("${CMAKE_GENERATOR}" MATCHES "Make") ADD_TEST_MACRO(Policy0002 Policy0002) endif() if(CTEST_TEST_OSX_ARCH) @@ -315,7 +348,7 @@ if(BUILD_TESTING) MINGW OR CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin") - if(NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake") + if(NOT "${CMAKE_GENERATOR}" STREQUAL "Watcom WMake") add_test(BundleUtilities ${CMAKE_CTEST_COMMAND} --build-and-test @@ -381,6 +414,9 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData") ADD_TEST_MACRO(Module.GenerateExportHeader GenerateExportHeader) + ADD_TEST_MACRO(Module.FindDependency FindDependency) + + ADD_TEST_MACRO(Module.WriteCompilerDetectionHeader WriteCompilerDetectionHeader) if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") include(CheckCXXCompilerFlag) @@ -465,7 +501,7 @@ if(BUILD_TESTING) # build the "Simple" test with the ExtraGenerators, if available # This doesn't test whether the generated project files work (unfortunately), # mainly it tests that cmake doesn't crash when generating these project files. - if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "KDevelop") # check which generators we have execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput) @@ -477,7 +513,8 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" --build-two-config --build-generator "Eclipse CDT4 - Unix Makefiles" - --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-project Simple --build-options ${build_options} --test-command Simple) @@ -492,7 +529,8 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" --build-two-config --build-generator "CodeBlocks - Unix Makefiles" - --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-project Simple --build-options ${build_options} --test-command Simple) @@ -506,7 +544,8 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" --build-two-config --build-generator "KDevelop3 - Unix Makefiles" - --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-project Simple --build-options ${build_options} --test-command Simple) @@ -517,7 +556,7 @@ if(BUILD_TESTING) # test for correct sub-project generation # not implemented in VS 6, VS 7.0, Xcode, or Ninja - if(NOT CMAKE_TEST_GENERATOR MATCHES "Visual Studio [67]$|Xcode|Ninja") + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio [67]$|Xcode|Ninja") # run cmake and configure all of SubProject # but only build the independent executable car add_test(SubProject ${CMAKE_CTEST_COMMAND} @@ -536,17 +575,18 @@ if(BUILD_TESTING) # the bar library which should be referenced because # foo links to the static library bar, but bar is not # directly in the foo sub project - if(CMAKE_TEST_MAKEPROGRAM) + if(CMake_TEST_EXPLICIT_MAKE_PROGRAM) set(SubProject-Stage2_BUILD_MAKEPROGRAM - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-makeprogram ${CMake_TEST_EXPLICIT_MAKE_PROGRAM} ) endif() add_test(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject/foo" "${CMake_BINARY_DIR}/Tests/SubProject/foo" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" ${SubProject-Stage2_BUILD_MAKEPROGRAM} --build-nocmake --build-project foo @@ -567,7 +607,7 @@ if(BUILD_TESTING) file(WRITE "${_TEST_DIR}/nightly-cmake.sh" "cd ${_TEST_DIR} ${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P ${CMake_SOURCE_DIR}/Utilities/Release/${script} -${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake +${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake ") add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) @@ -785,7 +825,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK}) set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK}) - if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") find_program(RPMBUILD NAMES rpmbuild) endif() # Do not try to build RPM @@ -821,6 +861,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(WIX_LIGHT_EXECUTABLE) add_test(CPackWiXGenerator ${CMAKE_CTEST_COMMAND} + -C \${CTEST_CONFIGURATION_TYPE} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator" "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator" @@ -829,7 +870,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options ${build_options} --test-command ${CMAKE_CMAKE_COMMAND} "-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator" + "-Dconfig=\${CTEST_CONFIGURATION_TYPE}" -P "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake") + + set_property(TEST CPackWiXGenerator PROPERTY + ATTACHED_FILES_ON_FAIL + "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator/_CPack_Packages/win32/WIX/wix.log") endif() endif() @@ -884,7 +930,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(APPLE) list(APPEND GENLST "DragNDrop") endif() - if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) if (NOT ${RPM_ACTIVE} EQUAL -1) list(APPEND GENLST "RPM") @@ -995,7 +1041,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CTEST_RUN_CMakeTestBadCommandLines) add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines - -D gen=${CMAKE_TEST_GENERATOR} + -D gen=${CMAKE_GENERATOR} -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake ) @@ -1010,7 +1056,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CTEST_RUN_CMakeTestMultipleConfigures) add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures - -D gen=${CMAKE_TEST_GENERATOR} + -D gen=${CMAKE_GENERATOR} -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestMultipleConfigures/RunCMake.cmake ) @@ -1018,16 +1064,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures") endif() - add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" - "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" - ${build_generator_args} - --build-project LoadCommand - --build-options ${build_options} - --test-command LoadedCommand - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") + if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" + "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" + ${build_generator_args} + --build-project LoadCommand + --build-options ${build_options} + --test-command LoadedCommand + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") + endif() add_test(complex ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1214,6 +1262,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set_tests_properties(ExternalProject PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) + add_test(ExternalProjectLocal ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/ExternalProjectLocal" + "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal" + ${build_generator_args} + --build-project ExternalProjectLocalTest + --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal" + --force-new-ctest-process + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal") + set_tests_properties(ExternalProjectLocal PROPERTIES + TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) + add_test(ExternalProjectUpdateSetup ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate" @@ -1233,8 +1296,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ COMMAND ${CMAKE_CMAKE_COMMAND} -DExternalProjectUpdate_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate -DExternalProjectUpdate_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate - -DCMAKE_TEST_GENERATOR=${CMAKE_TEST_GENERATOR} - -DCMAKE_TEST_GENERATOR_TOOLSET=${CMAKE_TEST_GENERATOR_TOOLSET} + -DCMAKE_GENERATOR=${CMAKE_GENERATOR} + -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} + -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DCMAKE_CTEST_COMMAND=${CMAKE_CTEST_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake ) @@ -1338,7 +1402,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency") - if("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + if(CMAKE_SYSTEM_NAME MATCHES syllable) # RPATH isn't supported under Syllable, so the tests don't # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR @@ -1405,7 +1469,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ${build_generator_args} --build-project MacRuntimePath --build-options ${build_options} - -DCMAKE_TEST_MAKEPROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM} + -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} ) endif() @@ -1452,20 +1516,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) endif() - if(NOT CMAKE_TEST_DIFFERENT_GENERATOR) - add_test(kwsys ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Source/kwsys" - "${CMake_BINARY_DIR}/Tests/kwsys" - ${build_generator_args} - --build-project kwsys - --build-options ${build_options} - --test-command kwsysTestsCxx testIOS - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") - endif() - - if(MAKE_SUPPORTS_SPACES) + if(MAKE_SUPPORTS_SPACES AND NOT CMAKE_GENERATOR STREQUAL "Xcode") add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDirSpaces" @@ -1511,19 +1562,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif () list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") - if(CMAKE_TEST_MSVC) + if(MSVC) ADD_TEST_MACRO(ForceInclude foo) ADD_TEST_MACRO(PDBDirectoryAndName myexe) ADD_TEST_MACRO(PrecompiledHeader foo) endif() - if(CMAKE_TEST_MSVC OR - "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles") + if(MSVC OR + "${CMAKE_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles") ADD_TEST_MACRO(ModuleDefinition example_exe) endif() ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables) - if("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + if("${CMAKE_GENERATOR}" MATCHES "Makefile") add_test(MakeClean ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/MakeClean" @@ -1545,10 +1596,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # Look for evidence that this is a VCExpress build. If so, avoid # the MFC test by default. - string(TOLOWER "${CMAKE_MAKE_PROGRAM};${CMAKE_TEST_MAKEPROGRAM}" mkprog) + string(TOLOWER "${CMAKE_MAKE_PROGRAM}" mkprog) if(mkprog MATCHES "vcexpress") message(STATUS - "CMAKE_TEST_MAKEPROGRAM indicates vcexpress, avoiding MFC test") + "CMAKE_MAKE_PROGRAM indicates vcexpress, avoiding MFC test") set(CTEST_RUN_MFC OFF) endif() @@ -1569,7 +1620,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # For the Watcom WMake generator, avoid the MFC test by default. if(CTEST_RUN_MFC) - if("${CMAKE_TEST_GENERATOR}" MATCHES "WMake") + if("${CMAKE_GENERATOR}" MATCHES "WMake") message(STATUS "using the Watcom WMake generator, avoiding MFC test") set(CTEST_RUN_MFC OFF) @@ -1642,13 +1693,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC") endif() - if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + if(MSVC AND NOT MSVC_VERSION LESS 1310 + AND NOT CMAKE_GENERATOR MATCHES "Visual Studio [67]( |$)" + AND (NOT CMAKE_GENERATOR MATCHES "Visual Studio [89]( |$)" + OR CMAKE_SIZEOF_VOID_P EQUAL 4) + ) + ADD_TEST_MACRO(VSMASM VSMASM) + endif() + + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") if(NOT MSVC60) ADD_TEST_MACRO(SBCS SBCS) endif() - if(NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [6789]( |$)" - AND NOT CMAKE_TEST_GENERATOR_TOOLSET) + if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [6789]( |$)" + AND NOT CMAKE_GENERATOR_TOOLSET) ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx) endif() @@ -1674,7 +1733,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command VSMidl) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") - if(CMAKE_TEST_DEVENV) + if(CMake_TEST_DEVENV) # The test (and tested property) works with .sln files, so it's skipped when: # * Using VS6, which doesn't use .sln files # * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file @@ -1686,9 +1745,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild" --build-config ${config} --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_DEVENV} - --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-generator ${CMAKE_GENERATOR} + --build-makeprogram ${CMake_TEST_DEVENV} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-project VSExcludeFromDefaultBuild --test-command ${CMAKE_COMMAND} -D "activeConfig=${config}" @@ -1704,21 +1764,72 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild") endif() - if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])") + if(CMAKE_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])") # This is Visual Studio 10 or above, so the default build tool is MSBuild. add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSProjectInSubdir" "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-project VSProjectInSubdir --build-target test) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir") endif() endif() + get_filename_component(ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME) + if(WIN32 AND ntver VERSION_GREATER 6.1) # Windows >= 8.0 + macro(add_test_VSWinStorePhone name generator systemName systemVersion) + add_test(NAME VSWinStorePhone.${name} COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSWinStorePhone" + "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}" + --build-generator "${generator}" + --build-project VSWinStorePhone + --build-config $<CONFIGURATION> + --build-options -DCMAKE_SYSTEM_NAME=${systemName} + -DCMAKE_SYSTEM_VERSION=${systemVersion} + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}") + endmacro() + + set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]") + set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]") + set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]") + set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]") + set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]") + set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]") + foreach(reg vs11 vs12 ws80 ws81 wp80 wp81) + get_filename_component(r "${reg_${reg}}" ABSOLUTE) + if(IS_DIRECTORY "${r}") + set(${reg} 1) + else() + set(${reg} 0) + endif() + endforeach() + if(vs11 AND ws80) + add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0) + add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012 ARM" WindowsStore 8.0) + add_test_VSWinStorePhone(vs11-store80-X64 "Visual Studio 11 2012 Win64" WindowsStore 8.0) + endif() + if(vs12 AND ws81) + add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) + add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) + add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + endif() + if(vs11 AND wp80) + add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) + add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012 ARM" WindowsPhone 8.0) + endif() + if(vs12 AND wp81) + add_test_VSWinStorePhone(vs12-phone81-X86 "Visual Studio 12 2013" WindowsPhone 8.1) + add_test_VSWinStorePhone(vs12-phone81-ARM "Visual Studio 12 2013 ARM" WindowsPhone 8.1) + endif() + endif() + if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(BundleTestInstallDir @@ -1750,7 +1861,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=\${CTEST_CONFIGURATION_TYPE} -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest - -Dgen=${CMAKE_TEST_GENERATOR} + -Dgen=${CMAKE_GENERATOR} -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") @@ -1798,12 +1909,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options ${build_options} "--warn-unused-vars") set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES - PASS_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:7 \\(set\\):") + PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):") set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES - FAIL_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:5 \\(set\\):") + FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") - if("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile" AND NOT WIN32) + if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND NOT WIN32) # Ninja does not support ADDITIONAL_MAKE_CLEAN_FILES and therefore fails # this test. (See #13371) # Apparently Visual Studio does not support it either. As the MakeClean @@ -1876,11 +1987,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # A test for ctest_build() with targets in subdirectories set(ctest_configure_options) - if(CMAKE_TEST_GENERATOR_TOOLSET) - list(APPEND ctest_configure_options -T ${CMAKE_TEST_GENERATOR_TOOLSET}) + if(CMAKE_GENERATOR_PLATFORM) + list(APPEND ctest_configure_options -A ${CMAKE_GENERATOR_PLATFORM}) + endif() + if(CMAKE_GENERATOR_TOOLSET) + list(APPEND ctest_configure_options -T ${CMAKE_GENERATOR_TOOLSET}) endif() - if(CMAKE_TEST_MAKEPROGRAM) - list(APPEND ctest_configure_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}) + if(CMake_TEST_EXPLICIT_MAKE_PROGRAM) + list(APPEND ctest_configure_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) endif() configure_file("${CMake_SOURCE_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake" @ONLY) @@ -2114,6 +2228,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ configure_file( "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/gtm_coverage.mcov.in" "${CMake_BINARY_DIR}/Testing/MumpsCoverage/gtm_coverage.mcov") + file(REMOVE_RECURSE "${CMake_BINARY_DIR}/Testing/MumpsCoverage/VistA-FOIA") file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA" DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCoverage") add_test(NAME CTestGTMCoverage @@ -2122,7 +2237,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ $<TARGET_FILE:ctest> -T Coverage --debug) set_tests_properties(CTestGTMCoverage PROPERTIES PASS_REGULAR_EXPRESSION - "Process file.*XINDEX.m.*Total LOC:.*127.*Percentage Coverage: 85.83.*" + "Process file.*ZZCOVTST.m.*Total LOC:.*30.*Percentage Coverage: 80.00*" ENVIRONMENT COVFILE=) configure_file( @@ -2131,6 +2246,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ configure_file( "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/cache_coverage.cmcov.in" "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/cache_coverage.cmcov") + file(REMOVE_RECURSE "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/VistA-FOIA") file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA" DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage") add_test(NAME CTestCacheCoverage @@ -2139,7 +2255,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ $<TARGET_FILE:ctest> -T Coverage --debug) set_tests_properties(CTestCacheCoverage PROPERTIES PASS_REGULAR_EXPRESSION - "Process file.*XINDEX.m.*Total LOC:.*125.*Percentage Coverage: 85.60.*" + "Process file.*ZZCOVTST.m.*Total LOC:.*29.*Percentage Coverage: 86.21.*" ENVIRONMENT COVFILE=) # Adding a test case for Python Coverage @@ -2160,6 +2276,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "Process file.*foo.py.*Total LOC:.*13.*Percentage Coverage: 84.62.*" ENVIRONMENT COVFILE=) + # Adding a test case for non-python Cobertura Coverage + configure_file( + "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/DartConfiguration.tcl.in" + "${CMake_BINARY_DIR}/Testing/CoberturaCoverage/DartConfiguration.tcl") + configure_file( + "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/coverage.xml.in" + "${CMake_BINARY_DIR}/Testing/CoberturaCoverage/coverage.xml") + file(COPY "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/src" + DESTINATION "${CMake_BINARY_DIR}/Testing/CoberturaCoverage") + add_test(NAME CTestCoberturaCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/CoberturaCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestCoberturaCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*CoverageTest.java.*Total LOC:.*18.*Percentage Coverage: 72.22.*" + ENVIRONMENT COVFILE=) + + + # Adding a test case for JaCoCo Coverage + configure_file( + "${CMake_SOURCE_DIR}/Tests/JacocoCoverage/DartConfiguration.tcl.in" + "${CMake_BINARY_DIR}/Testing/JacocoCoverage/DartConfiguration.tcl") + file(COPY "${CMake_SOURCE_DIR}/Tests/JacocoCoverage/Coverage" + DESTINATION "${CMake_BINARY_DIR}/Testing/JacocoCoverage") + add_test(NAME CTestJacocoCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/JacocoCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestJacocoCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*CoverageTest.java.*Total LOC:.*17.*Percentage Coverage: 76.47*" + ENVIRONMENT COVFILE=) + function(add_config_tests cfg) set(base "${CMake_BINARY_DIR}/Tests/CTestConfig") @@ -2219,7 +2369,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCrash/testOutput.log" ) # with watcom the SEGFAULT is not found, it just fails - if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + if(CMAKE_GENERATOR MATCHES "Watcom WMake") set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "Failed") else() @@ -2245,6 +2395,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestTestBadGenerator/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestTestBadGenerator ${CMAKE_CTEST_COMMAND} + -C "\${CTestTest_CONFIG}" + -S "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/testOutput.log" + ) + set_property(TEST CTestTestBadGenerator PROPERTY + PASS_REGULAR_EXPRESSION "could not create generator named \"Bad Generator\"") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestParallel/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" @ONLY ESCAPE_QUOTES) @@ -2289,6 +2451,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "All Labels:.* Label1.* Label2") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestTestLabelRegExp/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestLabelRegExp/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(NAME CTestTestLabelRegExp + COMMAND ${CMAKE_CMAKE_COMMAND} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR}/Tests/CTestTestLabelRegExp + -P ${CMAKE_BINARY_DIR}/Tests/CTestTestLabelRegExp/test.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Tests/CTestTestLabelRegExp + ) + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" @ONLY ESCAPE_QUOTES) @@ -2358,7 +2531,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/testOutput.log" ) set_tests_properties(CTestTestTimeout PROPERTIES - PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed") + PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*TestSleep *\\.+ *Passed.*timeout correctly killed child") add_test( NAME CTestTestRerunFailed @@ -2436,6 +2609,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(regex "${regex}|Error message was: ") set(regex "${regex}([Cc]ould *n.t resolve host") set(regex "${regex}|[Cc]ould *n.t connect to host") + set(regex "${regex}|Failed connect to") set(regex "${regex}|Empty reply from server") set(regex "${regex}|The requested URL returned error") set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)") @@ -2467,7 +2641,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if (CMAKE_TESTS_CDASH_SERVER) - set(regex "^([^:]+)://([^/]+)(/.*)$") + set(regex "^([^:]+)://([^/]+)(.*)$") if ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") set(protocol "${CMAKE_MATCH_1}") @@ -2475,8 +2649,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(path "${CMAKE_MATCH_3}") else () set(protocol "http") - set(server "www.cdash.org") - set(path "/CDash") + set(server "open.cdash.org") + set(path "") message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") message(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") endif () @@ -2498,7 +2672,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log" ) - if("${CMAKE_TEST_GENERATOR}" MATCHES "Makefiles" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Ninja") + if("${CMAKE_GENERATOR}" MATCHES "Makefiles" OR "${CMAKE_GENERATOR}" MATCHES "Ninja") configure_file("${CMake_SOURCE_DIR}/Tests/CTestTestLaunchers/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestLaunchers/test.cmake" @ONLY ESCAPE_QUOTES) add_test(CTestTestLaunchers ${CMAKE_CTEST_COMMAND} @@ -2535,7 +2709,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif () endif () - if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) + if("${CMAKE_GENERATOR}" MATCHES Xcode) set(CMAKE_SKIP_BOOTSTRAP_TEST 1) endif() if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") @@ -2580,7 +2754,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project testf --build-two-config --build-options ${build_options} - -DCMAKE_TEST_MAKEPROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM} + -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} --test-command testf) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") @@ -2607,7 +2781,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ find_package(Java COMPONENTS Development QUIET) if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW - AND NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Xcode") + AND NOT "${CMAKE_GENERATOR}" MATCHES "Xcode") get_filename_component(JNIPATH ${JAVA_COMPILE} PATH) find_file(JNI_H jni.h "${JNIPATH}/../include" @@ -2631,7 +2805,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif() # add some cross compiler tests, for now only with makefile based generators - if(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "KDevelop") # if sdcc is found, build the SimpleCOnly project with sdcc find_program(SDCC_EXECUTABLE sdcc) @@ -2784,5 +2958,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) endif() - add_subdirectory(CMakeTests) + if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_subdirectory(CMakeTests) + endif() endif() diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 691728a..15493be 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -8,11 +8,14 @@ endif () # Avoid ctest truncation of output message(STATUS "CTEST_FULL_OUTPUT") +set(ORIGINAL_MODULE_PATH "${CMAKE_MODULE_PATH}") + file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake" ) macro(do_find MODULE_NAME) message(STATUS " Checking Find${MODULE_NAME}") find_package(${MODULE_NAME}) + set(CMAKE_MODULE_PATH "${ORIGINAL_MODULE_PATH}") endmacro() # It is only possible to use either Qt3 or Qt4 in one project. diff --git a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt index 74f5451..2511064 100644 --- a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt +++ b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt @@ -20,13 +20,13 @@ endif () string(TOUPPER "${MAJOR_TEST_MODULE}" MODULE_UPPER) -if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND "${VERSION_VAR}") +if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${VERSION_VAR}) message(STATUS "${VERSION_VAR} is '${${VERSION_VAR}}'") - if ("${VERSION_VAR}" VERSION_LESS MAJOR_TEST_VERSION) + if (${VERSION_VAR} VERSION_LESS MAJOR_TEST_VERSION) message(SEND_ERROR "Found version ${${VERSION_VAR}} is less than requested major version ${MAJOR_TEST_VERSION}") endif () math(EXPR V_PLUS_ONE "${MAJOR_TEST_VERSION} + 1") - if ("${VERSION_VAR}" VERSION_GREATER V_PLUS_ONE) + if (${VERSION_VAR} VERSION_GREATER V_PLUS_ONE) message(SEND_ERROR "Found version ${${VERSION_VAR}} is greater than requested major version ${MAJOR_TEST_VERSION}") endif () endif () diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in index a266415..8d3258b 100644 --- a/Tests/CMakeOnly/Test.cmake.in +++ b/Tests/CMakeOnly/Test.cmake.in @@ -8,8 +8,9 @@ file(REMOVE_RECURSE "${binary_dir}") file(MAKE_DIRECTORY "${binary_dir}") execute_process( COMMAND ${CMAKE_COMMAND} ${CMAKE_ARGS} - "${source_dir}" -G "@CMAKE_TEST_GENERATOR@" - -T "@CMAKE_TEST_GENERATOR_TOOLSET@" + "${source_dir}" -G "@CMAKE_GENERATOR@" + -A "@CMAKE_GENERATOR_PLATFORM@" + -T "@CMAKE_GENERATOR_TOOLSET@" WORKING_DIRECTORY "${binary_dir}" RESULT_VARIABLE result ) diff --git a/Tests/CMakeTests/CheckCMakeTest.cmake b/Tests/CMakeTests/CheckCMakeTest.cmake index 7be7b30..1565394 100644 --- a/Tests/CMakeTests/CheckCMakeTest.cmake +++ b/Tests/CMakeTests/CheckCMakeTest.cmake @@ -9,8 +9,8 @@ function(check_cmake_test_single prefix test testfile) ERROR_VARIABLE stderr RESULT_VARIABLE result ) - string(REGEX REPLACE "\n" "\n out> " out " out> ${stdout}") - string(REGEX REPLACE "\n" "\n err> " err " err> ${stderr}") + string(REPLACE "\n" "\n out> " out " out> ${stdout}") + string(REPLACE "\n" "\n err> " err " err> ${stderr}") if(NOT "${result}" STREQUAL "${${test}-RESULT}") message(FATAL_ERROR "Test ${test} result is [${result}], not [${${test}-RESULT}].\n" diff --git a/Tests/CMakeTests/ExecuteScriptTests.cmake b/Tests/CMakeTests/ExecuteScriptTests.cmake index c71585a..bceac33 100644 --- a/Tests/CMakeTests/ExecuteScriptTests.cmake +++ b/Tests/CMakeTests/ExecuteScriptTests.cmake @@ -52,9 +52,9 @@ function(execute_all_script_tests scriptname result) foreach(line ${script}) if(line MATCHES "${regex}") + set(testname "${CMAKE_MATCH_2}") + set(expected_result "${CMAKE_MATCH_3}") math(EXPR count "${count} + 1") - string(REGEX REPLACE "${regex}" "\\2" testname "${line}") - string(REGEX REPLACE "${regex}" "\\3" expected_result "${line}") execute_one_script_test(${scriptname} ${testname} ${expected_result}) endif() endforeach() diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt index d673d14..638e788 100644 --- a/Tests/CPackWiXGenerator/CMakeLists.txt +++ b/Tests/CPackWiXGenerator/CMakeLists.txt @@ -9,6 +9,11 @@ target_link_libraries(my-libapp mylib) add_executable(my-other-app myotherapp.cpp) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty + DESTINATION extras + COMPONENT extras) + install(TARGETS mylib ARCHIVE DESTINATION lib @@ -58,6 +63,9 @@ set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt") +set(CPACK_WIX_PROPERTY_ARPCOMMENTS "My Custom ARPCOMMENTS") +set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.cmake.org") + include(CPack) cpack_add_install_type(Full DISPLAY_NAME "Everything") @@ -69,6 +77,12 @@ cpack_add_component_group(Development EXPANDED DESCRIPTION "All of the tools you'll ever need to develop software") +cpack_add_component(extras + DISPLAY_NAME "Extras" + DESCRIPTION "Extras" + GROUP Runtime + INSTALL_TYPES Full) + cpack_add_component(applications REQUIRED DISPLAY_NAME "MyLib Application" diff --git a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake index 30e33cf2..ca9fd90 100644 --- a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake +++ b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake @@ -10,7 +10,12 @@ message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}") message(STATUS "CMAKE_CPACK_COMMAND: ${CMAKE_CPACK_COMMAND}") message(STATUS "CPackWiXGenerator_BINARY_DIR: ${CPackWiXGenerator_BINARY_DIR}") +if(config) + set(_C_config -C ${config}) +endif() + execute_process(COMMAND "${CMAKE_CPACK_COMMAND}" + ${_C_config} RESULT_VARIABLE CPack_result OUTPUT_VARIABLE CPack_output ERROR_VARIABLE CPack_error diff --git a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in index abf010b..670a874 100644 --- a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in +++ b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.10) set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/VSProjectInSubdir") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestBuildCommandProjectInSubdir/Nested") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") set(CTEST_PROJECT_NAME "VSProjectInSubdir") set(CTEST_BUILD_CONFIGURATION "@CTestTest_CONFIG@") diff --git a/Tests/CTestConfig/dashboard.cmake.in b/Tests/CTestConfig/dashboard.cmake.in index 0bba6d6..143fe71 100644 --- a/Tests/CTestConfig/dashboard.cmake.in +++ b/Tests/CTestConfig/dashboard.cmake.in @@ -18,8 +18,9 @@ endif() message("cmake initial configure") execute_process(COMMAND ${CMAKE_COMMAND} ${arg} - -G "@CMAKE_TEST_GENERATOR@" - -T "@CMAKE_TEST_GENERATOR_TOOLSET@" + -G "@CMAKE_GENERATOR@" + -A "@CMAKE_GENERATOR_PLATFORM@" + -T "@CMAKE_GENERATOR_TOOLSET@" ${CTEST_SOURCE_DIRECTORY} WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} RESULT_VARIABLE rv) diff --git a/Tests/CTestConfig/script.cmake.in b/Tests/CTestConfig/script.cmake.in index 83267a4..b6ccedb 100644 --- a/Tests/CTestConfig/script.cmake.in +++ b/Tests/CTestConfig/script.cmake.in @@ -1,5 +1,6 @@ -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_PROJECT_NAME "CTestConfig") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestConfig") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestConfig/@cfg@-script") diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in index ab39b88..bb6346b 100644 --- a/Tests/CTestTest/test.cmake.in +++ b/Tests/CTestTest/test.cmake.in @@ -41,6 +41,7 @@ set (CTEST_INITIAL_CACHE " SITE:STRING=@SITE@ BUILDNAME:STRING=SmallAndFast-@BUILDNAME@ CMAKE_GENERATOR:INTERNAL=@CMAKE_GENERATOR@ +CMAKE_GENERATOR_PLATFORM:INTERNAL=@CMAKE_GENERATOR_PLATFORM@ CMAKE_GENERATOR_TOOLSET:INTERNAL=@CMAKE_GENERATOR_TOOLSET@ CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in index c5a7b45..852bb6b 100644 --- a/Tests/CTestTest2/test.cmake.in +++ b/Tests/CTestTest2/test.cmake.in @@ -9,6 +9,7 @@ set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Source/kwsys") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") diff --git a/Tests/CTestTestBadExe/CTestConfig.cmake b/Tests/CTestTestBadExe/CTestConfig.cmake index 1d46ea3..c7286e2 100644 --- a/Tests/CTestTestBadExe/CTestConfig.cmake +++ b/Tests/CTestTestBadExe/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestBadExe") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in index a7420fc..43a8572 100644 --- a/Tests/CTestTestBadExe/test.cmake.in +++ b/Tests/CTestTestBadExe/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-BadExe") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadExe") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestBadGenerator/CMakeLists.txt b/Tests/CTestTestBadGenerator/CMakeLists.txt new file mode 100644 index 0000000..d46d9bf --- /dev/null +++ b/Tests/CTestTestBadGenerator/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(CTestTestDepends NONE) +include(CTest) diff --git a/Tests/CTestTestBadGenerator/CTestConfig.cmake b/Tests/CTestTestBadGenerator/CTestConfig.cmake new file mode 100644 index 0000000..1e61bf4 --- /dev/null +++ b/Tests/CTestTestBadGenerator/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestBadGenerator") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestBadGenerator/test.cmake.in b/Tests/CTestTestBadGenerator/test.cmake.in new file mode 100644 index 0000000..ae6d0b5 --- /dev/null +++ b/Tests/CTestTestBadGenerator/test.cmake.in @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.0) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") + +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadGenerator") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadGenerator") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "Bad Generator") +set(CTEST_CMAKE_GENERATOR_PLATFORM "") +set(CTEST_CMAKE_GENERATOR_TOOLSET "") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in index b18cdf3..32d62bb 100644 --- a/Tests/CTestTestChecksum/test.cmake.in +++ b/Tests/CTestTestChecksum/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake index d2c28f9..4458348 100644 --- a/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake +++ b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestConfigFileInBuildDir") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in index 42225d3..6d29af7 100644 --- a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in +++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuild set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in index 010fe1c..fb298d4 100644 --- a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in +++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuild set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCostSerial/CTestConfig.cmake b/Tests/CTestTestCostSerial/CTestConfig.cmake index 05c20eb..3ab99ac 100644 --- a/Tests/CTestTestCostSerial/CTestConfig.cmake +++ b/Tests/CTestTestCostSerial/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestCostSerial") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index e2dda95..9b32a46 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-CostSerial") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCrash/CTestConfig.cmake b/Tests/CTestTestCrash/CTestConfig.cmake index e1c5b1b..5c2ca0e 100644 --- a/Tests/CTestTestCrash/CTestConfig.cmake +++ b/Tests/CTestTestCrash/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestCrash") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in index 7ac1bb9..3641cb0 100644 --- a/Tests/CTestTestCrash/test.cmake.in +++ b/Tests/CTestTestCrash/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Crash") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCrash") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCycle/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake index 43e9986..8aeb09b 100644 --- a/Tests/CTestTestCycle/CTestConfig.cmake +++ b/Tests/CTestTestCycle/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestCycle") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in index 94b9cac..4a63dd6 100644 --- a/Tests/CTestTestCycle/test.cmake.in +++ b/Tests/CTestTestCycle/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake index e3af7dd..7af9200 100644 --- a/Tests/CTestTestDepends/CTestConfig.cmake +++ b/Tests/CTestTestDepends/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestDepends") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in index 98b2a27..74fddb3 100644 --- a/Tests/CTestTestDepends/test.cmake.in +++ b/Tests/CTestTestDepends/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in index 36a09cf..5ff836f 100644 --- a/Tests/CTestTestFailedSubmits/test.cmake.in +++ b/Tests/CTestTestFailedSubmits/test.cmake.in @@ -21,6 +21,7 @@ set(CTEST_SOURCE_DIRECTORY "@source@") set(CTEST_BINARY_DIRECTORY "@build@") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") diff --git a/Tests/CTestTestFailure/CTestConfig.cmake b/Tests/CTestTestFailure/CTestConfig.cmake index fd8d97a..07e1be0 100644 --- a/Tests/CTestTestFailure/CTestConfig.cmake +++ b/Tests/CTestTestFailure/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestFailure") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in index 1dee1ae..86333af 100644 --- a/Tests/CTestTestFailure/testNoBuild.cmake.in +++ b/Tests/CTestTestFailure/testNoBuild.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoBuild") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in index 04e444d..8875cee 100644 --- a/Tests/CTestTestFailure/testNoExe.cmake.in +++ b/Tests/CTestTestFailure/testNoExe.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoExe") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFdSetSize/test.cmake.in b/Tests/CTestTestFdSetSize/test.cmake.in index c24f505..bfe4459 100644 --- a/Tests/CTestTestFdSetSize/test.cmake.in +++ b/Tests/CTestTestFdSetSize/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-FdSetSize") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFdSetSize") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFdSetSize") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in b/Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in new file mode 100644 index 0000000..657f382 --- /dev/null +++ b/Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in @@ -0,0 +1,8 @@ +add_test(test1 ${CMAKE_COMMAND} -E echo test1) +set_tests_properties(test1 PROPERTIES LABELS "foo") + +add_test(test2 ${CMAKE_COMMAND} -E echo test2) +set_tests_properties(test2 PROPERTIES LABELS "bar") + +add_test(test3 ${CMAKE_COMMAND} -E echo test3) +set_tests_properties(test3 PROPERTIES LABELS "foo;bar") diff --git a/Tests/CTestTestLabelRegExp/test.cmake.in b/Tests/CTestTestLabelRegExp/test.cmake.in new file mode 100644 index 0000000..5c0c9d7 --- /dev/null +++ b/Tests/CTestTestLabelRegExp/test.cmake.in @@ -0,0 +1,37 @@ +configure_file(${SOURCE_DIR}/CTestTestfile.cmake.in CTestTestfile.cmake) + +function(get_test_list TEST_LIST) + set(QUERY_COMMAND ${CMAKE_CTEST_COMMAND} -N ${ARGN}) + + execute_process(COMMAND ${QUERY_COMMAND} + RESULT_VARIABLE RESULT + OUTPUT_VARIABLE OUTPUT + ERROR_VARIABLE ERROR) + + if(NOT ${RESULT} STREQUAL "0") + message(FATAL_ERROR "command [${QUERY_COMMAND}] failed: RESULT[${RESULT}] OUTPUT[${OUTPUT}] ERROR[${ERROR}]") + endif() + + set(${TEST_LIST} "${OUTPUT}" PARENT_SCOPE) +endfunction() + +function(expect_test_list EXPECTED_OUTPUT) + get_test_list(TEST_LIST ${ARGN}) + + if(NOT "${TEST_LIST}" MATCHES "${EXPECTED_OUTPUT}") + message(FATAL_ERROR "actual output [${TEST_LIST}] does not match expected output [${EXPECTED_OUTPUT}] for given arguments [${ARGN}]") + endif() +endfunction() + +expect_test_list("test1.*test3.*Total Tests: 2" --label-regex foo) +expect_test_list("test2.*test3.*Total Tests: 2" --label-regex bar) +expect_test_list("test1.*test2.*test3.*Total Tests: 3" --label-regex foo|bar) +expect_test_list("Total Tests: 0" --label-regex baz) + +expect_test_list("test2.*Total Tests: 1" --label-exclude foo) +expect_test_list("test1.*Total Tests: 1" --label-exclude bar) +expect_test_list("Total Tests: 0" --label-exclude foo|bar) +expect_test_list("test1.*test2.*test3.*Total Tests: 3" --label-exclude baz) + +expect_test_list("test1.*Total Tests: 1" --label-regex foo --label-exclude bar) +expect_test_list("test2.*Total Tests: 1" --label-regex bar --label-exclude foo) diff --git a/Tests/CTestTestLaunchers/launcher_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_test_project/CTestConfig.cmake index bf404ab..669b0fb 100644 --- a/Tests/CTestTestLaunchers/launcher_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_test_project/CTestConfig.cmake @@ -3,6 +3,6 @@ set(CTEST_PROJECT_NAME "CTestTestLaunchers") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestLaunchers/test.cmake.in b/Tests/CTestTestLaunchers/test.cmake.in index 43a6533..03a118a 100644 --- a/Tests/CTestTestLaunchers/test.cmake.in +++ b/Tests/CTestTestLaunchers/test.cmake.in @@ -9,6 +9,7 @@ set(CTEST_BUILD_NAME "Launchers-@BUILDNAME@-CTestTestLauncher set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_SOURCE}/launcher_test_project") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/launcher_test_project-bin") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 9bd7249..3ad0b26 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -19,14 +19,6 @@ add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind) target_link_libraries(pseudo_valgrind CMakeLib) -# 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_valgrind - PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" - ) -endif() - add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify) target_link_libraries(pseudo_purify CMakeLib) @@ -111,6 +103,54 @@ unset(CTEST_EXTRA_CONFIG) unset(CTEST_EXTRA_CODE) unset(CMAKELISTS_EXTRA_CODE) +# add ThreadSanitizer test +set(CTEST_EXTRA_CODE +"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"report_bugs=1 history_size=5 exitcode=55\") +") + +set(CMAKELISTS_EXTRA_CODE +"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\" +-P \"${CMAKE_CURRENT_SOURCE_DIR}/testThreadSanitizer.cmake\") +") +gen_mc_test_internal(DummyThreadSanitizer "" -DMEMCHECK_TYPE=ThreadSanitizer) +set_tests_properties(CTestTestMemcheckDummyThreadSanitizer PROPERTIES + PASS_REGULAR_EXPRESSION + ".*Memory checking results:.*data race.* - 1.*data race on vptr .ctor/dtor vs virtual call. - 1.*heap-use-after-free - 1.*thread leak - 1.*destroy of a locked mutex - 1.*double lock of a mutex - 1.*unlock of an unlocked mutex .or by a wrong thread. - 1.*read lock of a write locked mutex - 1.*read unlock of a write locked mutex - 1.*signal-unsafe call inside of a signal - 1.*signal handler spoils errno - 1.*lock-order-inversion .potential deadlock. - 1.*") +set(CMAKELISTS_EXTRA_CODE ) +set(CTEST_EXTRA_CODE) + +# add LeakSanitizer test +set(CTEST_EXTRA_CODE +"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\") +") + +set(CMAKELISTS_EXTRA_CODE +"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\" +-P \"${CMAKE_CURRENT_SOURCE_DIR}/testLeakSanitizer.cmake\") +") +gen_mc_test_internal(DummyLeakSanitizer "" -DMEMCHECK_TYPE=AddressSanitizer) +set(CMAKELISTS_EXTRA_CODE ) +set(CTEST_EXTRA_CODE) +set_tests_properties(CTestTestMemcheckDummyLeakSanitizer PROPERTIES + PASS_REGULAR_EXPRESSION + ".*Memory checking results:.*Direct leak - 2.*Indirect leak - 1.*") +# add AddressSanitizer test +set(CTEST_EXTRA_CODE +"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\") +") + +set(CMAKELISTS_EXTRA_CODE +"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\" +-P \"${CMAKE_CURRENT_SOURCE_DIR}/testAddressSanitizer.cmake\") +") +gen_mc_test_internal(DummyAddressSanitizer "" -DMEMCHECK_TYPE=AddressSanitizer) +set(CMAKELISTS_EXTRA_CODE ) +set(CTEST_EXTRA_CODE) +set_tests_properties(CTestTestMemcheckDummyAddressSanitizer PROPERTIES + PASS_REGULAR_EXPRESSION + ".*Memory checking results:.*heap-buffer-overflow - 1.*") + + gen_mc_test(DummyPurify "\${PSEUDO_PURIFY}") gen_mc_test(DummyValgrind "\${PSEUDO_VALGRIND}") gen_mc_test(DummyBC "\${PSEUDO_BC}") @@ -185,7 +225,7 @@ set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*${ctest_and_tool_outputs}$") set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES - PASS_REGULAR_EXPRESSION "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n(.*\n)?Error parsing XML in stream at line 1: no element found\n") + PASS_REGULAR_EXPRESSION "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n${guard_malloc_lines}\n100% tests passed, 0 tests failed out of 1\n(.*\n)?Error parsing XML in stream at line 1: no element found\n") set_tests_properties(CTestTestMemcheckDummyValgrindInvalidSupFile PROPERTIES PASS_REGULAR_EXPRESSION "\nCannot find memory checker suppression file: ${CTEST_ESCAPED_REALPATH_CMAKE_CURRENT_BINARY_DIR}/does-not-exist\n") @@ -196,3 +236,19 @@ set_tests_properties(CTestTestMemcheckDummyValgrindCustomOptions PROPERTIES set_tests_properties(CTestTestMemcheckDummyValgrindTwoTargets PROPERTIES PASS_REGULAR_EXPRESSION "\nMemory check project ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindTwoTargets\n.*\n *Start 1: RunCMake\n(.*\n)?Memory check command: .* \"--log-file=${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindTwoTargets/Testing/Temporary/MemoryChecker.1.log\" \"-q\".*\n *Start 2: RunCMakeAgain\n(.*\n)?Memory check command: .* \"--log-file=${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindTwoTargets/Testing/Temporary/MemoryChecker.2.log\" \"-q\".*\n") + + +# 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]") + foreach(t + memcheck_fail + pseudo_BC + pseudo_purify + pseudo_valgrind + ) + add_custom_command(TARGET ${t} + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) + endforeach() +endif() diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt.in b/Tests/CTestTestMemcheck/CMakeLists.txt.in index e28e56a..d15d148 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt.in +++ b/Tests/CTestTestMemcheck/CMakeLists.txt.in @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheck@SUBTEST_NAME@) +project(CTestTestMemcheck@SUBTEST_NAME@ NONE) include(CTest) add_test(NAME RunCMake COMMAND "${CMAKE_COMMAND}" --version) diff --git a/Tests/CTestTestMemcheck/CTestConfig.cmake.in b/Tests/CTestTestMemcheck/CTestConfig.cmake.in index 6cf3782..19c76c2 100644 --- a/Tests/CTestTestMemcheck/CTestConfig.cmake.in +++ b/Tests/CTestTestMemcheck/CTestConfig.cmake.in @@ -2,8 +2,8 @@ set (CTEST_PROJECT_NAME "CTestTestMemcheck@SUBTEST_NAME@") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) @CTEST_EXTRA_CONFIG@ diff --git a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt index c5aa2cd..3a45bfe 100644 --- a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt @@ -1,17 +1,22 @@ # A dummy checker implementation that does not write the requested output file # so it triggers an error for every checker. -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" "int main(){return 0;}\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(){return 0;}\n") + +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" + "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" + ) foreach(_pseudo IN ITEMS valgrind purify BC) add_executable(pseudonl_${_pseudo} "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") set_target_properties(pseudonl_${_pseudo} PROPERTIES OUTPUT_NAME ${_pseudo}) -endforeach() -# 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 pseudonl_valgrind + # 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 pseudonl_${_pseudo} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" ) -endif() + endif() +endforeach() diff --git a/Tests/CTestTestMemcheck/memtester.cxx.in b/Tests/CTestTestMemcheck/memtester.cxx.in index 55a34e3..43c0ba7 100644 --- a/Tests/CTestTestMemcheck/memtester.cxx.in +++ b/Tests/CTestTestMemcheck/memtester.cxx.in @@ -1,11 +1,19 @@ #include <cmSystemTools.h> +#include <cmsys/Encoding.hxx> #include <string> +#include <locale.h> #define RETVAL @_retval@ int -main(int argc, char **argv) +main(int ac, char **av) { + setlocale(LC_CTYPE, ""); + cmsys::Encoding::CommandLineArguments args = + cmsys::Encoding::CommandLineArguments::Main(ac, av); + int argc = args.argc(); + const char* const* argv = args.argv(); + std::string exename = argv[0]; std::string logarg; bool nextarg = false; diff --git a/Tests/CTestTestMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/test.cmake.in index 6c388c5..f2ffd06 100644 --- a/Tests/CTestTestMemcheck/test.cmake.in +++ b/Tests/CTestTestMemcheck/test.cmake.in @@ -8,13 +8,15 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Memcheck@SUBTEST_ set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/@SUBTEST_NAME@") set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/@SUBTEST_NAME@") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") set(CTEST_MEMORYCHECK_COMMAND "@CHECKER_COMMAND@") +set(CTEST_MEMORYCHECK_TYPE "${MEMCHECK_TYPE}") @CTEST_EXTRA_CODE@ diff --git a/Tests/CTestTestMemcheck/testAddressSanitizer.cmake b/Tests/CTestTestMemcheck/testAddressSanitizer.cmake new file mode 100644 index 0000000..a073151 --- /dev/null +++ b/Tests/CTestTestMemcheck/testAddressSanitizer.cmake @@ -0,0 +1,59 @@ +# this file simulates a program that has been built with thread sanitizer +# options + +message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]") +string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}") +message("LOG_FILE=[${LOG_FILE}]") + +# if we are not asked to simulate address sanitizer don't do it +if(NOT "$ENV{ASAN_OPTIONS}]" MATCHES "simulate_sanitizer.1") + return() +endif() +# clear the log file +file(REMOVE "${LOG_FILE}.2343") + +# create an error of each type of thread santizer +# these names come from tsan_report.cc in llvm + +file(APPEND "${LOG_FILE}.2343" +"================================================================= +==19278== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60080000bffc at pc 0x4009f1 bp 0x7fff82de6520 sp 0x7fff82de6518 +WRITE of size 4 at 0x60080000bffc thread T0 + #0 0x4009f0 (/home/kitware/msan/a.out+0x4009f0) + #1 0x7f18b02c876c (/lib/x86_64-linux-gnu/libc-2.15.so+0x2176c) + #2 0x400858 (/home/kitware/msan/a.out+0x400858) +0x60080000bffc is located 4 bytes to the right of 40-byte region [0x60080000bfd0,0x60080000bff8) +allocated by thread T0 here: + #0 0x7f18b088f9ca (/usr/lib/x86_64-linux-gnu/libasan.so.0.0.0+0x119ca) + #1 0x4009a2 (/home/kitware/msan/a.out+0x4009a2) + #2 0x7f18b02c876c (/lib/x86_64-linux-gnu/libc-2.15.so+0x2176c) +Shadow bytes around the buggy address: + 0x0c017fff97a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff97b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff97c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff97d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff97e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa +=>0x0c017fff97f0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00 00[fa] + 0x0c017fff9800:fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff9810: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff9820: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff9830: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c017fff9840: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa +Shadow byte legend (one shadow byte represents 8 application bytes): + Addressable: 00 + Partially addressable: 01 02 03 04 05 06 07 + Heap left redzone: fa + Heap righ redzone: fb + Freed Heap region: fd + Stack left redzone: f1 + Stack mid redzone: f2 + Stack right redzone: f3 + Stack partial redzone: f4 + Stack after return: f5 + Stack use after scope: f8 + Global redzone: f9 + Global init order: f6 + Poisoned by user: f7 + ASan internal: fe +==19278== ABORTING +") diff --git a/Tests/CTestTestMemcheck/testLeakSanitizer.cmake b/Tests/CTestTestMemcheck/testLeakSanitizer.cmake new file mode 100644 index 0000000..02030be --- /dev/null +++ b/Tests/CTestTestMemcheck/testLeakSanitizer.cmake @@ -0,0 +1,47 @@ +# this file simulates a program that has been built with thread sanitizer +# options + +message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]") +string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}") +message("LOG_FILE=[${LOG_FILE}]") +# if we are not asked to simulate leak sanitizer don't do it +if(NOT "$ENV{ASAN_OPTIONS}]" MATCHES "simulate_sanitizer.1") + return() +endif() + +# clear the log file +file(REMOVE "${LOG_FILE}.2343") +file(REMOVE "${LOG_FILE}.2344") + +# create an error of each type of thread santizer +# these names come from tsan_report.cc in llvm + +file(APPEND "${LOG_FILE}.2343" +"================================================================= +==25308==ERROR: LeakSanitizer: detected memory leaks + +Direct leak of 4360 byte(s) in 1 object(s) allocated from: + #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) + #1 0x4823b4 in main /home/kitware/msan/memcheck.cxx:12 + #2 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + +SUMMARY: AddressSanitizer: 4436 byte(s) leaked in 2 allocation(s). +") +file(APPEND "${LOG_FILE}.2342" +"================================================================= +==25308==ERROR: LeakSanitizer: detected memory leaks + +Direct leak of 76 byte(s) in 1 object(s) allocated from: + #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) + #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4 + #2 0x4823f2 in main /home/kitware/msan/memcheck.cxx:14 + #3 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + +Indirect leak of 76 byte(s) in 1 object(s) allocated from: + #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) + #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4 + #2 0x4823f2 in main /home/kitware/msan/memcheck.cxx:14 + #3 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + +SUMMARY: AddressSanitizer: 4436 byte(s) leaked in 2 allocation(s). +") diff --git a/Tests/CTestTestMemcheck/testThreadSanitizer.cmake b/Tests/CTestTestMemcheck/testThreadSanitizer.cmake new file mode 100644 index 0000000..d591931 --- /dev/null +++ b/Tests/CTestTestMemcheck/testThreadSanitizer.cmake @@ -0,0 +1,47 @@ +# this file simulates a program that has been built with thread sanitizer +# options + +message("TSAN_OPTIONS = [$ENV{TSAN_OPTIONS}]") +string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{TSAN_OPTIONS}") +message("LOG_FILE=[${LOG_FILE}]") + +set(error_types + "data race" + "data race on vptr (ctor/dtor vs virtual call)" + "heap-use-after-free" + "thread leak" + "destroy of a locked mutex" + "double lock of a mutex" + "unlock of an unlocked mutex (or by a wrong thread)" + "read lock of a write locked mutex" + "read unlock of a write locked mutex" + "signal-unsafe call inside of a signal" + "signal handler spoils errno" + "lock-order-inversion (potential deadlock)" + ) + +# clear the log file +file(REMOVE "${LOG_FILE}.2343") + +# create an error of each type of thread santizer +# these names come from tsan_report.cc in llvm +foreach(error_type ${error_types} ) + + file(APPEND "${LOG_FILE}.2343" +"================== +WARNING: ThreadSanitizer: ${error_type} (pid=27978) + Write of size 4 at 0x7fe017ce906c by thread T1: + #0 Thread1 ??:0 (exe+0x000000000bb0) + #1 <null> <null>:0 (libtsan.so.0+0x00000001b279) + + Previous write of size 4 at 0x7fe017ce906c by main thread: + #0 main ??:0 (exe+0x000000000c3c) + + Thread T1 (tid=27979, running) created by main thread at: + #0 <null> <null>:0 (libtsan.so.0+0x00000001ed7b) + #1 main ??:0 (exe+0x000000000c2c) + +SUMMARY: ThreadSanitizer: ${error_type} ??:0 Thread1 +================== +") +endforeach() diff --git a/Tests/CTestTestParallel/CTestConfig.cmake b/Tests/CTestTestParallel/CTestConfig.cmake index c3c5038..fc5b666 100644 --- a/Tests/CTestTestParallel/CTestConfig.cmake +++ b/Tests/CTestTestParallel/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestParallel") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in index 5826342..045a4ca 100644 --- a/Tests/CTestTestParallel/test.cmake.in +++ b/Tests/CTestTestParallel/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Parallel") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestResourceLock/CTestConfig.cmake b/Tests/CTestTestResourceLock/CTestConfig.cmake index 5fb560b..c118777 100644 --- a/Tests/CTestTestResourceLock/CTestConfig.cmake +++ b/Tests/CTestTestResourceLock/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestResourceLock") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in index f69b519..67dde18 100644 --- a/Tests/CTestTestResourceLock/test.cmake.in +++ b/Tests/CTestTestResourceLock/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ResourceLock") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestScheduler/CTestConfig.cmake b/Tests/CTestTestScheduler/CTestConfig.cmake index 7da8f6f..797387b 100644 --- a/Tests/CTestTestScheduler/CTestConfig.cmake +++ b/Tests/CTestTestScheduler/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestScheduler") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 26d8058..f8c8ab7 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Scheduler") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestScheduler") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake index ad8e00e..da0c76b 100644 --- a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake +++ b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestSkipReturnCode") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestSkipReturnCode/test.cmake.in b/Tests/CTestTestSkipReturnCode/test.cmake.in index ebee01b..112b0cd 100644 --- a/Tests/CTestTestSkipReturnCode/test.cmake.in +++ b/Tests/CTestTestSkipReturnCode/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-SkipReturnCode") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSkipReturnCode") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSkipReturnCode") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestStopTime/CTestConfig.cmake b/Tests/CTestTestStopTime/CTestConfig.cmake index 129db4d..412283e 100644 --- a/Tests/CTestTestStopTime/CTestConfig.cmake +++ b/Tests/CTestTestStopTime/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestStopTime") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in index d4e5a25..d3a9a4a 100644 --- a/Tests/CTestTestStopTime/test.cmake.in +++ b/Tests/CTestTestStopTime/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-StopTime") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopTime") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestSubdir/CTestConfig.cmake b/Tests/CTestTestSubdir/CTestConfig.cmake index 4b848aa..47ebb92 100644 --- a/Tests/CTestTestSubdir/CTestConfig.cmake +++ b/Tests/CTestTestSubdir/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestSubdir") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in index 2b4ef4f..8b3957b 100644 --- a/Tests/CTestTestSubdir/test.cmake.in +++ b/Tests/CTestTestSubdir/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Subdir") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdir") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestTimeout/CMakeLists.txt b/Tests/CTestTestTimeout/CMakeLists.txt index 476d0a5..c6cbc47 100644 --- a/Tests/CTestTestTimeout/CMakeLists.txt +++ b/Tests/CTestTestTimeout/CMakeLists.txt @@ -3,26 +3,19 @@ project(CTestTestTimeout) include(CTest) if(NOT TIMEOUT) - if(CYGWIN) - set(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load! - else() - set(TIMEOUT 1) - endif() + # Give the process time to load and start running. + set(TIMEOUT 4) endif() add_definitions(-DTIMEOUT=${TIMEOUT}) -add_executable (Timeout timeout.c) +add_executable (Sleep sleep.c) add_test(NAME TestTimeout - COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout> + COMMAND ${CMAKE_COMMAND} -D Sleep=$<TARGET_FILE:Sleep> -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log -P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake ) set_tests_properties(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT}) -add_test(NAME CheckChild - COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout> - -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log - -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake - ) -set_tests_properties(CheckChild PROPERTIES DEPENDS TestTimeout) +add_test(NAME TestSleep COMMAND Sleep) +set_tests_properties(TestSleep PROPERTIES DEPENDS TestTimeout) diff --git a/Tests/CTestTestTimeout/CTestConfig.cmake b/Tests/CTestTestTimeout/CTestConfig.cmake index 76d62ad..13114f1 100644 --- a/Tests/CTestTestTimeout/CTestConfig.cmake +++ b/Tests/CTestTestTimeout/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestTimeout") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestTimeout/check.cmake b/Tests/CTestTestTimeout/check.cmake deleted file mode 100644 index b16f2aa..0000000 --- a/Tests/CTestTestTimeout/check.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# Block just as long as timeout.cmake would if it were not killed. -execute_process(COMMAND ${Timeout}) - -# Verify that the log is empty, which indicates that the grandchild -# was killed before it finished sleeping. -file(READ "${Log}" LOG) -if(NOT "${LOG}" STREQUAL "") - message(FATAL_ERROR "${LOG}") -endif() diff --git a/Tests/CTestTestTimeout/sleep.c b/Tests/CTestTestTimeout/sleep.c new file mode 100644 index 0000000..33ce307 --- /dev/null +++ b/Tests/CTestTestTimeout/sleep.c @@ -0,0 +1,21 @@ +#if defined(_WIN32) +# include <windows.h> +#else +# include <unistd.h> +#endif + +#include <stdio.h> + +int main(void) +{ + fprintf(stderr, "before sleep\n"); + fflush(stderr); /* should not be needed, but just in case */ +#if defined(_WIN32) + Sleep((TIMEOUT+4)*1000); +#else + sleep((TIMEOUT+4)); +#endif + fprintf(stderr, "after sleep\n"); + fflush(stderr); /* should not be needed, but just in case */ + return 0; +} diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in index d3d0888..4b5157e 100644 --- a/Tests/CTestTestTimeout/test.cmake.in +++ b/Tests/CTestTestTimeout/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") @@ -24,3 +25,16 @@ CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + +set(log ${CTEST_BINARY_DIRECTORY}/timeout.log) +if(EXISTS "${log}") + # Verify that the timeout test did not finish sleeping. + file(STRINGS "${log}" after_sleep REGEX "after sleep") + if(after_sleep) + message(FATAL_ERROR "Log indicates timeout did not kill child.") + else() + message(STATUS "Log indicates timeout correctly killed child.") + endif() +else() + message(FATAL_ERROR "Log does not exist:\n ${log}") +endif() diff --git a/Tests/CTestTestTimeout/timeout.c b/Tests/CTestTestTimeout/timeout.c deleted file mode 100644 index 370ab22..0000000 --- a/Tests/CTestTestTimeout/timeout.c +++ /dev/null @@ -1,18 +0,0 @@ -#if defined(_WIN32) -# include <windows.h> -#else -# include <unistd.h> -#endif - -#include <stdio.h> - -int main(void) -{ -#if defined(_WIN32) - Sleep((TIMEOUT+4)*1000); -#else - sleep((TIMEOUT+4)); -#endif - printf("timeout process finished sleeping!\n"); - return -1; -} diff --git a/Tests/CTestTestTimeout/timeout.cmake b/Tests/CTestTestTimeout/timeout.cmake index 198cc97..0989b65 100644 --- a/Tests/CTestTestTimeout/timeout.cmake +++ b/Tests/CTestTestTimeout/timeout.cmake @@ -3,4 +3,4 @@ file(REMOVE ${Log}) # Run a child that sleeps longer than the timout of this test. # Log its output so check.cmake can verify it dies. -execute_process(COMMAND ${Timeout} OUTPUT_FILE ${Log}) +execute_process(COMMAND ${Sleep} ERROR_FILE ${Log}) diff --git a/Tests/CTestTestUpload/CTestConfig.cmake b/Tests/CTestTestUpload/CTestConfig.cmake index 89c5b94..a547088 100644 --- a/Tests/CTestTestUpload/CTestConfig.cmake +++ b/Tests/CTestTestUpload/CTestConfig.cmake @@ -2,6 +2,6 @@ set (CTEST_PROJECT_NAME "CTestTestUpload") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") set (CTEST_DROP_METHOD "http") -set (CTEST_DROP_SITE "www.cdash.org") -set (CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set (CTEST_DROP_SITE "open.cdash.org") +set (CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set (CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestUpload/test.cmake.in b/Tests/CTestTestUpload/test.cmake.in index 340877f..701439d 100644 --- a/Tests/CTestTestUpload/test.cmake.in +++ b/Tests/CTestTestUpload/test.cmake.in @@ -7,8 +7,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Upload") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestUpload") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestUpload") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") CTEST_START(Experimental) diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake index f8e0609..6094864 100644 --- a/Tests/CTestTestZeroTimeout/CTestConfig.cmake +++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake @@ -2,6 +2,6 @@ set(CTEST_PROJECT_NAME "CTestTestZeroTimeout") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in index 3252754..b829fef 100644 --- a/Tests/CTestTestZeroTimeout/test.cmake.in +++ b/Tests/CTestTestZeroTimeout/test.cmake.in @@ -8,8 +8,9 @@ set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ZeroTimeout") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout") set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index 642a618..97153f0 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -9,7 +9,7 @@ function(run_child) ERROR_STRIP_TRAILING_WHITESPACE ) if(FAILED) - string(REGEX REPLACE "\n" "\n " OUTPUT "${OUTPUT}") + string(REPLACE "\n" "\n " OUTPUT "${OUTPUT}") message(FATAL_ERROR "Child failed (${FAILED}), output is\n ${OUTPUT}\n" "Command = [${ARGN}]\n") endif() @@ -108,7 +108,7 @@ function(check_updates build) ${TOP}/${build}/Testing/Temporary/LastUpdate*.log) if(UPDATE_LOG_FILE) file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size}) - string(REGEX REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") + string(REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") set(MSG "${MSG}Update log:\n ${UPDATE_LOG}") else() set(MSG "${MSG}No update log found!") @@ -219,6 +219,36 @@ function(run_dashboard_command_line bin_dir) endfunction() #----------------------------------------------------------------------------- +# Function to find the Update.xml file and make sure +# it only has the Revision in it and no updates +function(check_no_update bin_dir) + set(PATTERN ${TOP}/${bin_dir}/Testing/*/Update.xml) + file(GLOB UPDATE_XML_FILE RELATIVE ${TOP} ${PATTERN}) + string(REGEX REPLACE "//Update.xml$" "/Update.xml" + UPDATE_XML_FILE "${UPDATE_XML_FILE}") + message(" found ${UPDATE_XML_FILE}") + set(rev_regex "Revision|PriorRevision") + file(STRINGS ${TOP}/${UPDATE_XML_FILE} UPDATE_XML_REVISIONS + REGEX "^\t<(${rev_regex})>[^<\n]+</(${rev_regex})>$" + ) + set(found_revisons FALSE) + foreach(r IN LISTS UPDATE_XML_REVISIONS) + if("${r}" MATCHES "PriorRevision") + message(FATAL_ERROR "Found PriorRevision in no update test") + endif() + if("${r}" MATCHES "<Revision>") + set(found_revisons TRUE) + endif() + endforeach() + if(found_revisons) + message(" found <Revision> in no update test") + else() + message(FATAL_ERROR " missing <Revision> in no update test") + endif() +endfunction() + + +#----------------------------------------------------------------------------- # Function to run the dashboard through a script function(run_dashboard_script bin_dir) run_child( @@ -228,13 +258,17 @@ function(run_dashboard_script bin_dir) # Verify the updates reported by CTest. list(APPEND UPDATE_MAYBE Updated{subdir} Updated{CTestConfig.cmake}) - check_updates(${bin_dir} - Updated{foo.txt} - Updated{bar.txt} - Updated{zot.txt} - Updated{subdir/foo.txt} - Updated{subdir/bar.txt} - ) + if(NO_UPDATE) + check_no_update(${bin_dir}) + else() + check_updates(${bin_dir} + Updated{foo.txt} + Updated{bar.txt} + Updated{zot.txt} + Updated{subdir/foo.txt} + Updated{subdir/bar.txt} + ) + endif() endfunction() #----------------------------------------------------------------------------- diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index f6939de..41b732b 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -317,3 +317,20 @@ set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master) # Run the dashboard script with CTest. run_dashboard_script(dash-binary-custom) + + +rewind_source(dash-source) + +#----------------------------------------------------------------------------- +# Test no update with a dashboard script. +message("Running CTest Dashboard Script (No update)...") + +create_dashboard_script(dash-binary-no-update + "# git command configuration +set(CTEST_GIT_COMMAND \"${GIT}\") +set(CTEST_UPDATE_VERSION_ONLY TRUE) +") + +# Run the dashboard script with CTest. +set(NO_UPDATE 1) +run_dashboard_script(dash-binary-no-update) diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt index 69cfdb8..87b7f1a 100644 --- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt +++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt @@ -40,6 +40,9 @@ endif() if(DEFINED MSVC12) math(EXPR msvc_total "${msvc_total} + 1") endif() +if(DEFINED MSVC14) + math(EXPR msvc_total "${msvc_total} + 1") +endif() echo_var(MSVC) echo_var(MSVC60) @@ -50,6 +53,7 @@ echo_var(MSVC90) echo_var(MSVC10) echo_var(MSVC11) echo_var(MSVC12) +echo_var(MSVC14) echo_var(MSVC_IDE) if(MSVC) diff --git a/Tests/CoberturaCoverage/DartConfiguration.tcl.in b/Tests/CoberturaCoverage/DartConfiguration.tcl.in new file mode 100644 index 0000000..954f59a --- /dev/null +++ b/Tests/CoberturaCoverage/DartConfiguration.tcl.in @@ -0,0 +1,8 @@ +# This file is configured by CMake automatically as DartConfiguration.tcl +# If you choose not to use CMake, this file may be hand configured, by +# filling in the required variables. + + +# Configuration directories and files +SourceDirectory: ${CMake_SOURCE_DIR}/Testing/CoberturaCoverage +BuildDirectory: ${CMake_BINARY_DIR}/Testing/CoberturaCoverage diff --git a/Tests/CoberturaCoverage/coverage.xml.in b/Tests/CoberturaCoverage/coverage.xml.in new file mode 100644 index 0000000..b3f6691 --- /dev/null +++ b/Tests/CoberturaCoverage/coverage.xml.in @@ -0,0 +1,112 @@ +<?xml version="1.0"?> +<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd"> + +<coverage line-rate="0.7222222222222222" branch-rate="0.875" lines-covered="13" lines-valid="18" branches-covered="7" branches-valid="8" complexity="0.0" version="1.9.4.1" timestamp="1401890139281"> + <sources> + <source>${CMake_BINARY_DIR}/Testing/CoberturaCoverage/src/main/java/</source> + </sources> + <packages> + <package name="org.cmake.Coverage" line-rate="0.7222222222222222" branch-rate="0.875" complexity="0.0"> + <classes> + <class name="org.cmake.Coverage.CoverageTest" filename="org/cmake/CoverageTest.java" line-rate="0.7222222222222222" branch-rate="0.875" complexity="0.0"> + <methods> + <method name="<clinit>" signature="()V" line-rate="1.0" branch-rate="1.0"> + <lines> + <line number="10" hits="2" branch="false"/> + <line number="11" hits="2" branch="false"/> + </lines> + </method> + <method name="<init>" signature="()V" line-rate="0.0" branch-rate="1.0"> + <lines> + <line number="8" hits="0" branch="false"/> + <line number="12" hits="0" branch="false"/> + </lines> + </method> + <method name="equalsVarOne" signature="(Ljava/lang/String;)Ljava/lang/Boolean;" line-rate="0.6666666666666666" branch-rate="0.5"> + <lines> + <line number="16" hits="2" branch="true" condition-coverage="50% (1/2)"> + <conditions> + <condition number="0" type="jump" coverage="50%"/> + </conditions> + </line> + <line number="17" hits="2" branch="false"/> + <line number="20" hits="0" branch="false"/> + </lines> + </method> + <method name="equalsVarTwo" signature="(Ljava/lang/String;)Z" line-rate="1.0" branch-rate="1.0"> + <lines> + <line number="26" hits="4" branch="true" condition-coverage="100% (2/2)"> + <conditions> + <condition number="0" type="jump" coverage="100%"/> + </conditions> + </line> + <line number="27" hits="2" branch="false"/> + <line number="30" hits="2" branch="false"/> + </lines> + </method> + <method name="timesIntOne" signature="(Ljava/lang/Integer;)Ljava/lang/Integer;" line-rate="0.0" branch-rate="1.0"> + <lines> + <line number="35" hits="0" branch="false"/> + <line number="36" hits="0" branch="false"/> + </lines> + </method> + <method name="whileLoop" signature="(Ljava/lang/Integer;)Z" line-rate="1.0" branch-rate="1.0"> + <lines> + <line number="41" hits="2" branch="false"/> + <line number="42" hits="10" branch="true" condition-coverage="100% (2/2)"> + <conditions> + <condition number="0" type="jump" coverage="100%"/> + </conditions> + </line> + <line number="43" hits="8" branch="false"/> + <line number="45" hits="2" branch="true" condition-coverage="100% (2/2)"> + <conditions> + <condition number="0" type="jump" coverage="100%"/> + </conditions> + </line> + <line number="46" hits="1" branch="false"/> + <line number="49" hits="1" branch="false"/> + </lines> + </method> + </methods> + <lines> + <line number="8" hits="0" branch="false"/> + <line number="10" hits="2" branch="false"/> + <line number="11" hits="2" branch="false"/> + <line number="12" hits="0" branch="false"/> + <line number="16" hits="2" branch="true" condition-coverage="50% (1/2)"> + <conditions> + <condition number="0" type="jump" coverage="50%"/> + </conditions> + </line> + <line number="17" hits="2" branch="false"/> + <line number="20" hits="0" branch="false"/> + <line number="26" hits="4" branch="true" condition-coverage="100% (2/2)"> + <conditions> + <condition number="0" type="jump" coverage="100%"/> + </conditions> + </line> + <line number="27" hits="2" branch="false"/> + <line number="30" hits="2" branch="false"/> + <line number="35" hits="0" branch="false"/> + <line number="36" hits="0" branch="false"/> + <line number="41" hits="2" branch="false"/> + <line number="42" hits="10" branch="true" condition-coverage="100% (2/2)"> + <conditions> + <condition number="0" type="jump" coverage="100%"/> + </conditions> + </line> + <line number="43" hits="8" branch="false"/> + <line number="45" hits="2" branch="true" condition-coverage="100% (2/2)"> + <conditions> + <condition number="0" type="jump" coverage="100%"/> + </conditions> + </line> + <line number="46" hits="1" branch="false"/> + <line number="49" hits="1" branch="false"/> + </lines> + </class> + </classes> + </package> + </packages> +</coverage> diff --git a/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java b/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java new file mode 100644 index 0000000..4fb43c6 --- /dev/null +++ b/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java @@ -0,0 +1,52 @@ +package org.cmake.Coverage; + +import java.io.Serializable; +import java.util.Map; +import java.util.List; +import java.awt.*; + +public class CoverageTest { + + public static String VarOne = "test1"; + public static String VarTwo = "test2"; + private Integer IntOne = 4; + + public static Boolean equalsVarOne(String inString) { + + if(VarOne.equals(inString)){ + return true; + } + else { + return false; + } + } + + public static boolean equalsVarTwo(String inString){ + + if(VarTwo.equals(inString)){ + return true; + } + else { + return false; + } + } + + private Integer timesIntOne(Integer inVal){ + + return inVal * IntOne; + } + + public static boolean whileLoop(Integer StopInt){ + + Integer i = 0; + while(i < StopInt){ + i=i+1; + } + if (i.equals(5)){ + return true; + } + else { + return false; + } + } +} diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index 350b518..668a97b 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0) project(CompatibleInterface) @@ -54,6 +54,15 @@ set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200) add_executable(CompatibleInterface main.cpp) target_link_libraries(CompatibleInterface iface1) +add_library(foo STATIC foo.cpp) +add_library(bar SHARED bar.cpp) +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMEPROP) +set_property(TARGET foo PROPERTY INTERFACE_SOMEPROP ON) +# Use LINK_ONLY to suppress usage requirements and allow the check to pass. +set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:foo>) +set_property(TARGET CompatibleInterface PROPERTY SOMEPROP OFF) +target_link_libraries(CompatibleInterface bar) + set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON) set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON) set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2) diff --git a/Tests/CompatibleInterface/bar.cpp b/Tests/CompatibleInterface/bar.cpp new file mode 100644 index 0000000..2e09900 --- /dev/null +++ b/Tests/CompatibleInterface/bar.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int bar() +{ + return 0; +} diff --git a/Tests/CompatibleInterface/foo.cpp b/Tests/CompatibleInterface/foo.cpp new file mode 100644 index 0000000..e05eb7e --- /dev/null +++ b/Tests/CompatibleInterface/foo.cpp @@ -0,0 +1,4 @@ +int foo() +{ + return 0; +} diff --git a/Tests/CompatibleInterface/main.cpp b/Tests/CompatibleInterface/main.cpp index e23625a..d20b64b 100644 --- a/Tests/CompatibleInterface/main.cpp +++ b/Tests/CompatibleInterface/main.cpp @@ -40,8 +40,14 @@ enum { #include "iface2.h" +int foo(); +#ifdef _WIN32 +__declspec(dllimport) +#endif +int bar(); + int main(int argc, char **argv) { Iface2 if2; - return if2.foo(); + return if2.foo() + foo() + bar(); } diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index 2ca2869..311975c 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -53,3 +53,8 @@ set_property(TARGET target_prop_mixed_executable APPEND PROPERTY COMPILE_DEFINIT "LINK_LANGUAGE_IS_$<TARGET_PROPERTY:LINKER_LANGUAGE>" "C_EXECUTABLE_LINK_LANGUAGE_IS_$<TARGET_PROPERTY:target_prop_c_executable,LINKER_LANGUAGE>" ) + +add_library(tgt STATIC IMPORTED) +set_property(TARGET tgt APPEND PROPERTY COMPILE_DEFINITIONS TGT_DEF TGT_TYPE_$<TARGET_PROPERTY:TYPE>) +add_executable(usetgt usetgt.c) +target_compile_definitions(usetgt PRIVATE $<TARGET_PROPERTY:tgt,COMPILE_DEFINITIONS>) diff --git a/Tests/CompileDefinitions/target_prop/usetgt.c b/Tests/CompileDefinitions/target_prop/usetgt.c new file mode 100644 index 0000000..6672a3e --- /dev/null +++ b/Tests/CompileDefinitions/target_prop/usetgt.c @@ -0,0 +1,10 @@ +#ifndef TGT_DEF +# error TGT_DEF incorrectly not defined +#endif +#ifndef TGT_TYPE_STATIC_LIBRARY +# error TGT_TYPE_STATIC_LIBRARY incorrectly not defined +#endif +#ifdef TGT_TYPE_EXECUTABLE +# error TGT_TYPE_EXECUTABLE incorrectly defined +#endif +int main(void) { return 0; } diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt new file mode 100644 index 0000000..d02ddaf --- /dev/null +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -0,0 +1,112 @@ + +cmake_minimum_required(VERSION 3.0) + +project(CompileFeatures) + +if (NOT CMAKE_C_COMPILE_FEATURES AND NOT CMAKE_CXX_COMPILE_FEATURES) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" + "int main(int,char**) { return 0; }\n" + ) + add_executable(CompileFeatures "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp") + return() +endif() + +macro(run_test feature lang) + if (";${CMAKE_${lang}_COMPILE_FEATURES};" MATCHES ${feature}) + add_library(test_${feature} OBJECT ${feature}) + set_property(TARGET test_${feature} + PROPERTY COMPILE_FEATURES "${feature}" + ) + else() + list(APPEND ${lang}_non_features ${feature}) + endif() +endmacro() + +get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) +foreach(feature ${c_features}) + run_test(${feature} C) +endforeach() +get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) +foreach(feature ${cxx_features}) + run_test(${feature} CXX) +endforeach() + +if (CMAKE_CXX_COMPILER_ID STREQUAL GNU + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + list(REMOVE_ITEM CXX_non_features + cxx_alignof + ) +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL GNU + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + # GNU prior to 4.9 does not set any preprocessor define to distinguish + # c++1y from c++11, so CMake does not support c++1y features before GNU 4.9. + list(REMOVE_ITEM CXX_non_features + # GNU 4.8 knows cxx_attributes, but doesn't know [[deprecated]] + # and warns that it is unknown and ignored. + cxx_attribute_deprecated + cxx_binary_literals + cxx_lambda_init_captures + cxx_return_type_deduction + ) +endif() + +set(C_ext c) +set(C_standard_flag 11) +set(CXX_ext cpp) +set(CXX_standard_flag 14) +foreach(lang CXX C) + if (CMAKE_${lang}_COMPILE_FEATURES) + foreach(feature ${${lang}_non_features}) + message("Testing feature : ${feature}") + try_compile(${feature}_works + "${CMAKE_CURRENT_BINARY_DIR}/${feature}_test" + "${CMAKE_CURRENT_SOURCE_DIR}/feature_test.${${lang}_ext}" + COMPILE_DEFINITIONS "-DTEST=${CMAKE_CURRENT_SOURCE_DIR}/${feature}.${${lang}_ext}" + CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD=${${lang}_standard_flag}" + OUTPUT_VARIABLE OUTPUT + ) + if (${feature}_works) + message(SEND_ERROR + "Feature ${feature} expected not to work for ${lang} ${CMAKE_${lang}_COMPILER_ID}-${CMAKE_${lang}_COMPILER_VERSION}. + Update the supported features or blacklist it.\n${OUTPUT}") + else() + message("Testing feature : ${feature} -- Fails, as expected.") + endif() + endforeach() + endif() +endforeach() + +add_executable(CompileFeatures main.cpp) +set_property(TARGET CompileFeatures + PROPERTY COMPILE_FEATURES "cxx_auto_type" +) +set_property(TARGET CompileFeatures + PROPERTY CXX_STANDARD_REQUIRED TRUE +) + +add_executable(GenexCompileFeatures main.cpp) +set_property(TARGET GenexCompileFeatures + PROPERTY COMPILE_FEATURES "$<1:cxx_auto_type>;$<0:not_a_feature>" +) + +add_library(iface INTERFACE) +set_property(TARGET iface + PROPERTY INTERFACE_COMPILE_FEATURES "cxx_auto_type" +) +add_executable(IfaceCompileFeatures main.cpp) +target_link_libraries(IfaceCompileFeatures iface) + +add_executable(CompileFeaturesGenex genex_test.cpp) +set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) +target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>) + +add_executable(CompileFeaturesGenex2 genex_test.cpp) +target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr) +target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>) + +add_library(noexcept_iface INTERFACE) +target_compile_features(noexcept_iface INTERFACE cxx_noexcept) +add_executable(CompileFeaturesGenex3 genex_test.cpp) +target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface) +target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>) diff --git a/Tests/CompileFeatures/c_function_prototypes.c b/Tests/CompileFeatures/c_function_prototypes.c new file mode 100644 index 0000000..ab3c948 --- /dev/null +++ b/Tests/CompileFeatures/c_function_prototypes.c @@ -0,0 +1,9 @@ + +int someFunc(int a, int b); + +int someFunc(int a, int b) +{ + (void)a; + (void)b; + return 0; +} diff --git a/Tests/CompileFeatures/c_restrict.c b/Tests/CompileFeatures/c_restrict.c new file mode 100644 index 0000000..7bc7566 --- /dev/null +++ b/Tests/CompileFeatures/c_restrict.c @@ -0,0 +1,7 @@ + +int f (int * restrict a, int * restrict b) +{ + (void)a; + (void)b; + return 0; +} diff --git a/Tests/CompileFeatures/c_static_assert.c b/Tests/CompileFeatures/c_static_assert.c new file mode 100644 index 0000000..afab504 --- /dev/null +++ b/Tests/CompileFeatures/c_static_assert.c @@ -0,0 +1,2 @@ + +_Static_assert(1, "Static assert test"); diff --git a/Tests/CompileFeatures/c_variadic_macros.c b/Tests/CompileFeatures/c_variadic_macros.c new file mode 100644 index 0000000..4da111e --- /dev/null +++ b/Tests/CompileFeatures/c_variadic_macros.c @@ -0,0 +1,15 @@ + +int someFunc(int i1, char c, int i2) +{ + (void)i1; + (void)c; + (void)i2; + return 0; +} + +#define FUNC_WRAPPER(...) someFunc(__VA_ARGS__) + +void otherFunc() +{ + FUNC_WRAPPER(42, 'a', 7); +} diff --git a/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp b/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp new file mode 100644 index 0000000..63a3713 --- /dev/null +++ b/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp @@ -0,0 +1,9 @@ + +struct X { int i, j, k = 42; }; + +int someFunc() +{ + X a[] = { 1, 2, 3, 4, 5, 6 }; + X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } }; + return a[0].k == b[0].k && a[1].k == b[1].k ? 0 : 1; +} diff --git a/Tests/CompileFeatures/cxx_alias_templates.cpp b/Tests/CompileFeatures/cxx_alias_templates.cpp new file mode 100644 index 0000000..a47e27d --- /dev/null +++ b/Tests/CompileFeatures/cxx_alias_templates.cpp @@ -0,0 +1,11 @@ + +template <typename T1, typename T2> +struct A +{ + typedef T1 MyT1; + using MyT2 = T2; +}; + +using B = A<int, char>; +template<typename T> +using C = A<int, T>; diff --git a/Tests/CompileFeatures/cxx_alignas.cpp b/Tests/CompileFeatures/cxx_alignas.cpp new file mode 100644 index 0000000..35b7c82 --- /dev/null +++ b/Tests/CompileFeatures/cxx_alignas.cpp @@ -0,0 +1,4 @@ + +struct S1 { + alignas(8) int n; +}; diff --git a/Tests/CompileFeatures/cxx_alignof.cpp b/Tests/CompileFeatures/cxx_alignof.cpp new file mode 100644 index 0000000..63b14fe --- /dev/null +++ b/Tests/CompileFeatures/cxx_alignof.cpp @@ -0,0 +1,5 @@ + +int someFunc() +{ + return alignof(int); +} diff --git a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp new file mode 100644 index 0000000..b6f307d --- /dev/null +++ b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp @@ -0,0 +1,11 @@ + +[[deprecated]] +int foo() +{ + return 0; +} + +int someFunc() +{ + return foo(); +} diff --git a/Tests/CompileFeatures/cxx_attributes.cpp b/Tests/CompileFeatures/cxx_attributes.cpp new file mode 100644 index 0000000..a3c89ea --- /dev/null +++ b/Tests/CompileFeatures/cxx_attributes.cpp @@ -0,0 +1,2 @@ + +void unusedFunc [[noreturn]] () { throw 1; } diff --git a/Tests/CompileFeatures/cxx_auto_type.cpp b/Tests/CompileFeatures/cxx_auto_type.cpp new file mode 100644 index 0000000..7dbf04f --- /dev/null +++ b/Tests/CompileFeatures/cxx_auto_type.cpp @@ -0,0 +1,5 @@ + +void someFunc() +{ + auto x = 3.14; +} diff --git a/Tests/CompileFeatures/cxx_binary_literals.cpp b/Tests/CompileFeatures/cxx_binary_literals.cpp new file mode 100644 index 0000000..14a9e75 --- /dev/null +++ b/Tests/CompileFeatures/cxx_binary_literals.cpp @@ -0,0 +1,6 @@ + +int someFunc() +{ + int i = 0b101; + return i - 5; +} diff --git a/Tests/CompileFeatures/cxx_constexpr.cpp b/Tests/CompileFeatures/cxx_constexpr.cpp new file mode 100644 index 0000000..570c10f --- /dev/null +++ b/Tests/CompileFeatures/cxx_constexpr.cpp @@ -0,0 +1,5 @@ + +constexpr int getNum() +{ + return 42; +} diff --git a/Tests/CompileFeatures/cxx_contextual_conversions.cpp b/Tests/CompileFeatures/cxx_contextual_conversions.cpp new file mode 100644 index 0000000..3438624 --- /dev/null +++ b/Tests/CompileFeatures/cxx_contextual_conversions.cpp @@ -0,0 +1,33 @@ + +#define assert(E) if(!(E)) return 1; + +template<class T> +class zero_init +{ +public: + zero_init( ) + : val( static_cast<T>(0) ) { } + zero_init( T val ) : val( val ) + { } + operator T & ( ) { return val; } + operator T ( ) const { return val; } +private: + T val; +}; + +int someFunc() +{ + zero_init<int*> p; assert( p == 0 ); + p = new int(7); + assert( *p == 7 ); + delete p; + + zero_init<int> i; assert( i == 0 ); + i = 7; + assert( i == 7 ); + switch( i ) { } + + int *vp = new int[i]; + + return 0; +} diff --git a/Tests/CompileFeatures/cxx_decltype.cpp b/Tests/CompileFeatures/cxx_decltype.cpp new file mode 100644 index 0000000..24ec51e --- /dev/null +++ b/Tests/CompileFeatures/cxx_decltype.cpp @@ -0,0 +1,7 @@ + +int someFunc() +{ + int i = 0; + decltype(i) other = 0; + return other; +} diff --git a/Tests/CompileFeatures/cxx_decltype_auto.cpp b/Tests/CompileFeatures/cxx_decltype_auto.cpp new file mode 100644 index 0000000..900bb6d --- /dev/null +++ b/Tests/CompileFeatures/cxx_decltype_auto.cpp @@ -0,0 +1,6 @@ + +int someFunc(int argc, char**) +{ + decltype(auto) i = argc; + return 0; +} diff --git a/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp new file mode 100644 index 0000000..109d038 --- /dev/null +++ b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp @@ -0,0 +1,14 @@ + +template<class T> +struct A +{ + ~A() = delete; +}; + +template<class T> auto h() -> A<T>; +template<class T> auto i(T) -> T; +template<class T> auto f(T) -> decltype(i(h<T>())); +template<class T> auto f(T) -> void; +auto g() -> void { + f(42); +} diff --git a/Tests/CompileFeatures/cxx_default_function_template_args.cpp b/Tests/CompileFeatures/cxx_default_function_template_args.cpp new file mode 100644 index 0000000..3d14c52 --- /dev/null +++ b/Tests/CompileFeatures/cxx_default_function_template_args.cpp @@ -0,0 +1,12 @@ + +template<typename T = int> +int someFunc() +{ + T t = 0; + return t; +} + +void otherFunc() +{ + someFunc(); +} diff --git a/Tests/CompileFeatures/cxx_defaulted_functions.cpp b/Tests/CompileFeatures/cxx_defaulted_functions.cpp new file mode 100644 index 0000000..b679a92 --- /dev/null +++ b/Tests/CompileFeatures/cxx_defaulted_functions.cpp @@ -0,0 +1,9 @@ + +struct A { + A() = default; +}; + +void someFunc() +{ + A a; +} diff --git a/Tests/CompileFeatures/cxx_defaulted_move_initializers.cpp b/Tests/CompileFeatures/cxx_defaulted_move_initializers.cpp new file mode 100644 index 0000000..14f9871 --- /dev/null +++ b/Tests/CompileFeatures/cxx_defaulted_move_initializers.cpp @@ -0,0 +1,7 @@ + +struct A +{ + A() = default; + A& operator=(A&&) = default; + A(A&&) = default; +}; diff --git a/Tests/CompileFeatures/cxx_delegating_constructors.cpp b/Tests/CompileFeatures/cxx_delegating_constructors.cpp new file mode 100644 index 0000000..4b41615 --- /dev/null +++ b/Tests/CompileFeatures/cxx_delegating_constructors.cpp @@ -0,0 +1,15 @@ + +class Foo +{ +public: + Foo(int i); + + Foo(double d) + : Foo(static_cast<int>(d)) + { + + } + +private: + int m_i; +}; diff --git a/Tests/CompileFeatures/cxx_deleted_functions.cpp b/Tests/CompileFeatures/cxx_deleted_functions.cpp new file mode 100644 index 0000000..4ecb1e9 --- /dev/null +++ b/Tests/CompileFeatures/cxx_deleted_functions.cpp @@ -0,0 +1,6 @@ + +struct A +{ + A(const A&) = delete; + A& operator=(const A&) = delete; +}; diff --git a/Tests/CompileFeatures/cxx_digit_separators.cpp b/Tests/CompileFeatures/cxx_digit_separators.cpp new file mode 100644 index 0000000..abcd1c8 --- /dev/null +++ b/Tests/CompileFeatures/cxx_digit_separators.cpp @@ -0,0 +1,6 @@ + +int someFunc() +{ + int one_thousand = 1'000; + return one_thousand - 1000; +} diff --git a/Tests/CompileFeatures/cxx_enum_forward_declarations.cpp b/Tests/CompileFeatures/cxx_enum_forward_declarations.cpp new file mode 100644 index 0000000..a7e1445 --- /dev/null +++ b/Tests/CompileFeatures/cxx_enum_forward_declarations.cpp @@ -0,0 +1,8 @@ + +enum SomeEnum : short; + +void someFunc() +{ + SomeEnum value; + int i = value; +} diff --git a/Tests/CompileFeatures/cxx_explicit_conversions.cpp b/Tests/CompileFeatures/cxx_explicit_conversions.cpp new file mode 100644 index 0000000..0decdcd --- /dev/null +++ b/Tests/CompileFeatures/cxx_explicit_conversions.cpp @@ -0,0 +1,10 @@ + +class A +{ + int m_i; +public: + explicit operator bool() + { + return m_i != 0; + } +}; diff --git a/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp new file mode 100644 index 0000000..631c699 --- /dev/null +++ b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp @@ -0,0 +1,25 @@ + +template <typename T> +struct B +{ + B() : m_i(42) {} +private: + int m_i; + friend T; +}; + +struct A +{ + template<typename T> + int getBValue(B<T> b) + { + return b.m_i; + } +}; + +void someFunc() +{ + A a; + B<A> b; + a.getBValue(b); +} diff --git a/Tests/CompileFeatures/cxx_extern_templates.cpp b/Tests/CompileFeatures/cxx_extern_templates.cpp new file mode 100644 index 0000000..9fa4aa4 --- /dev/null +++ b/Tests/CompileFeatures/cxx_extern_templates.cpp @@ -0,0 +1,12 @@ + +template<typename T> +void someFunc() +{ +} + +extern template void someFunc<int>(); + +void otherFunc() +{ + someFunc<int>(); +} diff --git a/Tests/CompileFeatures/cxx_final.cpp b/Tests/CompileFeatures/cxx_final.cpp new file mode 100644 index 0000000..598cb94 --- /dev/null +++ b/Tests/CompileFeatures/cxx_final.cpp @@ -0,0 +1,2 @@ + +struct A final {}; diff --git a/Tests/CompileFeatures/cxx_func_identifier.cpp b/Tests/CompileFeatures/cxx_func_identifier.cpp new file mode 100644 index 0000000..0c3595c --- /dev/null +++ b/Tests/CompileFeatures/cxx_func_identifier.cpp @@ -0,0 +1,6 @@ + +void someFunc() +{ + bool b = sizeof(__func__); + (void)b; +} diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp new file mode 100644 index 0000000..8013ef5 --- /dev/null +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -0,0 +1,23 @@ + +// Dummy implementation. Test only the compiler feature. +namespace std { + typedef decltype(sizeof(int)) size_t; + template <class _E> + class initializer_list + { + const _E* __begin_; + size_t __size_; + + }; +} + +template <typename T> +struct A +{ + A(std::initializer_list<T>) {} +}; + +void someFunc() +{ + A<int> as = { 1, 2, 3, 4 }; +} diff --git a/Tests/CompileFeatures/cxx_generic_lambdas.cpp b/Tests/CompileFeatures/cxx_generic_lambdas.cpp new file mode 100644 index 0000000..ae1b78e --- /dev/null +++ b/Tests/CompileFeatures/cxx_generic_lambdas.cpp @@ -0,0 +1,6 @@ + +int someFunc() +{ + auto identity = [](auto a) { return a; }; + return identity(0); +} diff --git a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp new file mode 100644 index 0000000..a83b624 --- /dev/null +++ b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp @@ -0,0 +1,18 @@ + +struct A +{ + int m_i; + + A(int i) : m_i(i) {} +}; + +struct B : public A +{ + using A::A; +}; + +void someFunc() +{ + int i; + B b(i); +} diff --git a/Tests/CompileFeatures/cxx_inline_namespaces.cpp b/Tests/CompileFeatures/cxx_inline_namespaces.cpp new file mode 100644 index 0000000..59fa9c8 --- /dev/null +++ b/Tests/CompileFeatures/cxx_inline_namespaces.cpp @@ -0,0 +1,26 @@ +namespace Lib +{ +inline namespace Lib_1 +{ + template <typename T> class A; +} + +template <typename T> void g(T); +} + +struct MyClass { + +}; +namespace Lib +{ +template<> +class A<MyClass> { + +}; +} + +void someFunc() +{ + Lib::A<MyClass> a; + g(a); // ok, Lib is an associated namespace of A +} diff --git a/Tests/CompileFeatures/cxx_lambda_init_captures.cpp b/Tests/CompileFeatures/cxx_lambda_init_captures.cpp new file mode 100644 index 0000000..7e337fa --- /dev/null +++ b/Tests/CompileFeatures/cxx_lambda_init_captures.cpp @@ -0,0 +1,6 @@ + +int someFunc() +{ + int a = 0; + return [b = static_cast<int&&>(a)]() { return b; }(); +} diff --git a/Tests/CompileFeatures/cxx_lambdas.cpp b/Tests/CompileFeatures/cxx_lambdas.cpp new file mode 100644 index 0000000..eecaa23 --- /dev/null +++ b/Tests/CompileFeatures/cxx_lambdas.cpp @@ -0,0 +1,5 @@ + +void someFunc() +{ + [](){}(); +} diff --git a/Tests/CompileFeatures/cxx_local_type_template_args.cpp b/Tests/CompileFeatures/cxx_local_type_template_args.cpp new file mode 100644 index 0000000..802ea7a --- /dev/null +++ b/Tests/CompileFeatures/cxx_local_type_template_args.cpp @@ -0,0 +1,21 @@ + +template <typename T> +class X { }; +template <typename T> +void f(T t) { } +struct {} unnamed_obj; +void f() { + struct A { }; + enum { e1 }; + typedef struct {} B; + B b; + X<A> x1; + X<A*> x2; + X<B> x3; + f(e1); + f(unnamed_obj); + f(b); + (void)x1; + (void)x2; + (void)x3; +} diff --git a/Tests/CompileFeatures/cxx_long_long_type.cpp b/Tests/CompileFeatures/cxx_long_long_type.cpp new file mode 100644 index 0000000..670324c --- /dev/null +++ b/Tests/CompileFeatures/cxx_long_long_type.cpp @@ -0,0 +1,5 @@ + +void someFunc() +{ + long long ll = 9223372036854775807LL; +} diff --git a/Tests/CompileFeatures/cxx_noexcept.cpp b/Tests/CompileFeatures/cxx_noexcept.cpp new file mode 100644 index 0000000..a3c05b8 --- /dev/null +++ b/Tests/CompileFeatures/cxx_noexcept.cpp @@ -0,0 +1,5 @@ + +void someFunc() noexcept +{ + +} diff --git a/Tests/CompileFeatures/cxx_nonstatic_member_init.cpp b/Tests/CompileFeatures/cxx_nonstatic_member_init.cpp new file mode 100644 index 0000000..6b7fa70 --- /dev/null +++ b/Tests/CompileFeatures/cxx_nonstatic_member_init.cpp @@ -0,0 +1,4 @@ +class A +{ + int m_i = 42; +}; diff --git a/Tests/CompileFeatures/cxx_nullptr.cpp b/Tests/CompileFeatures/cxx_nullptr.cpp new file mode 100644 index 0000000..96307df --- /dev/null +++ b/Tests/CompileFeatures/cxx_nullptr.cpp @@ -0,0 +1,10 @@ + +void someFunc(int*) +{ + +} + +void otherFunc() +{ + someFunc(nullptr); +} diff --git a/Tests/CompileFeatures/cxx_override.cpp b/Tests/CompileFeatures/cxx_override.cpp new file mode 100644 index 0000000..55bec13 --- /dev/null +++ b/Tests/CompileFeatures/cxx_override.cpp @@ -0,0 +1,7 @@ + +struct A { + virtual void doNothing() {} +}; +struct B : A { + void doNothing() override {} +}; diff --git a/Tests/CompileFeatures/cxx_range_for.cpp b/Tests/CompileFeatures/cxx_range_for.cpp new file mode 100644 index 0000000..892109e --- /dev/null +++ b/Tests/CompileFeatures/cxx_range_for.cpp @@ -0,0 +1,10 @@ + +void someFunc() +{ + int accumulated = 0; + int numbers[] = { 1, 2, 5 }; + for (int i : numbers) + { + accumulated += i; + } +} diff --git a/Tests/CompileFeatures/cxx_raw_string_literals.cpp b/Tests/CompileFeatures/cxx_raw_string_literals.cpp new file mode 100644 index 0000000..ea4d231 --- /dev/null +++ b/Tests/CompileFeatures/cxx_raw_string_literals.cpp @@ -0,0 +1,7 @@ + +void someFunc() +{ +const char p[] = R"(a\ +b +c)"; +} diff --git a/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp new file mode 100644 index 0000000..83a2361 --- /dev/null +++ b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp @@ -0,0 +1,11 @@ + +struct test{ + void f() & { } + void f() && { } +}; + +void someFunc(){ + test t; + t.f(); // lvalue + test().f(); // rvalue +} diff --git a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp new file mode 100644 index 0000000..bce82e3 --- /dev/null +++ b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp @@ -0,0 +1,23 @@ + +struct X { + constexpr X() : n(5) { + n *= 2; + } + int n; +}; + +constexpr int g(const int (&is)[4]) { + X x; + int r = x.n; + for (int i = 0; i < 5; ++i) + r += i; + for (auto& i : is) + r += i; + return r; +} + +int someFunc() +{ + constexpr int k3 = g({ 4, 5, 6, 7 }); + return k3 - 42; +} diff --git a/Tests/CompileFeatures/cxx_return_type_deduction.cpp b/Tests/CompileFeatures/cxx_return_type_deduction.cpp new file mode 100644 index 0000000..009e919 --- /dev/null +++ b/Tests/CompileFeatures/cxx_return_type_deduction.cpp @@ -0,0 +1,10 @@ + +auto sum(int a, int b) +{ + return a+b; +} + +int someFunc() +{ + return sum(3, -3); +} diff --git a/Tests/CompileFeatures/cxx_right_angle_brackets.cpp b/Tests/CompileFeatures/cxx_right_angle_brackets.cpp new file mode 100644 index 0000000..2713fd8 --- /dev/null +++ b/Tests/CompileFeatures/cxx_right_angle_brackets.cpp @@ -0,0 +1,12 @@ + +template<typename T> +struct A +{ + typedef T Result; +}; + +void someFunc() +{ + A<A<int>> object; + (void)object; +} diff --git a/Tests/CompileFeatures/cxx_rvalue_references.cpp b/Tests/CompileFeatures/cxx_rvalue_references.cpp new file mode 100644 index 0000000..787026a --- /dev/null +++ b/Tests/CompileFeatures/cxx_rvalue_references.cpp @@ -0,0 +1,5 @@ + +void someFunc(int&&) +{ + +} diff --git a/Tests/CompileFeatures/cxx_sizeof_member.cpp b/Tests/CompileFeatures/cxx_sizeof_member.cpp new file mode 100644 index 0000000..ae143d2 --- /dev/null +++ b/Tests/CompileFeatures/cxx_sizeof_member.cpp @@ -0,0 +1,10 @@ + +struct A +{ + int m_i; +}; + +int someFunc() +{ + return sizeof(A::m_i) > 0 ? 1 : 2; +} diff --git a/Tests/CompileFeatures/cxx_static_assert.cpp b/Tests/CompileFeatures/cxx_static_assert.cpp new file mode 100644 index 0000000..6aa8678 --- /dev/null +++ b/Tests/CompileFeatures/cxx_static_assert.cpp @@ -0,0 +1,2 @@ + +static_assert(true, "static_assert test"); diff --git a/Tests/CompileFeatures/cxx_strong_enums.cpp b/Tests/CompileFeatures/cxx_strong_enums.cpp new file mode 100644 index 0000000..6262456 --- /dev/null +++ b/Tests/CompileFeatures/cxx_strong_enums.cpp @@ -0,0 +1,7 @@ + +enum class Colors +{ + RedColor, + GreenColor, + BlueColor +}; diff --git a/Tests/CompileFeatures/cxx_template_template_parameters.cpp b/Tests/CompileFeatures/cxx_template_template_parameters.cpp new file mode 100644 index 0000000..0fdd18d --- /dev/null +++ b/Tests/CompileFeatures/cxx_template_template_parameters.cpp @@ -0,0 +1,18 @@ + +template<template <typename> class T, typename U> +void someFunc(T<U>) +{ + +} + +template<typename T> +struct A +{ + +}; + +void otherFunc() +{ + A<int> a; + someFunc(a); +} diff --git a/Tests/CompileFeatures/cxx_thread_local.cpp b/Tests/CompileFeatures/cxx_thread_local.cpp new file mode 100644 index 0000000..1fb27e2 --- /dev/null +++ b/Tests/CompileFeatures/cxx_thread_local.cpp @@ -0,0 +1,2 @@ + +thread_local unsigned int rage = 1; diff --git a/Tests/CompileFeatures/cxx_trailing_return_types.cpp b/Tests/CompileFeatures/cxx_trailing_return_types.cpp new file mode 100644 index 0000000..01a76cb --- /dev/null +++ b/Tests/CompileFeatures/cxx_trailing_return_types.cpp @@ -0,0 +1,5 @@ + +auto someFunc() -> int +{ + return 42; +} diff --git a/Tests/CompileFeatures/cxx_unicode_literals.cpp b/Tests/CompileFeatures/cxx_unicode_literals.cpp new file mode 100644 index 0000000..a7b7df0 --- /dev/null +++ b/Tests/CompileFeatures/cxx_unicode_literals.cpp @@ -0,0 +1,3 @@ + +const char16_t lit_16[] = u"\u00DA"; +const char32_t lit_32[] = U"\u00DA"; diff --git a/Tests/CompileFeatures/cxx_uniform_initialization.cpp b/Tests/CompileFeatures/cxx_uniform_initialization.cpp new file mode 100644 index 0000000..82c76e2 --- /dev/null +++ b/Tests/CompileFeatures/cxx_uniform_initialization.cpp @@ -0,0 +1,9 @@ +struct A {}; +struct B { + B(A) {} +}; + +void Func() +{ + B b{A{}}; +} diff --git a/Tests/CompileFeatures/cxx_unrestricted_unions.cpp b/Tests/CompileFeatures/cxx_unrestricted_unions.cpp new file mode 100644 index 0000000..698fd61 --- /dev/null +++ b/Tests/CompileFeatures/cxx_unrestricted_unions.cpp @@ -0,0 +1,11 @@ + +struct point { + point() {} + point(int x, int y) : x_(x), y_(y) {} + int x_, y_; +}; +union u { + point p_; + int i_; + const char* s_; +}; diff --git a/Tests/CompileFeatures/cxx_user_literals.cpp b/Tests/CompileFeatures/cxx_user_literals.cpp new file mode 100644 index 0000000..9e5a588 --- /dev/null +++ b/Tests/CompileFeatures/cxx_user_literals.cpp @@ -0,0 +1,7 @@ + +long double operator "" _meters(long double); + +void someFunc() +{ + long double i = 1.2_meters; +} diff --git a/Tests/CompileFeatures/cxx_variable_templates.cpp b/Tests/CompileFeatures/cxx_variable_templates.cpp new file mode 100644 index 0000000..5d4bdbc --- /dev/null +++ b/Tests/CompileFeatures/cxx_variable_templates.cpp @@ -0,0 +1,10 @@ + +template<typename T> +constexpr T pi = T(3.1415926535897932385); + +int someFunc() +{ + auto pi_int = pi<int>; + auto pi_float = pi<float>; + return pi_int - 3; +} diff --git a/Tests/CompileFeatures/cxx_variadic_macros.cpp b/Tests/CompileFeatures/cxx_variadic_macros.cpp new file mode 100644 index 0000000..4d007a5 --- /dev/null +++ b/Tests/CompileFeatures/cxx_variadic_macros.cpp @@ -0,0 +1,12 @@ + +int someFunc(int, char, int) +{ + return 0; +} + +#define FUNC_WRAPPER(...) someFunc(__VA_ARGS__) + +void otherFunc() +{ + FUNC_WRAPPER(42, 'a', 7); +} diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp new file mode 100644 index 0000000..1d5a706 --- /dev/null +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -0,0 +1,65 @@ +template<int I, int... Is> +struct Interface; + +template<int I> +struct Interface<I> +{ + static int accumulate() + { + return I; + } +}; + +template<int I, int... Is> +struct Interface +{ + static int accumulate() + { + return I + Interface<Is...>::accumulate(); + } +}; + +// Note: split this into a separate test if a +// cxx_variadic_template_template_parameters feature is added. + +template<typename T> +struct eval { + enum { + Matched = 0 + }; +}; + +template<template<typename...> class T, typename... U> +struct eval<T<U...> > { + enum { + Matched = 1 + }; +}; + +template<typename...> +struct A { + +}; +template<typename T> +struct B { + +}; +template<typename T, typename U> +struct C { + +}; +template<typename T, typename U, typename...> +struct D { + +}; + +// Note: This test assumes that a compiler supporting this feature +// supports static_assert. Add a workaround if that does not hold. +static_assert(eval<A<> >::Matched, "A Matches"); +static_assert(eval<A<int> >::Matched, "A Matches"); +static_assert(eval<A<int, char> >::Matched, "A Matches"); +static_assert(eval<B<int> >::Matched, "B Matches"); +static_assert(eval<C<int, char> >::Matched, "C Matches"); +static_assert(eval<D<int, char> >::Matched, "D Matches"); +static_assert(eval<D<int, char, bool> >::Matched, "D Matches"); +static_assert(eval<D<int, char, bool, double> >::Matched, "D Matches"); diff --git a/Tests/CompileFeatures/feature_test.cpp b/Tests/CompileFeatures/feature_test.cpp new file mode 100644 index 0000000..4406c16 --- /dev/null +++ b/Tests/CompileFeatures/feature_test.cpp @@ -0,0 +1,10 @@ + +#define STRINGIFY_IMPL(X) #X +#define STRINGIFY(X) STRINGIFY_IMPL(X) + +#include STRINGIFY(TEST) + +int main() +{ + return 0; +} diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp new file mode 100644 index 0000000..ca38883 --- /dev/null +++ b/Tests/CompileFeatures/genex_test.cpp @@ -0,0 +1,21 @@ + +#if !HAVE_OVERRIDE_CONTROL +#error "Expect override control feature" +#else + +struct A +{ + virtual int getA() { return 7; } +}; + +struct B final : A +{ + int getA() override { return 42; } +}; + +#endif + +int main() +{ + +} diff --git a/Tests/CompileFeatures/main.c b/Tests/CompileFeatures/main.c new file mode 100644 index 0000000..831c5eb2 --- /dev/null +++ b/Tests/CompileFeatures/main.c @@ -0,0 +1,12 @@ + +int foo(int * restrict a, int * restrict b) +{ + (void)a; + (void)b; + return 0; +} + +int main() +{ + return 0; +} diff --git a/Tests/CompileFeatures/main.cpp b/Tests/CompileFeatures/main.cpp new file mode 100644 index 0000000..3a8e0fc --- /dev/null +++ b/Tests/CompileFeatures/main.cpp @@ -0,0 +1,6 @@ + +int main(int,char**) +{ + auto value = 0; + return value; +} diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt index 9b6c9c2..05a5f82 100644 --- a/Tests/CompileOptions/CMakeLists.txt +++ b/Tests/CompileOptions/CMakeLists.txt @@ -22,6 +22,12 @@ set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS ${cxx_tests} ) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland") + set_property(TARGET CompileOptions APPEND PROPERTY COMPILE_OPTIONS + "-DTEST_OCTOTHORPE=\"#\"" + ) +endif() + target_link_libraries(CompileOptions testlib) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") diff --git a/Tests/CompileOptions/main.cpp b/Tests/CompileOptions/main.cpp index 42f4cca..f3c1355 100644 --- a/Tests/CompileOptions/main.cpp +++ b/Tests/CompileOptions/main.cpp @@ -17,6 +17,9 @@ int main() { return (strcmp(NEEDS_ESCAPE, "E$CAPE") == 0 +#ifdef TEST_OCTOTHORPE + && strcmp(TEST_OCTOTHORPE, "#") == 0 +#endif && strcmp(EXPECTED_C_COMPILER_VERSION, TEST_C_COMPILER_VERSION) == 0 && strcmp(EXPECTED_CXX_COMPILER_VERSION, TEST_CXX_COMPILER_VERSION) == 0 && TEST_C_COMPILER_VERSION_EQUALITY == 1 diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index fcde44d..5e5eead 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -14,6 +14,21 @@ if(POLICY CMP0003) endif() endif() +# It is not recommended to set a policy to OLD, but this test +# covers the OLD behavior of some policies. +foreach(p + CMP0029 + CMP0032 + CMP0033 + CMP0034 + CMP0043 + CMP0050 + ) + if(POLICY ${p}) + cmake_policy(SET ${p} OLD) + endif() +endforeach() + # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -36,7 +51,7 @@ ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") # macro(TEST_ARGC value1 value2) add_definitions(${value1} ${value2}) - if (${ARGC} MATCHES 4) + if (${ARGC} EQUAL 4) add_definitions(${ARGV2} ${ARGV3}) endif () endmacro() @@ -70,7 +85,7 @@ if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") endif() @@ -83,6 +98,14 @@ set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO + CMAKE_IS_FUN_IN_RELEASE_MODE + ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_MINSIZEREL + CMAKE_IS_FUN_IN_RELEASE_MODE + ) set(TEST_SEP "a b c") separate_arguments(TEST_SEP) @@ -392,6 +415,21 @@ if(NOT RESULT STREQUAL "a[b]c[d]e") "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() +# +# This tests needs Ansi C++98 +# +set(CMAKE_CXX_STANDARD 98) +# +# GNU extensions are needed for stricmp() on Windows. +# +set(CMAKE_CXX_EXTENSIONS TRUE) + +# Those versions of the HP compiler that need a flag to get proper C++98 +# template support also need a flag to use the newer C++ library. +if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () # # Create the libs and the main exe diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index a4a0e0e..3b73e70 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -14,6 +14,21 @@ if(POLICY CMP0003) endif() endif() +# It is not recommended to set a policy to OLD, but this test +# covers the OLD behavior of some policies. +foreach(p + CMP0029 + CMP0032 + CMP0033 + CMP0034 + CMP0043 + CMP0050 + ) + if(POLICY ${p}) + cmake_policy(SET ${p} OLD) + endif() +endforeach() + # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -36,7 +51,7 @@ ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") # macro(TEST_ARGC value1 value2) add_definitions(${value1} ${value2}) - if (${ARGC} MATCHES 4) + if (${ARGC} EQUAL 4) add_definitions(${ARGV2} ${ARGV3}) endif () endmacro() @@ -70,7 +85,7 @@ if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") endif() -if(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") endif() @@ -83,6 +98,14 @@ set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO + CMAKE_IS_FUN_IN_RELEASE_MODE + ) +set_property(DIRECTORY + PROPERTY COMPILE_DEFINITIONS_MINSIZEREL + CMAKE_IS_FUN_IN_RELEASE_MODE + ) set(TEST_SEP "a b c") separate_arguments(TEST_SEP) @@ -362,6 +385,21 @@ if(NOT RESULT STREQUAL "a[b]c[d]e") "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() +# +# This tests needs Ansi C++98 +# +set(CMAKE_CXX_STANDARD 98) +# +# GNU extensions are needed for stricmp() on Windows. +# +set(CMAKE_CXX_EXTENSIONS TRUE) + +# Those versions of the HP compiler that need a flag to get proper C++98 +# template support also need a flag to use the newer C++ library. +if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () # # Create the libs and the main exe diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt new file mode 100644 index 0000000..c272257 --- /dev/null +++ b/Tests/ConfigSources/CMakeLists.txt @@ -0,0 +1,17 @@ + +cmake_minimum_required(VERSION 3.0) + +project(ConfigSources) + +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_SOURCES + iface_src.cpp + $<$<CONFIG:Debug>:iface_debug_src.cpp> + $<$<CONFIG:Release>:does_not_exist.cpp> +) + +add_executable(ConfigSources + $<$<CONFIG:Debug>:main.cpp> + $<$<CONFIG:Release>:does_not_exist.cpp> +) +target_link_libraries(ConfigSources iface) diff --git a/Tests/ConfigSources/iface_debug.h b/Tests/ConfigSources/iface_debug.h new file mode 100644 index 0000000..a23d737 --- /dev/null +++ b/Tests/ConfigSources/iface_debug.h @@ -0,0 +1,4 @@ + +int iface_src(); + +int iface_debug(); diff --git a/Tests/ConfigSources/iface_debug_src.cpp b/Tests/ConfigSources/iface_debug_src.cpp new file mode 100644 index 0000000..63b22fc --- /dev/null +++ b/Tests/ConfigSources/iface_debug_src.cpp @@ -0,0 +1,7 @@ + +#include "iface_debug.h" + +int iface_debug() +{ + return 0; +} diff --git a/Tests/ConfigSources/iface_src.cpp b/Tests/ConfigSources/iface_src.cpp new file mode 100644 index 0000000..c3a0c8f --- /dev/null +++ b/Tests/ConfigSources/iface_src.cpp @@ -0,0 +1,5 @@ + +int iface_src() +{ + return 0; +} diff --git a/Tests/ConfigSources/main.cpp b/Tests/ConfigSources/main.cpp new file mode 100644 index 0000000..71af72f --- /dev/null +++ b/Tests/ConfigSources/main.cpp @@ -0,0 +1,7 @@ + +#include "iface_debug.h" + +int main(int argc, char** argv) +{ + return iface_src() + iface_debug(); +} diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index bbae387..b97cd16 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -185,7 +185,7 @@ add_executable(CustomCommand # here to test adding the generation rule after referencing the # generated source in a target. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/generated.c - DEPENDS generator + DEPENDS $<1:generator> $<0:does_not_exist> COMMAND generator ARGS ${PROJECT_BINARY_DIR}/generated.c ) @@ -221,8 +221,11 @@ add_subdirectory(GeneratorInExtraDir) add_executable(tcat tcat.cxx) +# Test that list expansion from a generator expression works. +set_property(TARGET tcat PROPERTY DEPSLIST tcat gen_redirect_in.c) + add_custom_command(OUTPUT gen_redirect.c - DEPENDS tcat gen_redirect_in.c + DEPENDS $<TARGET_PROPERTY:tcat,DEPSLIST> COMMAND tcat < ${CMAKE_CURRENT_SOURCE_DIR}/gen_redirect_in.c > gen_redirect.c COMMAND ${CMAKE_COMMAND} -E echo "#endif" >> gen_redirect.c VERBATIM @@ -364,8 +367,8 @@ endif() foreach(arg ${CHECK_ARGS} "") set(ARG "${arg}") - string(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}") - string(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}") + string(REPLACE "\\" "\\\\" ARG "${ARG}") + string(REPLACE "\"" "\\\"" ARG "${ARG}") set(EXPECTED_ARGUMENTS "${EXPECTED_ARGUMENTS} \"${ARG}\", ") @@ -453,3 +456,30 @@ add_custom_target(source_in_custom_target SOURCES source_in_custom_target.cpp) set_property(SOURCE source_in_custom_target PROPERTY COMPILE_DEFINITIONS "TEST" ) + +set(gen_path "${CMAKE_CURRENT_BINARY_DIR}//./foo") +set(gen_file "${gen_path}/foo.cxx") + +add_custom_command( + OUTPUT "${gen_file}" + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${gen_path}" + COMMAND ${CMAKE_COMMAND} -E touch "${gen_file}" +) + +add_library(NormOutput "${gen_file}") + +set(gen_path "${gen_path}/bar") +set(gen_file "${gen_path}/bar.cxx") + +add_custom_command( + OUTPUT "${gen_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${gen_path}" +) + +add_custom_command( + OUTPUT "${gen_file}" + DEPENDS "${gen_path}" + COMMAND ${CMAKE_COMMAND} -E touch "${gen_file}") + +add_library(NormDepends "${gen_file}") diff --git a/Tests/CxxDialect/CMakeLists.txt b/Tests/CxxDialect/CMakeLists.txt new file mode 100644 index 0000000..8c90339 --- /dev/null +++ b/Tests/CxxDialect/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 2.8.12) +cmake_policy(SET CMP0025 NEW) +project(CxxDialect) + +add_executable(use_typeof use_typeof.cxx) +set_property(TARGET use_typeof PROPERTY CXX_STANDARD 98) + +add_executable(use_constexpr use_constexpr.cxx) +set_property(TARGET use_constexpr PROPERTY CXX_STANDARD 11) + +add_executable(CxxDialect use_constexpr_and_typeof.cxx) +set_property(TARGET CxxDialect PROPERTY CXX_STANDARD 11) + +try_compile(typeof_no_extensions_works + "${CMAKE_CURRENT_BINARY_DIR}/use_typeof_test" + "${CMAKE_CURRENT_SOURCE_DIR}/use_typeof.cxx" + COMPILE_DEFINITIONS + CMAKE_FLAGS + "-DCMAKE_CXX_STANDARD=98" + "-DCMAKE_CXX_EXTENSIONS=FALSE" + OUTPUT_VARIABLE OUTPUT +) + +if (typeof_no_extensions_works) + message("Use of typeof extension with extensions disabled works, but is expected to fail: ${OUTPUT}") +else() + message("Use of typeof extension with extensions disabled fails, as expected") +endif() diff --git a/Tests/CxxDialect/use_constexpr.cxx b/Tests/CxxDialect/use_constexpr.cxx new file mode 100644 index 0000000..30ccc4c --- /dev/null +++ b/Tests/CxxDialect/use_constexpr.cxx @@ -0,0 +1,10 @@ + +constexpr int foo() +{ + return 0; +} + +int main(int argc, char**) +{ + return foo(); +} diff --git a/Tests/CxxDialect/use_constexpr_and_typeof.cxx b/Tests/CxxDialect/use_constexpr_and_typeof.cxx new file mode 100644 index 0000000..af217b6 --- /dev/null +++ b/Tests/CxxDialect/use_constexpr_and_typeof.cxx @@ -0,0 +1,11 @@ + +constexpr int foo() +{ + return 0; +} + +int main(int argc, char**) +{ + typeof(argc) ret = foo(); + return ret; +} diff --git a/Tests/CxxDialect/use_typeof.cxx b/Tests/CxxDialect/use_typeof.cxx new file mode 100644 index 0000000..dabb61f --- /dev/null +++ b/Tests/CxxDialect/use_typeof.cxx @@ -0,0 +1,6 @@ + +int main(int argc, char**) +{ + typeof(argc) ret = 0; + return ret; +} diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt index 02a0371..eaad3d4 100644 --- a/Tests/ExportImport/CMakeLists.txt +++ b/Tests/ExportImport/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.7.20090711) project(ExportImport C CXX) -if(NOT DEFINED CMAKE_TEST_MAKEPROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") - set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}") +if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") endif() # Wipe out the install tree to make sure the exporter works. @@ -44,6 +44,7 @@ add_custom_command( --build-project Export --build-target install --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options -C${ExportImport_BINARY_DIR}/InitialCache.cmake VERBATIM @@ -65,6 +66,7 @@ add_custom_command( --build-noclean --build-project Import --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options -C${ExportImport_BINARY_DIR}/InitialCache.cmake VERBATIM diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index 9d4793d..523fc29 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -23,7 +23,13 @@ set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_ add_library(sharediface INTERFACE) target_link_libraries(sharediface INTERFACE sharedlib) -install(TARGETS headeronly sharediface +add_library(use_auto_type INTERFACE) +target_compile_features(use_auto_type INTERFACE cxx_auto_type) + +add_library(use_c_restrict INTERFACE) +target_compile_features(use_c_restrict INTERFACE c_restrict) + +install(TARGETS headeronly sharediface use_auto_type use_c_restrict EXPORT expInterface ) install(TARGETS sharedlib diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt index 5e809a2..189f7a2 100644 --- a/Tests/ExportImport/Import/CMakeLists.txt +++ b/Tests/ExportImport/Import/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required (VERSION 2.7.20090711) +cmake_policy(SET CMP0025 NEW) project(Import C CXX) # Import everything in a subdirectory. diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt index cf7e2bc..4028405 100644 --- a/Tests/ExportImport/Import/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt @@ -17,6 +17,7 @@ set_property(TARGET bld::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES de add_executable(interfacetest_bld interfacetest.cpp) target_link_libraries(interfacetest_bld bld::sharediface) +include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) macro(do_try_compile prefix) @@ -40,6 +41,43 @@ macro(do_try_compile prefix) if(NOT ${prefix}IFACE_TRY_COMPILE) message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}") endif() + + if (";${CMAKE_C_COMPILE_FEATURES};" MATCHES ";c_restrict;") + set(CMAKE_REQUIRED_LIBRARIES ${prefix}::use_c_restrict) + check_c_source_compiles( + " + int foo(int * restrict a, int * restrict b) + { + (void)a; + (void)b; + return 0; + } + int main() + { + return 0; + } + " ${prefix}IMPORTED_IFACE_C_RESTRICT) + + if(NOT ${prefix}IMPORTED_IFACE_C_RESTRICT) + message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}") + endif() + endif() + if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;") + set(CMAKE_REQUIRED_LIBRARIES ${prefix}::use_auto_type) + check_cxx_source_compiles( + " + int main(int,char**) + { + auto value = 0; + return value; + } + " ${prefix}IMPORTED_IFACE_AUTO_TYPE) + + if(NOT ${prefix}IMPORTED_IFACE_AUTO_TYPE) + message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}") + endif() + endif() + endmacro() do_try_compile(bld) diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in index fba6ee2..f600d90 100644 --- a/Tests/ExportImport/InitialCache.cmake.in +++ b/Tests/ExportImport/InitialCache.cmake.in @@ -1,4 +1,4 @@ -set(CMAKE_MAKE_PROGRAM "@CMAKE_TEST_MAKEPROGRAM@" CACHE FILEPATH "Make Program") +set(CMAKE_MAKE_PROGRAM "@CMake_TEST_NESTED_MAKE_PROGRAM@" CACHE FILEPATH "Make Program") set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index d9344ec..2f74121 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -3,6 +3,8 @@ project(ExternalProjectTest NONE) include(ExternalProject) +# Test ExternalProject, especially with checkouts from VCS + find_package(CVS) find_package(Subversion) find_package(Git) @@ -23,33 +25,6 @@ set(binary_base "${base}/Build") set_property(DIRECTORY PROPERTY EP_BASE ${base}) set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) -if(NOT DEFINED can_build_tutorial_step5) - set(can_build_tutorial_step5 1) - - # Tutorial Step5 cannot build correctly using Visual Studio 6 - # on Windows 98 if the path of its build tree exceeds 72 - # characters in length... So don't attempt to build it - # in a long path on Win98: - # - if(CMAKE_SYSTEM STREQUAL "Windows-4.10") - string(LENGTH "${binary_base}/TutorialStep5-Local" n) - if(n GREATER 72) - set(can_build_tutorial_step5 0) - endif() - endif() - - # The ExternalProject builds of Tutorial Step5 cannot be built - # correctly 2nd and later times in an in-source build... - # (because the CMakeCache.txt from the real in-source build of - # the Tests/Tutorial/Step5 directory gets copied when we do - # the "source directory copy" step... but it still refers to - # its original path which yields a configure error.) So: - # - if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - set(can_build_tutorial_step5 0) - endif() -endif() - add_custom_target(NonExternalProjectTarget COMMAND ${CMAKE_COMMAND} -E echo NonExternalProjectTarget) @@ -98,6 +73,7 @@ ExternalProject_Add(${proj} CVS_TAG "" DEPENDS "MinimalNoOpProject" NonExternalProjectTarget DOWNLOAD_COMMAND "" + DOWNLOAD_NO_PROGRESS 1 INSTALL_COMMAND "" PATCH_COMMAND "" STEP_TARGETS install update @@ -115,142 +91,6 @@ ExternalProject_Add(${proj} set_property(TARGET ${proj} PROPERTY FOLDER "") -# Local DIR: -# -if(can_build_tutorial_step5) - set(proj TutorialStep5-Local) - ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5" - CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> - CMAKE_ARGS -G ${CMAKE_GENERATOR} <SOURCE_DIR> - TEST_BEFORE_INSTALL 1 - LOG_INSTALL 1 - ) - set_property(TARGET ${proj} PROPERTY FOLDER "Local") - ExternalProject_Get_Property(${proj} install_dir) - set(TutorialStep5_install_dir ${install_dir}) - - set(proj TutorialStep5-Local-TestAfterInstall) - ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5" - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> - TEST_AFTER_INSTALL 1 - LOG_TEST 1 - ) - set_property(TARGET ${proj} PROPERTY FOLDER "Local") -endif() - - -# Local TAR: -# -set(proj TutorialStep1-LocalTAR) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar" - URL_MD5 a87c5b47c0201c09ddfe1d5738fdb1e3 - LIST_SEPARATOR :: - PATCH_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake - CMAKE_GENERATOR "${CMAKE_GENERATOR}" - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> - -DTEST_LIST:STRING=A::B::C - INSTALL_COMMAND "" - LOG_CONFIGURE 1 -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR") - -set(proj TutorialStep1-LocalNoDirTAR) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar" - URL_MD5 d09e3d370c5c908fa035c30939ee438e - LIST_SEPARATOR @@ - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> - -DTEST_LIST:STRING=1@@2@@3 - INSTALL_COMMAND "" -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR") -ExternalProject_Add_Step(${proj} mypatch - COMMAND ${CMAKE_COMMAND} -E echo "This is a custom external project step." - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake - WORKING_DIRECTORY <SOURCE_DIR> - DEPENDEES download - DEPENDERS configure - ) - - -# Local TGZ: -# -set(proj TutorialStep1-LocalTGZ) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tgz" - URL_MD5 38c648e817339c356f6be00eeed79bd0 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> - INSTALL_COMMAND "" - LOG_BUILD 1 -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") - -set(proj TutorialStep1-LocalNoDirTGZ) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tgz" - URL_HASH SHA256=496229e2a5ed620a37c385ad9406004a18026beab8b55dd2c4565d4b7f1d5383 - CMAKE_GENERATOR "${CMAKE_GENERATOR}" - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> - INSTALL_COMMAND "" -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") - - -# Local BZ2: -# -# (The bz2 tests are here just to verify that the bz2 decompression is executed -# during a test suite run... The configure and build commands are set to -# nothing to make the test quicker. To make this more complete, I should add -# a diff between this and the TGZ source tree since that one does build...) -# -set(proj TutorialStep1-LocalBZ2) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar.bz2" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2") - -set(proj TutorialStep1-LocalNoDirBZ2) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar.bz2" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2") - - -# Local ZIP: -# -# (The zip tests are here just to verify that the zip decompression is executed -# during a test suite run... The configure and build commands are set to -# nothing to make the test quicker. To make this more complete, I should add -# a diff between this and the TGZ source tree since that one does build...) -# -set(proj TutorialStep1-LocalZIP) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.zip" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP") - -set(proj TutorialStep1-LocalNoDirZIP) -ExternalProject_Add(${proj} - URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.zip" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) -set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP") - - # CVS-based tests: # set(do_cvs_tests 0) @@ -336,10 +176,6 @@ if(do_cvs_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalCVSRepository" DEPENDS "EmptyNoOpProject" - DEPENDS "TutorialStep1-LocalTAR" - DEPENDS "TutorialStep1-LocalNoDirTAR" - DEPENDS "TutorialStep1-LocalTGZ" - DEPENDS "TutorialStep1-LocalNoDirTGZ" DEPENDS "TutorialStep1-CVS-20090626" DEPENDS "TutorialStep1-CVS-testtag1" ) @@ -611,29 +447,6 @@ enable_testing() # # BuildTree tests: # -if(can_build_tutorial_step5) - add_test(TutorialStep5-Local-BuildTreeTest - "${binary_base}/TutorialStep5-Local/Tutorial" 42) - set_property(TEST TutorialStep5-Local-BuildTreeTest - APPEND PROPERTY LABELS Step5 BuildTree) -endif() - -add_test(TutorialStep1-LocalTAR-BuildTreeTest - "${binary_base}/TutorialStep1-LocalTAR/EP-Tutorial" 36) -set_property(TEST TutorialStep1-LocalTAR-BuildTreeTest - APPEND PROPERTY LABELS TAR) - -add_test(TutorialStep1-LocalNoDirTAR-BuildTreeTest - "${binary_base}/TutorialStep1-LocalNoDirTAR/EP-Tutorial" 25) - -add_test(TutorialStep1-LocalTGZ-BuildTreeTest - "${binary_base}/TutorialStep1-LocalTGZ/Tutorial" 16) -set_property(TEST TutorialStep1-LocalTGZ-BuildTreeTest - APPEND PROPERTY LABELS TGZ) - -add_test(TutorialStep1-LocalNoDirTGZ-BuildTreeTest - "${binary_base}/TutorialStep1-LocalNoDirTGZ/Tutorial" 9) - if(do_cvs_tests) add_test(TutorialStep1-CVS-20090626-BuildTreeTest "${binary_base}/TutorialStep1-CVS-20090626/Tutorial" 4) @@ -668,17 +481,6 @@ if(do_git_tests) endif() -# InstallTree tests: -# -if(can_build_tutorial_step5) - add_test(TutorialStep5-InstallTreeTest - "${TutorialStep5_install_dir}/bin/Tutorial" 49) - set_property(TEST TutorialStep5-InstallTreeTest - APPEND PROPERTY LABELS Step5 InstallTree) -endif() - - -message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'") message(STATUS "do_cvs_tests='${do_cvs_tests}'") message(STATUS "do_svn_tests='${do_svn_tests}'") message(STATUS "do_git_tests='${do_git_tests}' GIT_EXECUTABLE='${GIT_EXECUTABLE}'") diff --git a/Tests/ExternalProject/TryCheckout.cmake b/Tests/ExternalProject/TryCheckout.cmake deleted file mode 100644 index 6a396c3..0000000 --- a/Tests/ExternalProject/TryCheckout.cmake +++ /dev/null @@ -1,54 +0,0 @@ -find_package(CVS) -find_package(Subversion) - - -function(try_cvs_checkout repository module dir result_var) - # Assume cvs checkouts will not work: - set(${result_var} 0 PARENT_SCOPE) - - if(CVS_EXECUTABLE) - message(STATUS "try_cvs_checkout") - - # Ensure directory exists so we can call cvs in it: - file(MAKE_DIRECTORY "${dir}") - - # Try to do the cvs checkout command: - execute_process(COMMAND ${CVS_EXECUTABLE} -d ${repository} co ${module} - WORKING_DIRECTORY ${dir} - TIMEOUT 30 - RESULT_VARIABLE rv) - - # If it worked, cvs checkouts will work: - if(rv EQUAL 0) - set(${result_var} 1 PARENT_SCOPE) - endif() - - message(STATUS "try_cvs_checkout -- done") - endif() -endfunction() - - -function(try_svn_checkout repository dir result_var) - # Assume svn checkouts will not work: - set(${result_var} 0 PARENT_SCOPE) - - if(Subversion_SVN_EXECUTABLE) - message(STATUS "try_svn_checkout") - - # Ensure directory exists so we can call svn in it: - file(MAKE_DIRECTORY "${dir}") - - # Try to do the svn checkout command: - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} co ${repository} ${dir} - WORKING_DIRECTORY ${dir} - TIMEOUT 30 - RESULT_VARIABLE rv) - - # If it worked, svn checkouts will work: - if(rv EQUAL 0) - set(${result_var} 1 PARENT_SCOPE) - endif() - - message(STATUS "try_svn_checkout -- done") - endif() -endfunction() diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt new file mode 100644 index 0000000..f942197 --- /dev/null +++ b/Tests/ExternalProjectLocal/CMakeLists.txt @@ -0,0 +1,229 @@ +cmake_minimum_required(VERSION 2.8) +project(ExternalProjectLocalTest NONE) + +include(ExternalProject) + +# Test ExternalProject with local projects + +option(ExternalProjectTest_USE_FOLDERS "Enable folder grouping in IDEs." ON) +if(ExternalProjectTest_USE_FOLDERS) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +else() + set_property(GLOBAL PROPERTY USE_FOLDERS OFF) +endif() + +set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER + "CMakePredefinedTargets-in-ExternalProjectTest") + +set(base "${CMAKE_BINARY_DIR}/CMakeExternals") +set(binary_base "${base}/Build") +set_property(DIRECTORY PROPERTY EP_BASE ${base}) +set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) + +if(NOT DEFINED can_build_tutorial_step5) + set(can_build_tutorial_step5 1) + + # Tutorial Step5 cannot build correctly using Visual Studio 6 + # on Windows 98 if the path of its build tree exceeds 72 + # characters in length... So don't attempt to build it + # in a long path on Win98: + # + if(CMAKE_SYSTEM STREQUAL "Windows-4.10") + string(LENGTH "${binary_base}/TutorialStep5-Local" n) + if(n GREATER 72) + set(can_build_tutorial_step5 0) + endif() + endif() + + # The ExternalProject builds of Tutorial Step5 cannot be built + # correctly 2nd and later times in an in-source build... + # (because the CMakeCache.txt from the real in-source build of + # the Tests/Tutorial/Step5 directory gets copied when we do + # the "source directory copy" step... but it still refers to + # its original path which yields a configure error.) So: + # + if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + set(can_build_tutorial_step5 0) + endif() +endif() + +# Local DIR: +# +if(can_build_tutorial_step5) + set(proj TutorialStep5-Local) + ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5" + CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> + CMAKE_ARGS -G ${CMAKE_GENERATOR} <SOURCE_DIR> + TEST_BEFORE_INSTALL 1 + LOG_INSTALL 1 + ) + set_property(TARGET ${proj} PROPERTY FOLDER "Local") + ExternalProject_Get_Property(${proj} install_dir) + set(TutorialStep5_install_dir ${install_dir}) + + set(proj TutorialStep5-Local-TestAfterInstall) + ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> + TEST_AFTER_INSTALL 1 + LOG_TEST 1 + ) + set_property(TARGET ${proj} PROPERTY FOLDER "Local") +endif() + + +# Local TAR: +# +set(proj TutorialStep1-LocalTAR) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar" + URL_MD5 a87c5b47c0201c09ddfe1d5738fdb1e3 + LIST_SEPARATOR :: + PATCH_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake + CMAKE_GENERATOR "${CMAKE_GENERATOR}" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> + -DTEST_LIST:STRING=A::B::C + INSTALL_COMMAND "" + LOG_CONFIGURE 1 +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR") + +set(proj TutorialStep1-LocalNoDirTAR) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar" + URL_MD5 d09e3d370c5c908fa035c30939ee438e + LIST_SEPARATOR @@ + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> + -DTEST_LIST:STRING=1@@2@@3 + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR") +ExternalProject_Add_Step(${proj} mypatch + COMMAND ${CMAKE_COMMAND} -E echo "This is a custom external project step." + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake + WORKING_DIRECTORY <SOURCE_DIR> + DEPENDEES download + DEPENDERS configure + ) + + +# Local TGZ: +# +set(proj TutorialStep1-LocalTGZ) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tgz" + URL_MD5 38c648e817339c356f6be00eeed79bd0 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> + INSTALL_COMMAND "" + LOG_BUILD 1 +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") + +set(proj TutorialStep1-LocalNoDirTGZ) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tgz" + URL_HASH SHA256=496229e2a5ed620a37c385ad9406004a18026beab8b55dd2c4565d4b7f1d5383 + CMAKE_GENERATOR "${CMAKE_GENERATOR}" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") + + +# Local BZ2: +# +# (The bz2 tests are here just to verify that the bz2 decompression is executed +# during a test suite run... The configure and build commands are set to +# nothing to make the test quicker. To make this more complete, I should add +# a diff between this and the TGZ source tree since that one does build...) +# +set(proj TutorialStep1-LocalBZ2) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar.bz2" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2") + +set(proj TutorialStep1-LocalNoDirBZ2) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar.bz2" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2") + + +# Local ZIP: +# +# (The zip tests are here just to verify that the zip decompression is executed +# during a test suite run... The configure and build commands are set to +# nothing to make the test quicker. To make this more complete, I should add +# a diff between this and the TGZ source tree since that one does build...) +# +set(proj TutorialStep1-LocalZIP) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.zip" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP") + +set(proj TutorialStep1-LocalNoDirZIP) +ExternalProject_Add(${proj} + URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.zip" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP") + + +# Test the testable built/installed products: +# +enable_testing() + + +# Do at least a smoke test of a built executable from each +# project's build directory... +# +# BuildTree tests: +# +if(can_build_tutorial_step5) + add_test(TutorialStep5-Local-BuildTreeTest + "${binary_base}/TutorialStep5-Local/Tutorial" 42) + set_property(TEST TutorialStep5-Local-BuildTreeTest + APPEND PROPERTY LABELS Step5 BuildTree) +endif() + +add_test(TutorialStep1-LocalTAR-BuildTreeTest + "${binary_base}/TutorialStep1-LocalTAR/EP-Tutorial" 36) +set_property(TEST TutorialStep1-LocalTAR-BuildTreeTest + APPEND PROPERTY LABELS TAR) + +add_test(TutorialStep1-LocalNoDirTAR-BuildTreeTest + "${binary_base}/TutorialStep1-LocalNoDirTAR/EP-Tutorial" 25) + +add_test(TutorialStep1-LocalTGZ-BuildTreeTest + "${binary_base}/TutorialStep1-LocalTGZ/Tutorial" 16) +set_property(TEST TutorialStep1-LocalTGZ-BuildTreeTest + APPEND PROPERTY LABELS TGZ) + +add_test(TutorialStep1-LocalNoDirTGZ-BuildTreeTest + "${binary_base}/TutorialStep1-LocalNoDirTGZ/Tutorial" 9) + +# InstallTree tests: +# +if(can_build_tutorial_step5) + add_test(TutorialStep5-InstallTreeTest + "${TutorialStep5_install_dir}/bin/Tutorial" 49) + set_property(TEST TutorialStep5-InstallTreeTest + APPEND PROPERTY LABELS Step5 InstallTree) +endif() + + +message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'") diff --git a/Tests/ExternalProject/Step1.tar b/Tests/ExternalProjectLocal/Step1.tar Binary files differindex 3711f07..3711f07 100644 --- a/Tests/ExternalProject/Step1.tar +++ b/Tests/ExternalProjectLocal/Step1.tar diff --git a/Tests/ExternalProject/Step1.tar.bz2 b/Tests/ExternalProjectLocal/Step1.tar.bz2 Binary files differindex 49b5f23..49b5f23 100644 --- a/Tests/ExternalProject/Step1.tar.bz2 +++ b/Tests/ExternalProjectLocal/Step1.tar.bz2 diff --git a/Tests/ExternalProject/Step1.tgz b/Tests/ExternalProjectLocal/Step1.tgz Binary files differindex d9b4cd2..d9b4cd2 100644 --- a/Tests/ExternalProject/Step1.tgz +++ b/Tests/ExternalProjectLocal/Step1.tgz diff --git a/Tests/ExternalProject/Step1.zip b/Tests/ExternalProjectLocal/Step1.zip Binary files differindex 49dac24..49dac24 100644 --- a/Tests/ExternalProject/Step1.zip +++ b/Tests/ExternalProjectLocal/Step1.zip diff --git a/Tests/ExternalProject/Step1NoDir.tar b/Tests/ExternalProjectLocal/Step1NoDir.tar Binary files differindex 03664b8..03664b8 100644 --- a/Tests/ExternalProject/Step1NoDir.tar +++ b/Tests/ExternalProjectLocal/Step1NoDir.tar diff --git a/Tests/ExternalProject/Step1NoDir.tar.bz2 b/Tests/ExternalProjectLocal/Step1NoDir.tar.bz2 Binary files differindex 92eb480..92eb480 100644 --- a/Tests/ExternalProject/Step1NoDir.tar.bz2 +++ b/Tests/ExternalProjectLocal/Step1NoDir.tar.bz2 diff --git a/Tests/ExternalProject/Step1NoDir.tgz b/Tests/ExternalProjectLocal/Step1NoDir.tgz Binary files differindex 71a2d81..71a2d81 100644 --- a/Tests/ExternalProject/Step1NoDir.tgz +++ b/Tests/ExternalProjectLocal/Step1NoDir.tgz diff --git a/Tests/ExternalProject/Step1NoDir.zip b/Tests/ExternalProjectLocal/Step1NoDir.zip Binary files differindex b42d318..b42d318 100644 --- a/Tests/ExternalProject/Step1NoDir.zip +++ b/Tests/ExternalProjectLocal/Step1NoDir.zip diff --git a/Tests/ExternalProject/Step1Patch.cmake b/Tests/ExternalProjectLocal/Step1Patch.cmake index 35e09d9..35e09d9 100644 --- a/Tests/ExternalProject/Step1Patch.cmake +++ b/Tests/ExternalProjectLocal/Step1Patch.cmake diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake index b6f848a..6c7bcfe 100644 --- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake +++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake @@ -12,7 +12,8 @@ macro(check_a_tag desired_tag resulting_sha fetch_expected) # Configure execute_process(COMMAND ${CMAKE_COMMAND} - -G ${CMAKE_TEST_GENERATOR} -T "${CMAKE_TEST_GENERATOR_TOOLSET}" + -G ${CMAKE_GENERATOR} -T "${CMAKE_GENERATOR_TOOLSET}" + -A "${CMAKE_GENERATOR_PLATFORM}" -DTEST_GIT_TAG:STRING=${desired_tag} ${ExternalProjectUpdate_SOURCE_DIR} WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR} diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt index 5d1b376..8e21c32 100644 --- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt +++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt @@ -10,7 +10,7 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile") ERROR_QUIET TIMEOUT 10) string(TOUPPER "${makeVersionOutput}" MAKE_VERSION_OUTPUT) - if("${MAKE_VERSION_OUTPUT}" MATCHES ".*GNU MAKE.*") + if("${MAKE_VERSION_OUTPUT}" MATCHES "GNU MAKE") # build a library which we can search during the test add_library(foo STATIC foo.cpp) diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index a77713f..f311fb9 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -320,23 +320,61 @@ endif() #----------------------------------------------------------------------------- # Test export(PACKAGE) with find_package. + +# Choose a unique version. +string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) +string(RANDOM LENGTH 4 ALPHABET "0123456789" v) +set(version "${version}.${v}") + message(STATUS "Preparing export(PACKAGE) test project") try_compile(EXPORTER_COMPILED - ${FindPackageTest_BINARY_DIR}/Exporter + ${FindPackageTest_BINARY_DIR}/Exporter-build ${FindPackageTest_SOURCE_DIR}/Exporter CMakeTestExportPackage dummy + CMAKE_FLAGS "-UCMAKE_EXPORT_NO_PACKAGE_REGISTRY" + -Dversion=${version} OUTPUT_VARIABLE output) message(STATUS "Searching for export(PACKAGE) test project") set(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +message(STATUS "Searching for export(PACKAGE) test project with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE") +set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY TRUE) +set(CMakeTestExportPackage_DIR "" CACHE FILEPATH + "Wipe out find results for testing." FORCE) +find_package(CMakeTestExportPackage 1.${version} EXACT QUIET) +if(CMakeTestExportPackage_FOUND) + message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!") +endif() +unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY) + +message(STATUS "Remove export(PACKAGE) test project") +file(REMOVE_RECURSE ${FindPackageTest_BINARY_DIR}/Exporter-build) +set(CMakeTestExportPackage_DIR "" CACHE FILEPATH + "Wipe out find results for testing." FORCE) +find_package(CMakeTestExportPackage QUIET) # Should clean the user package cache +# +message(STATUS "Preparing export(PACKAGE) test project with CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE") +try_compile(EXPORTER_COMPILED + ${FindPackageTest_BINARY_DIR}/Exporter-build + ${FindPackageTest_SOURCE_DIR}/Exporter + CMakeTestExportPackage dummy + CMAKE_FLAGS "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=TRUE" + -Dversion=${version} + OUTPUT_VARIABLE output) +message(STATUS "Searching for export(PACKAGE) test project") +find_package(CMakeTestExportPackage 1.${version} EXACT QUIET) +if(CMakeTestExportPackage_FOUND) + message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!") +endif() + #----------------------------------------------------------------------------- # Test configure_package_config_file(). include(CMakePackageConfigHelpers) +# Generate a config file ready to be installed. set(INCLUDE_INSTALL_DIR include ) set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/" ) set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) @@ -370,6 +408,43 @@ if(Relocatable_FOUND) message(SEND_ERROR "Relocatable_FOUND set to TRUE !") endif() +# Generate a config file for the build tree. +set(INCLUDE_INSTALL_DIR include ) +set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/share/" ) +set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) + +configure_package_config_file(RelocatableConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/RelocatableConfig.cmake" + INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" + PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR + INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" + ) + +set(Relocatable_FIND_COMPONENTS AComp BComp CComp) +set(Relocatable_FIND_REQUIRED_BComp 1) +include("${CMAKE_CURRENT_BINARY_DIR}/RelocatableConfig.cmake") + +if(NOT "${RELOC_INCLUDE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/include") + message(SEND_ERROR "RELOC_INCLUDE_DIR set by configure_package_config_file() is set to \"${RELOC_INCLUDE_DIR}\" (expected \"${CMAKE_CURRENT_BINARY_DIR}/include\")") +endif() + +if(NOT "${RELOC_SHARE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/share/") + message(SEND_ERROR "RELOC_SHARE_DIR set by configure_package_config_file() is set to \"${RELOC_SHARE_DIR}\" (expected \"${CMAKE_CURRENT_BINARY_DIR}/share/\")") +endif() + +if(NOT "${RELOC_BUILD_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + message(SEND_ERROR "RELOC_BUILD_DIR set by configure_package_config_file() is set to \"${RELOC_BUILD_DIR}\" (expected \"${CMAKE_CURRENT_BINARY_DIR}\")") +endif() + +if(NOT DEFINED Relocatable_FOUND) + message(SEND_ERROR "Relocatable_FOUND not defined !") +endif() + +if(Relocatable_FOUND) + message(SEND_ERROR "Relocatable_FOUND set to TRUE !") +endif() + + + #----------------------------------------------------------------------------- # Test write_basic_config_version_file(). diff --git a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in index 42bd84e..6eac6e6 100644 --- a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in +++ b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in @@ -1,5 +1,5 @@ # Test config file. -set(PACKAGE_VERSION "1.@CMAKE_VERSION@") +set(PACKAGE_VERSION "1.@version@") if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") set(PACKAGE_VERSION_COMPATIBLE 1) set(PACKAGE_VERSION_EXACT 1) diff --git a/Tests/FindPackageTest/FindLotsOfComponents.cmake b/Tests/FindPackageTest/FindLotsOfComponents.cmake index 9076d86..5d959c5 100644 --- a/Tests/FindPackageTest/FindLotsOfComponents.cmake +++ b/Tests/FindPackageTest/FindLotsOfComponents.cmake @@ -4,7 +4,7 @@ set(LotsOfComponents_AComp_FOUND TRUE) set(LotsOfComponents_BComp_FOUND FALSE) set(LotsOfComponents_CComp_FOUND TRUE) -include(FindPackageHandleStandardArgs) +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(LotsOfComponents REQUIRED_VARS LOC_FOO HANDLE_COMPONENTS) diff --git a/Tests/FindPackageTest/FindSomePackage.cmake b/Tests/FindPackageTest/FindSomePackage.cmake index 83d1d0e..7283d24 100644 --- a/Tests/FindPackageTest/FindSomePackage.cmake +++ b/Tests/FindPackageTest/FindSomePackage.cmake @@ -1,6 +1,6 @@ set(SOP_FOO TRUE) -include(FindPackageHandleStandardArgs) +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO FOUND_VAR SomePackage_FOUND ) diff --git a/Tests/FindPackageTest/FindUpperCasePackage.cmake b/Tests/FindPackageTest/FindUpperCasePackage.cmake index 66c2fea..425d417 100644 --- a/Tests/FindPackageTest/FindUpperCasePackage.cmake +++ b/Tests/FindPackageTest/FindUpperCasePackage.cmake @@ -1,6 +1,6 @@ set(UCP_FOO TRUE) -include(FindPackageHandleStandardArgs) +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO FOUND_VAR UPPERCASEPACKAGE_FOUND ) diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index adc4308..1982a60 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.0) project(testf C CXX Fortran) -if(NOT DEFINED CMAKE_TEST_MAKEPROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") - set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}") +if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") endif() message("CTEST_FULL_OUTPUT ") @@ -201,6 +201,7 @@ if(TEST_MODULE_DEPENDS) --build-two-config --build-project ExtFort --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options -DCMAKE_Fortran_COMPILER:STRING=${CMAKE_Fortran_COMPILER} -DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS} @@ -208,7 +209,7 @@ if(TEST_MODULE_DEPENDS) -DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE} -DCMAKE_Fortran_FLAGS_MINSIZEREL:STRING=${CMAKE_Fortran_FLAGS_MINSIZEREL} -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} - -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM} + -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_NESTED_MAKE_PROGRAM} ${External_BUILD_TYPE} VERBATIM ) diff --git a/Tests/FortranC/Flags.cmake.in b/Tests/FortranC/Flags.cmake.in index 3436309..2300fc6 100644 --- a/Tests/FortranC/Flags.cmake.in +++ b/Tests/FortranC/Flags.cmake.in @@ -14,8 +14,9 @@ set(COMMAND) execute_process( WORKING_DIRECTORY "${bld}" - COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_TEST_GENERATOR@" - -T "@CMAKE_TEST_GENERATOR_TOOLSET@" + COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_GENERATOR@" + -A "@CMAKE_GENERATOR_PLATFORM@" + -T "@CMAKE_GENERATOR_TOOLSET@" "-DFortranC_TEST_FLAGS=1" "-DCMAKE_C_COMPILER=${bld}/cc.sh" "-DCMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@" diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index d57a8b2..a3f83c9 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -43,3 +43,25 @@ add_custom_target(checksayhello ALL COMMAND ${CMAKE_COMMAND} -P ${FortranOnly_SOURCE_DIR}/checksayhello.cmake ) add_dependencies(checksayhello sayhello) + +# Exclude this test on IBM XL for now because the check strangely +# fails with 'ld: 0706-029 Use a number with the -H flag'. +if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL) + set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log) + file(REMOVE "${err_log}") + include(CheckFortranSourceCompiles) + unset(HAVE_PRINT CACHE) + CHECK_Fortran_SOURCE_COMPILES([[ + PROGRAM TEST_HAVE_PRINT + PRINT *, 'Hello' + END +]] HAVE_PRINT) + if(NOT HAVE_PRINT) + if(EXISTS "${err_log}") + file(READ "${err_log}" err) + endif() + string(REPLACE "\n" "\n " err " ${err}") + message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n" + "${err}") + endif() +endif() diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index d1fada4..68da972 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -92,7 +92,7 @@ endfunction() STRANGE_FUNCTION(var) set(second_var "second_var") -if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +if("x${var}" STREQUAL "xstrange_function" AND "x${second_var}" STREQUAL "xsecond_var") PASS("Case Test" "(${var} ${second_var})") else() FAILED("Case test" "(${var} ${second_var})") diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index a0e34ef..758165c 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -166,7 +166,7 @@ add_library(imported4 SHARED IMPORTED) set_property(TARGET imported4 APPEND PROPERTY INCLUDE_DIRECTORIES $<TARGET_PROPERTY:imported3,INTERFACE_INCLUDE_DIRECTORIES>) -add_executable(someexe empty.cpp) +add_executable(someexe $<1:empty.cpp> $<0:does_not_exist>) add_executable(Alias::SomeExe ALIAS someexe) add_library(Alias::SomeLib ALIAS empty1) diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index 81b34e6..fe202dd 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -8,8 +8,22 @@ target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE) add_subdirectory(headerdir) +# Add an interface target in a subdirectory that uses an imported interface. +add_subdirectory(ifacedir) + +# Poison an imported interface with the same name as that in the subdir +# to ensure that the transitive lookup occurs in the subdir. +add_library(imp::iface INTERFACE IMPORTED) +set_property(TARGET imp::iface APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMEPROP) +set_property(TARGET imp::iface PROPERTY INTERFACE_SOMEPROP OFF) +set_property(TARGET imp::iface PROPERTY INTERFACE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp) + +add_library(objlib OBJECT obj.cpp) +add_library(iface_objlib INTERFACE) +target_sources(iface_objlib INTERFACE $<TARGET_OBJECTS:objlib>) + add_executable(InterfaceLibrary definetestexe.cpp) -target_link_libraries(InterfaceLibrary iface_nodepends headeriface) +target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface iface_objlib) add_subdirectory(libsdir) diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp index e7a10c1..9044076 100644 --- a/Tests/InterfaceLibrary/definetestexe.cpp +++ b/Tests/InterfaceLibrary/definetestexe.cpp @@ -15,7 +15,10 @@ #error Expected IFACE_HEADER_BUILDDIR #endif +extern int obj(); +extern int sub(); + int main(int,char**) { - return 0; + return obj() + sub(); } diff --git a/Tests/InterfaceLibrary/ifacedir/CMakeLists.txt b/Tests/InterfaceLibrary/ifacedir/CMakeLists.txt new file mode 100644 index 0000000..228715e --- /dev/null +++ b/Tests/InterfaceLibrary/ifacedir/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(imp::iface INTERFACE IMPORTED) +set_property(TARGET imp::iface APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMEPROP) +set_property(TARGET imp::iface PROPERTY INTERFACE_SOMEPROP ON) +set_property(TARGET imp::iface PROPERTY INTERFACE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sub.cpp) + +add_library(subiface INTERFACE) +target_link_libraries(subiface INTERFACE imp::iface) +set_property(TARGET subiface PROPERTY INTERFACE_SOMEPROP ON) diff --git a/Tests/InterfaceLibrary/ifacedir/sub.cpp b/Tests/InterfaceLibrary/ifacedir/sub.cpp new file mode 100644 index 0000000..165a66a --- /dev/null +++ b/Tests/InterfaceLibrary/ifacedir/sub.cpp @@ -0,0 +1 @@ +int sub() { return 0; } diff --git a/Tests/InterfaceLibrary/obj.cpp b/Tests/InterfaceLibrary/obj.cpp new file mode 100644 index 0000000..ee6f5fe --- /dev/null +++ b/Tests/InterfaceLibrary/obj.cpp @@ -0,0 +1 @@ +int obj() { return 0; } diff --git a/Tests/InterfaceLinkLibraries/CMakeLists.txt b/Tests/InterfaceLinkLibraries/CMakeLists.txt index bd0cf74..9e14c44 100644 --- a/Tests/InterfaceLinkLibraries/CMakeLists.txt +++ b/Tests/InterfaceLinkLibraries/CMakeLists.txt @@ -9,6 +9,9 @@ target_compile_definitions(foo_shared INTERFACE FOO_LIBRARY) add_library(bar_shared SHARED bar_vs6_1.cpp) target_compile_definitions(bar_shared INTERFACE BAR_LIBRARY) set_property(TARGET bar_shared APPEND PROPERTY INTERFACE_LINK_LIBRARIES foo_shared) +add_library(zot_shared SHARED zot_vs6_1.cpp) +target_compile_definitions(zot_shared INTERFACE ZOT_LIBRARY) +set_property(TARGET bar_shared APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:zot_shared>) add_executable(shared_test main_vs6_1.cpp) set_property(TARGET shared_test APPEND PROPERTY LINK_LIBRARIES bar_shared) @@ -18,6 +21,9 @@ target_compile_definitions(foo_static INTERFACE FOO_LIBRARY) add_library(bar_static STATIC bar_vs6_2.cpp) target_compile_definitions(bar_static INTERFACE BAR_LIBRARY) set_property(TARGET bar_static APPEND PROPERTY INTERFACE_LINK_LIBRARIES foo_static) +add_library(zot_static STATIC zot_vs6_2.cpp) +target_compile_definitions(zot_static INTERFACE ZOT_LIBRARY) +set_property(TARGET bar_static APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:zot_static>) add_executable(static_test main_vs6_2.cpp) set_property(TARGET static_test APPEND PROPERTY LINK_LIBRARIES bar_static) @@ -31,6 +37,9 @@ target_compile_definitions(bar_shared_private INTERFACE BAR_LIBRARY) target_compile_definitions(bar_shared_private PRIVATE BAR_USE_BANG) set_property(TARGET bar_shared_private APPEND PROPERTY LINK_LIBRARIES bang_shared_private) set_property(TARGET bar_shared_private APPEND PROPERTY INTERFACE_LINK_LIBRARIES foo_shared_private) +add_library(zot_shared_private SHARED zot_vs6_3.cpp) +target_compile_definitions(zot_shared_private INTERFACE ZOT_LIBRARY) +set_property(TARGET bar_shared_private APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:zot_shared_private>) add_executable(shared_private_test main_vs6_3.cpp) set_property(TARGET shared_private_test APPEND PROPERTY LINK_LIBRARIES bar_shared_private) @@ -44,6 +53,9 @@ target_compile_definitions(bar_static_private INTERFACE BAR_LIBRARY) target_compile_definitions(bar_static_private PRIVATE BAR_USE_BANG) set_property(TARGET bar_static_private APPEND PROPERTY LINK_LIBRARIES bang_static_private) set_property(TARGET bar_static_private APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:bang_static_private> foo_static_private) +add_library(zot_static_private STATIC zot_vs6_4.cpp) +target_compile_definitions(zot_static_private INTERFACE ZOT_LIBRARY) +set_property(TARGET bar_static_private APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:zot_static_private>) add_executable(InterfaceLinkLibraries main_vs6_4.cpp) set_property(TARGET InterfaceLinkLibraries APPEND PROPERTY LINK_LIBRARIES bar_static_private) diff --git a/Tests/InterfaceLinkLibraries/main.cpp b/Tests/InterfaceLinkLibraries/main.cpp index a54076a..6e1295a 100644 --- a/Tests/InterfaceLinkLibraries/main.cpp +++ b/Tests/InterfaceLinkLibraries/main.cpp @@ -11,9 +11,13 @@ #error Unexpected BANG_LIBRARY #endif -#include "bar.h" +#ifdef ZOT_LIBRARY +#error Unexpected ZOT_LIBRARY +#endif + +#include "zot.h" int main(void) { - return foo() + bar(); + return foo() + bar() + zot(); } diff --git a/Tests/InterfaceLinkLibraries/zot.cpp b/Tests/InterfaceLinkLibraries/zot.cpp new file mode 100644 index 0000000..69462b0 --- /dev/null +++ b/Tests/InterfaceLinkLibraries/zot.cpp @@ -0,0 +1,6 @@ +#include "zot.h" + +int zot() +{ + return 0; +} diff --git a/Tests/InterfaceLinkLibraries/zot.h b/Tests/InterfaceLinkLibraries/zot.h new file mode 100644 index 0000000..5e4fb1e --- /dev/null +++ b/Tests/InterfaceLinkLibraries/zot.h @@ -0,0 +1,7 @@ + +#include "bar.h" + +#ifdef _WIN32 +__declspec(dllexport) +#endif +int zot(); diff --git a/Tests/InterfaceLinkLibraries/zot_vs6_1.cpp b/Tests/InterfaceLinkLibraries/zot_vs6_1.cpp new file mode 100644 index 0000000..c588c5f --- /dev/null +++ b/Tests/InterfaceLinkLibraries/zot_vs6_1.cpp @@ -0,0 +1 @@ +#include "zot.cpp" diff --git a/Tests/InterfaceLinkLibraries/zot_vs6_2.cpp b/Tests/InterfaceLinkLibraries/zot_vs6_2.cpp new file mode 100644 index 0000000..c588c5f --- /dev/null +++ b/Tests/InterfaceLinkLibraries/zot_vs6_2.cpp @@ -0,0 +1 @@ +#include "zot.cpp" diff --git a/Tests/InterfaceLinkLibraries/zot_vs6_3.cpp b/Tests/InterfaceLinkLibraries/zot_vs6_3.cpp new file mode 100644 index 0000000..c588c5f --- /dev/null +++ b/Tests/InterfaceLinkLibraries/zot_vs6_3.cpp @@ -0,0 +1 @@ +#include "zot.cpp" diff --git a/Tests/InterfaceLinkLibraries/zot_vs6_4.cpp b/Tests/InterfaceLinkLibraries/zot_vs6_4.cpp new file mode 100644 index 0000000..c588c5f --- /dev/null +++ b/Tests/InterfaceLinkLibraries/zot_vs6_4.cpp @@ -0,0 +1 @@ +#include "zot.cpp" diff --git a/Tests/JacocoCoverage/Coverage/src/main/java/org/cmake/CoverageTest.java b/Tests/JacocoCoverage/Coverage/src/main/java/org/cmake/CoverageTest.java new file mode 100644 index 0000000..4fb43c6 --- /dev/null +++ b/Tests/JacocoCoverage/Coverage/src/main/java/org/cmake/CoverageTest.java @@ -0,0 +1,52 @@ +package org.cmake.Coverage; + +import java.io.Serializable; +import java.util.Map; +import java.util.List; +import java.awt.*; + +public class CoverageTest { + + public static String VarOne = "test1"; + public static String VarTwo = "test2"; + private Integer IntOne = 4; + + public static Boolean equalsVarOne(String inString) { + + if(VarOne.equals(inString)){ + return true; + } + else { + return false; + } + } + + public static boolean equalsVarTwo(String inString){ + + if(VarTwo.equals(inString)){ + return true; + } + else { + return false; + } + } + + private Integer timesIntOne(Integer inVal){ + + return inVal * IntOne; + } + + public static boolean whileLoop(Integer StopInt){ + + Integer i = 0; + while(i < StopInt){ + i=i+1; + } + if (i.equals(5)){ + return true; + } + else { + return false; + } + } +} diff --git a/Tests/JacocoCoverage/Coverage/target/site/jacoco.xml b/Tests/JacocoCoverage/Coverage/target/site/jacoco.xml new file mode 100644 index 0000000..49c3e87 --- /dev/null +++ b/Tests/JacocoCoverage/Coverage/target/site/jacoco.xml @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd"><report name="Coverage"><sessioninfo id="vagrant-ubuntu-precise-32-f1c264e9" start="1402427058670" dump="1402427059269"/><package name="org/cmake"><class name="org/cmake/Coverage/CoverageTest"><method name="<init>" desc="()V" line="8"><counter type="INSTRUCTION" missed="7" covered="0"/><counter type="LINE" missed="2" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="equalsVarOne" desc="(Ljava/lang/String;)Ljava/lang/Boolean;" line="16"><counter type="INSTRUCTION" missed="3" covered="7"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="2"/><counter type="COMPLEXITY" missed="1" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="equalsVarTwo" desc="(Ljava/lang/String;)Z" line="26"><counter type="INSTRUCTION" missed="0" covered="8"/><counter type="BRANCH" missed="0" covered="2"/><counter type="LINE" missed="0" covered="3"/><counter type="COMPLEXITY" missed="0" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><method name="timesIntOne" desc="(Ljava/lang/Integer;)Ljava/lang/Integer;" line="36"><counter type="INSTRUCTION" missed="8" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="whileLoop" desc="(Ljava/lang/Integer;)Z" line="41"><counter type="INSTRUCTION" missed="0" covered="24"/><counter type="BRANCH" missed="0" covered="4"/><counter type="LINE" missed="0" covered="6"/><counter type="COMPLEXITY" missed="0" covered="3"/><counter type="METHOD" missed="0" covered="1"/></method><method name="<clinit>" desc="()V" line="10"><counter type="INSTRUCTION" missed="0" covered="5"/><counter type="LINE" missed="0" covered="2"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="18" covered="44"/><counter type="BRANCH" missed="1" covered="7"/><counter type="LINE" missed="4" covered="13"/><counter type="COMPLEXITY" missed="3" covered="7"/><counter type="METHOD" missed="2" covered="4"/><counter type="CLASS" missed="0" covered="1"/></class><sourcefile name="CoverageTest.java"><line nr="8" mi="2" ci="0" mb="0" cb="0"/><line nr="10" mi="0" ci="2" mb="0" cb="0"/><line nr="11" mi="0" ci="3" mb="0" cb="0"/><line nr="12" mi="5" ci="0" mb="0" cb="0"/><line nr="16" mi="0" ci="4" mb="1" cb="1"/><line nr="17" mi="0" ci="3" mb="0" cb="0"/><line nr="20" mi="3" ci="0" mb="0" cb="0"/><line nr="26" mi="0" ci="4" mb="0" cb="2"/><line nr="27" mi="0" ci="2" mb="0" cb="0"/><line nr="30" mi="0" ci="2" mb="0" cb="0"/><line nr="36" mi="8" ci="0" mb="0" cb="0"/><line nr="41" mi="0" ci="3" mb="0" cb="0"/><line nr="42" mi="0" ci="5" mb="0" cb="2"/><line nr="43" mi="0" ci="7" mb="0" cb="0"/><line nr="45" mi="0" ci="5" mb="0" cb="2"/><line nr="46" mi="0" ci="2" mb="0" cb="0"/><line nr="49" mi="0" ci="2" mb="0" cb="0"/><counter type="INSTRUCTION" missed="18" covered="44"/><counter type="BRANCH" missed="1" covered="7"/><counter type="LINE" missed="4" covered="13"/><counter type="COMPLEXITY" missed="3" covered="7"/><counter type="METHOD" missed="2" covered="4"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><counter type="INSTRUCTION" missed="18" covered="44"/><counter type="BRANCH" missed="1" covered="7"/><counter type="LINE" missed="4" covered="13"/><counter type="COMPLEXITY" missed="3" covered="7"/><counter type="METHOD" missed="2" covered="4"/><counter type="CLASS" missed="0" covered="1"/></package><counter type="INSTRUCTION" missed="18" covered="44"/><counter type="BRANCH" missed="1" covered="7"/><counter type="LINE" missed="4" covered="13"/><counter type="COMPLEXITY" missed="3" covered="7"/><counter type="METHOD" missed="2" covered="4"/><counter type="CLASS" missed="0" covered="1"/></report> diff --git a/Tests/JacocoCoverage/DartConfiguration.tcl.in b/Tests/JacocoCoverage/DartConfiguration.tcl.in new file mode 100644 index 0000000..cc10e9c --- /dev/null +++ b/Tests/JacocoCoverage/DartConfiguration.tcl.in @@ -0,0 +1,8 @@ +# This file is configured by CMake automatically as DartConfiguration.tcl +# If you choose not to use CMake, this file may be hand configured, by +# filling in the required variables. + + +# Configuration directories and files +SourceDirectory: ${CMake_BINARY_DIR}/Testing/JacocoCoverage +BuildDirectory: ${CMake_BINARY_DIR}/Testing/JacocoCoverage diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index c933798..03a3b49 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -8,10 +8,6 @@ include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(short SIZEOF_SHORT) -include (CheckFunctionExists) -CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF) -CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA) - configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in ${LoadCommand_BINARY_DIR}/LoadedCommand.h) diff --git a/Tests/LoadCommand/LoadedCommand.cxx.in b/Tests/LoadCommand/LoadedCommand.cxx.in index c58bcf1..72ec014 100644 --- a/Tests/LoadCommand/LoadedCommand.cxx.in +++ b/Tests/LoadCommand/LoadedCommand.cxx.in @@ -9,15 +9,6 @@ int testSizeOf(int s1, int s2) int main () { int ret = 0; -#ifdef HAVE_VSBLABLA - printf("Should not be able to find vsblabla\n"); - ret = 1; -#endif - -#if !defined( HAVE_PRINTF ) - printf("Should be able to find printf\n"); - ret= 1; -#endif #if !defined( ADDED_DEFINITION ) printf("Should have ADDED_DEFINITION defined\n"); diff --git a/Tests/LoadCommand/LoadedCommand.h.in b/Tests/LoadCommand/LoadedCommand.h.in index 7516a66..733c414 100644 --- a/Tests/LoadCommand/LoadedCommand.h.in +++ b/Tests/LoadCommand/LoadedCommand.h.in @@ -1,7 +1,3 @@ /* Check for size of types */ #cmakedefine SIZEOF_CHAR ${SIZEOF_CHAR} #cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT} - -/* Check for functions */ -#cmakedefine HAVE_PRINTF -#cmakedefine HAVE_VSBLABLA diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt index a75ad5a..6affd34 100644 --- a/Tests/LoadCommandOneConfig/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeLists.txt @@ -8,10 +8,6 @@ include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(short SIZEOF_SHORT) -include (CheckFunctionExists) -CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF) -CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA) - include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) CHECK_INCLUDE_FILE("sys/prctl.h" HAVE_SYS_PRCTL_H) diff --git a/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in b/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in index c58bcf1..72ec014 100644 --- a/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in +++ b/Tests/LoadCommandOneConfig/LoadedCommand.cxx.in @@ -9,15 +9,6 @@ int testSizeOf(int s1, int s2) int main () { int ret = 0; -#ifdef HAVE_VSBLABLA - printf("Should not be able to find vsblabla\n"); - ret = 1; -#endif - -#if !defined( HAVE_PRINTF ) - printf("Should be able to find printf\n"); - ret= 1; -#endif #if !defined( ADDED_DEFINITION ) printf("Should have ADDED_DEFINITION defined\n"); diff --git a/Tests/LoadCommandOneConfig/LoadedCommand.h.in b/Tests/LoadCommandOneConfig/LoadedCommand.h.in index 7a0a15d..d748d06 100644 --- a/Tests/LoadCommandOneConfig/LoadedCommand.h.in +++ b/Tests/LoadCommandOneConfig/LoadedCommand.h.in @@ -2,10 +2,6 @@ #cmakedefine SIZEOF_CHAR ${SIZEOF_CHAR} #cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT} -/* Check for functions */ -#cmakedefine HAVE_PRINTF -#cmakedefine HAVE_VSBLABLA - /* Check for headers */ #cmakedefine HAVE_SYS_PRCTL_H diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt index 5c7b921..3e9ab8a 100644 --- a/Tests/MacRuntimePath/CMakeLists.txt +++ b/Tests/MacRuntimePath/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8) project(MacRuntimePath) -if(NOT DEFINED CMAKE_TEST_MAKEPROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") - set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}") +if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") endif() # Wipe out the install tree to make sure the exporter works. @@ -39,6 +39,7 @@ add_custom_command( --build-project MacRuntimePath_A --build-target install --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake VERBATIM @@ -60,6 +61,7 @@ add_custom_command( --build-noclean --build-project MacRuntimePath_B --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake VERBATIM diff --git a/Tests/MacRuntimePath/InitialCache.cmake.in b/Tests/MacRuntimePath/InitialCache.cmake.in index 3dc9041..a9f6a3c 100644 --- a/Tests/MacRuntimePath/InitialCache.cmake.in +++ b/Tests/MacRuntimePath/InitialCache.cmake.in @@ -1,4 +1,4 @@ -set(CMAKE_MAKE_PROGRAM "@CMAKE_TEST_MAKEPROGRAM@" CACHE FILEPATH "Make Program") +set(CMAKE_MAKE_PROGRAM "@CMake_TEST_NESTED_MAKE_PROGRAM@" CACHE FILEPATH "Make Program") set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt index 02bb31f..6c6dfb6 100644 --- a/Tests/MacroTest/CMakeLists.txt +++ b/Tests/MacroTest/CMakeLists.txt @@ -36,7 +36,7 @@ macro(strange_macro m) endmacro() STRANGE_MACRO(var) set(second_var "second_var") -if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +if("x${var}" STREQUAL "xstrange_macro" AND "x${second_var}" STREQUAL "xsecond_var") PASS("Case Test" "(${var} ${second_var})") else() FAILED("Case test" "(${var} ${second_var})") diff --git a/Tests/Module/ExternalData/CMakeLists.txt b/Tests/Module/ExternalData/CMakeLists.txt index 5a6f3d5..ebca48e 100644 --- a/Tests/Module/ExternalData/CMakeLists.txt +++ b/Tests/Module/ExternalData/CMakeLists.txt @@ -23,6 +23,8 @@ ExternalData_Add_Test(Data1 COMMAND ${CMAKE_COMMAND} -D Data=DATA{Data.dat} ${Data1CheckSpaces} + -D DataMissing=DATA{DataMissing.dat} + -D DataMissingWithAssociated=DATA{DataMissing.dat,Data.dat} -D SeriesA=DATA{SeriesA.dat,:} -D SeriesB=DATA{SeriesB.dat,:} -D SeriesC=DATA{SeriesC.dat,:} diff --git a/Tests/Module/ExternalData/Data1Check.cmake b/Tests/Module/ExternalData/Data1Check.cmake index 5770245..485b5c6 100644 --- a/Tests/Module/ExternalData/Data1Check.cmake +++ b/Tests/Module/ExternalData/Data1Check.cmake @@ -8,6 +8,28 @@ if(DEFINED DataSpace) message(SEND_ERROR "Input file:\n ${DataSpace}\ndoes not have expected content, but [[${lines}]]") endif() endif() +if(DataMissing) + if(EXISTS "${DataMissing}") + message(SEND_ERROR + "Input file:\n" + " ${DataMissing}\n" + "exists but should not." + ) + endif() +else() + message(SEND_ERROR "DataMissing is not set!") +endif() +if(DataMissingWithAssociated) + if(EXISTS "${DataMissingWithAssociated}") + message(SEND_ERROR + "Input file:\n" + " ${DataMissingWithAssociated}\n" + "exists but should not." + ) + endif() +else() + message(SEND_ERROR "DataMissingWithAssociated is not set!") +endif() set(SeriesAn1 "1\\.dat") set(SeriesBn1 "_1\\.dat") set(SeriesCn1 "\\.1\\.dat") diff --git a/Tests/Module/FindDependency/CMakeLists.txt b/Tests/Module/FindDependency/CMakeLists.txt new file mode 100644 index 0000000..dcb998a --- /dev/null +++ b/Tests/Module/FindDependency/CMakeLists.txt @@ -0,0 +1,11 @@ + +cmake_minimum_required(VERSION 3.0) +project(FindDependency) + +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/packages") + +find_package(Pack1 REQUIRED) +find_package(Pack4 4.3 EXACT REQUIRED) + +add_executable(FindDependency main.cpp) +target_link_libraries(FindDependency Pack1::Lib Pack4::Lib) diff --git a/Tests/Module/FindDependency/main.cpp b/Tests/Module/FindDependency/main.cpp new file mode 100644 index 0000000..50c5958 --- /dev/null +++ b/Tests/Module/FindDependency/main.cpp @@ -0,0 +1,29 @@ + +#ifndef HAVE_PACK1 +#error Expected HAVE_PACK1 +#endif + +#ifndef HAVE_PACK2 +#error Expected HAVE_PACK2 +#endif + +#ifndef HAVE_PACK3 +#error Expected HAVE_PACK3 +#endif + +#ifndef HAVE_PACK4 +#error Expected HAVE_PACK4 +#endif + +#ifndef HAVE_PACK5 +#error Expected HAVE_PACK5 +#endif + +#ifndef HAVE_PACK6 +#error Expected HAVE_PACK6 +#endif + +int main(int argc, char** argv) +{ + return 0; +} diff --git a/Tests/Module/FindDependency/packages/Pack1/Pack1Config.cmake b/Tests/Module/FindDependency/packages/Pack1/Pack1Config.cmake new file mode 100644 index 0000000..ff533c2 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack1/Pack1Config.cmake @@ -0,0 +1,9 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack2 2.3) +find_dependency(Pack3) + +add_library(Pack1::Lib INTERFACE IMPORTED) +set_property(TARGET Pack1::Lib PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK1) +set_property(TARGET Pack1::Lib PROPERTY INTERFACE_LINK_LIBRARIES Pack2::Lib Pack3::Lib) diff --git a/Tests/Module/FindDependency/packages/Pack1/Pack1ConfigVersion.cmake b/Tests/Module/FindDependency/packages/Pack1/Pack1ConfigVersion.cmake new file mode 100644 index 0000000..dfb7b6c --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack1/Pack1ConfigVersion.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/Module/FindDependency/packages/Pack2/Pack2Config.cmake b/Tests/Module/FindDependency/packages/Pack2/Pack2Config.cmake new file mode 100644 index 0000000..672288e --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack2/Pack2Config.cmake @@ -0,0 +1,5 @@ + +set(PACK2_VAR ON) + +add_library(Pack2::Lib INTERFACE IMPORTED) +set_property(TARGET Pack2::Lib PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK2) diff --git a/Tests/Module/FindDependency/packages/Pack2/Pack2ConfigVersion.cmake b/Tests/Module/FindDependency/packages/Pack2/Pack2ConfigVersion.cmake new file mode 100644 index 0000000..42f58c0 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack2/Pack2ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "2.4") + +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/Module/FindDependency/packages/Pack3/Pack3Config.cmake b/Tests/Module/FindDependency/packages/Pack3/Pack3Config.cmake new file mode 100644 index 0000000..25c32f3 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack3/Pack3Config.cmake @@ -0,0 +1,5 @@ + +set(PACK3_VAR ON) + +add_library(Pack3::Lib INTERFACE IMPORTED) +set_property(TARGET Pack3::Lib PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK3) diff --git a/Tests/Module/FindDependency/packages/Pack3/Pack3ConfigVersion.cmake b/Tests/Module/FindDependency/packages/Pack3/Pack3ConfigVersion.cmake new file mode 100644 index 0000000..870f747 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack3/Pack3ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "1.4") + +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/Module/FindDependency/packages/Pack4/Pack4Config.cmake b/Tests/Module/FindDependency/packages/Pack4/Pack4Config.cmake new file mode 100644 index 0000000..62fddb1 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack4/Pack4Config.cmake @@ -0,0 +1,9 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack5 3.1) # Actual version is 3.3. EXACT not propagated. +find_dependency(Pack6 5.5 EXACT) + +add_library(Pack4::Lib INTERFACE IMPORTED) +set_property(TARGET Pack4::Lib PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK4) +set_property(TARGET Pack4::Lib PROPERTY INTERFACE_LINK_LIBRARIES Pack5::Lib Pack6::Lib) diff --git a/Tests/Module/FindDependency/packages/Pack4/Pack4ConfigVersion.cmake b/Tests/Module/FindDependency/packages/Pack4/Pack4ConfigVersion.cmake new file mode 100644 index 0000000..ae982b0 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack4/Pack4ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "4.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/Module/FindDependency/packages/Pack5/Pack5Config.cmake b/Tests/Module/FindDependency/packages/Pack5/Pack5Config.cmake new file mode 100644 index 0000000..1edda9a --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack5/Pack5Config.cmake @@ -0,0 +1,3 @@ + +add_library(Pack5::Lib INTERFACE IMPORTED) +set_property(TARGET Pack5::Lib PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK5) diff --git a/Tests/Module/FindDependency/packages/Pack5/Pack5ConfigVersion.cmake b/Tests/Module/FindDependency/packages/Pack5/Pack5ConfigVersion.cmake new file mode 100644 index 0000000..e944f96 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack5/Pack5ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "3.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/Module/FindDependency/packages/Pack6/Pack6Config.cmake b/Tests/Module/FindDependency/packages/Pack6/Pack6Config.cmake new file mode 100644 index 0000000..d6c85fb --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack6/Pack6Config.cmake @@ -0,0 +1,3 @@ + +add_library(Pack6::Lib INTERFACE IMPORTED) +set_property(TARGET Pack6::Lib PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK6) diff --git a/Tests/Module/FindDependency/packages/Pack6/Pack6ConfigVersion.cmake b/Tests/Module/FindDependency/packages/Pack6/Pack6ConfigVersion.cmake new file mode 100644 index 0000000..0dd00d2 --- /dev/null +++ b/Tests/Module/FindDependency/packages/Pack6/Pack6ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "5.5") + +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/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index bf867a9..b52c44d 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -57,6 +57,15 @@ endif() include(GenerateExportHeader) +set(CMAKE_CXX_STANDARD 98) + +# Those versions of the HP compiler that need a flag to get proper C++98 +# template support also need a flag to use the newer C++ library. +if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () + add_subdirectory(lib_shared_and_static) add_compiler_export_flags() diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt new file mode 100644 index 0000000..645cc65 --- /dev/null +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -0,0 +1,88 @@ +cmake_minimum_required(VERSION 3.0.0) +project(WriteCompilerDetectionHeader) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +include(WriteCompilerDetectionHeader) + +get_property(cxx_known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) +get_property(c_known_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h" + PREFIX TEST + COMPILERS GNU Clang + VERSION 3.1 + PROLOG "// something" + EPILOG "// more" + FEATURES + ${cxx_known_features} ${c_known_features} +) + +if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" + "int main(int,char**) { return 0; }\n" + ) + add_executable(WriteCompilerDetectionHeader "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp") + + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n" + file_include_works + ) + if (file_include_works) + message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.") + endif() + return() +endif() + +string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}") +string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}") +string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" COMPILER_VERSION_PATCH "${CMAKE_CXX_COMPILER_VERSION}") + +macro(set_defines target true_defs false_defs) + set(defines) + foreach(def ${true_defs}) + list(APPEND defines ${def}=1) + endforeach() + foreach(def ${false_defs}) + list(APPEND defines ${def}=0) + endforeach() + target_compile_definitions(${target} + PRIVATE + ${defines} + EXPECTED_COMPILER_VERSION_MAJOR=${COMPILER_VERSION_MAJOR} + EXPECTED_COMPILER_VERSION_MINOR=${COMPILER_VERSION_MINOR} + EXPECTED_COMPILER_VERSION_PATCH=${COMPILER_VERSION_PATCH} + ) +endmacro() + +if (CMAKE_CXX_COMPILER_ID STREQUAL GNU + OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) + # False for C++98 mode. + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + +add_executable(WriteCompilerDetectionHeader main.cpp) +set_property(TARGET WriteCompilerDetectionHeader PROPERTY CXX_STANDARD 98) +set_defines(WriteCompilerDetectionHeader "${true_defs}" "${false_defs}") + +if(MSVC) + return() # MSVC has only one mode. +endif() + +# Since GNU 4.7 +if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(REMOVE_ITEM false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) +endif() + +# Since GNU 4.4 +if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_variadic_templates;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + list(REMOVE_ITEM false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + +add_executable(WriteCompilerDetectionHeader_11 main.cpp) +set_property(TARGET WriteCompilerDetectionHeader_11 PROPERTY CXX_STANDARD 11) +set_defines(WriteCompilerDetectionHeader_11 "${true_defs}" "${false_defs}") diff --git a/Tests/Module/WriteCompilerDetectionHeader/main.cpp b/Tests/Module/WriteCompilerDetectionHeader/main.cpp new file mode 100644 index 0000000..b807ad5 --- /dev/null +++ b/Tests/Module/WriteCompilerDetectionHeader/main.cpp @@ -0,0 +1,31 @@ + +#include "test_compiler_detection.h" + +#define JOIN_IMPL(A, B) A ## B +#define JOIN(A, B) JOIN_IMPL(A, B) +#define CHECK(FEATURE) (JOIN(TEST_COMPILER_, FEATURE) == JOIN(EXPECTED_COMPILER_, FEATURE)) + +#if !CHECK(CXX_DELEGATING_CONSTRUCTORS) +#error cxx_delegating_constructors expected availability did not match. +#endif + +#if !CHECK(CXX_VARIADIC_TEMPLATES) +#error cxx_variadic_templates expected availability did not match. +#endif + +#if !CHECK(VERSION_MAJOR) +#error Compiler major version did not match. +#endif + +#if !CHECK(VERSION_MINOR) +#error Compiler minor version did not match. +#endif + +#if !CHECK(VERSION_PATCH) +#error Compiler patch version did not match. +#endif + +int main() +{ + return 0; +} diff --git a/Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov b/Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov deleted file mode 100644 index c3b3342..0000000 --- a/Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov +++ /dev/null @@ -1,304 +0,0 @@ -Routine,Line,RtnLine,Code
-DDIOL,1,0,"DDIOL ;SFISC/MKO-THE LOADER ;1:53 PM 12 Sep 1995"
-,2,0," ;;22.0;VA FileMan;;Mar 30, 1999"
-,3,0," ;Per VHA Directive 10-93-142, this routine should not be modified."
-,4,0," ;"
-,5,0,"EN(A,G,FMT) ;Write the text contained in local array A or global array G"
-,6,0," ;If one string passed, use format FMT"
-,7,0," N %,Y,DINAKED"
-,8,0," S DINAKED=$$LGR^%ZOSV"
-,9,0," ;"
-,10,0," S:'$D(A) A="""""
-,11,0," I $G(A)="""",$D(A)<9,$G(FMT)="""",$G(G)'?1""^""1A.7AN,$G(G)'?1""^""1A.7AN1""("".E1"")"" Q"
-,12,0," ;"
-,13,0," G:$D(DDS) SM"
-,14,0," G:$D(DIQUIET) LD"
-,15,0," ;"
-,16,0," N F,I,S"
-,17,0," I $D(A)=1,$G(G)="""" D"
-,18,0," . S F=$S($G(FMT)]"""":FMT,1:""!"")"
-,19,0," . W @F,A"
-,20,0," ;"
-,21,0," E I $D(A)>9 S I=0 F S I=$O(A(I)) Q:I'=+$P(I,""E"") D"
-,22,0," . S F=$G(A(I,""F""),""!"") S:F="""" F=""?0"""
-,23,0," . W @F,$G(A(I))"
-,24,0," ;"
-,25,0," E S I=0 F S I=$O(@G@(I)) Q:I'=+$P(I,""E"") D"
-,26,0," . S S=$G(@G@(I,0),$G(@G@(I)))"
-,27,0," . S F=$G(@G@(I,""F""),""!"") S:F="""" F=""?0"""
-,28,0," . W @F,S"
-,29,0," ;"
-,30,0," I DINAKED]"""" S DINAKED=$S(DINAKED["""""""""""":$O(@DINAKED),1:$D(@DINAKED))"
-,31,0," Q"
-,32,0," ;"
-,33,0,"LD ;Load text into ^TMP"
-,34,0," N I,N,T"
-,35,0," S T=$S($G(DDIOLFLG)[""H"":""DIHELP"",1:""DIMSG"")"
-,36,0," S N=$O(^TMP(T,$J,"" ""),-1)"
-,37,0," ;"
-,38,0," I $D(A)=1,$G(G)="""" D"
-,39,0," . D LD1(A,$S($G(FMT)]"""":FMT,1:""!""))"
-,40,0," ;"
-,41,0," E I $D(A)>9 S I=0 F S I=$O(A(I)) Q:I'=+$P(I,""E"") D"
-,42,0," . D LD1($G(A(I)),$G(A(I,""F""),""!""))"
-,43,0," ;"
-,44,0," E S I=0 F S I=$O(@G@(I)) Q:I'=+$P(I,""E"") D"
-,45,0," . D LD1($G(@G@(I),$G(@G@(I,0))),$G(@G@(I,""F""),""!""))"
-,46,0," ;"
-,47,0," K:'N @T S:N @T=N"
-,48,0," I DINAKED]"""" S DINAKED=$S(DINAKED["""""""""""":$O(@DINAKED),1:$D(@DINAKED))"
-,49,0," Q"
-,50,0," ;"
-,51,0,"LD1(S,F) ;Load string S, with format F"
-,52,0," ;In: N and T"
-,53,0," N C,J,L"
-,54,0," S:S[$C(7) S=$TR(S,$C(7),"""")"
-,55,0," F J=1:1:$L(F,""!"")-1 S N=N+1,^TMP(T,$J,N)="""""
-,56,0," S:'N N=1"
-,57,0," S:F[""?"" @(""C=""_$P(F,""?"",2))"
-,58,0," S L=$G(^TMP(T,$J,N))"
-,59,0," S ^TMP(T,$J,N)=L_$J("""",$G(C)-$L(L))_S"
-,60,0," Q"
-,61,0," ;"
-,62,0,"SM ;Print text in ScreenMan's Command Area"
-,63,0," I $D(DDSID),$D(DTOUT)!$D(DUOUT) G SMQ"
-,64,0," N DDIOL"
-,65,0," S DDIOL=1"
-,66,0," ;"
-,67,0," I $D(A)=1&($G(G)="""")!($D(A)>9) D"
-,68,0," . D MSG^DDSMSG(.A,"""",$G(FMT))"
-,69,0," E I $D(@G@(+$O(@G@(0)),0))#2 D"
-,70,0," . D WP^DDSMSG(G)"
-,71,0," E D HLP^DDSMSG(G)"
-,72,0," ;"
-,73,0,"SMQ I DINAKED]"""" S DINAKED=$S(DINAKED["""""""""""":$O(@DINAKED),1:$D(@DINAKED))"
-,74,0," Q"
-Totals for DDIOL,,0,
-XINDEX,1,0,"XINDEX ;ISC/REL,GFT,GRK,RWF - INDEX & CROSS-REFERENCE ;08/04/08 13:19"
-,2,1," ;;7.3;TOOLKIT;**20,27,48,61,66,68,110,121,128**;Apr 25, 1995;Build 1"
-,3,0," ; Per VHA Directive 2004-038, this routine should not be modified."
-,4,1," G ^XINDX6"
-,5,107216,"SEP F I=1:1 S CH=$E(LIN,I) D QUOTE:CH=Q Q:"" ""[CH"
-,6,107216," S ARG=$E(LIN,1,I-1) S:CH="" "" I=I+1 S LIN=$E(LIN,I,999) Q"
-,7,36371,"QUOTE F I=I+1:1 S CH=$E(LIN,I) Q:CH=""""!(CH=Q)"
-,8,36371," Q:CH]"""" S ERR=6 G ^XINDX1"
-,9,0,"ALIVE ;enter here from taskman"
-,10,1," D SETUP^XINDX7 ;Get ready to process"
-,11,468,"A2 S RTN=$O(^UTILITY($J,RTN)) G ^XINDX5:RTN="""""
-,12,467," S INDLC=(RTN?1""|""1.4L.NP) D LOAD:'INDLC"
-,13,467," I $D(ZTQUEUED),$$S^%ZTLOAD S RTN=""~"",IND(""QUIT"")=1,ZTSTOP=1 G A2"
-,14,467," I 'INDDS,INDLC W !!?10,""Data Dictionaries"",! S INDDS=1"
-,15,467," D BEG"
-,16,467," G A2"
-,17,0," ;"
-,18,467,"LOAD S X=RTN,XCNP=0,DIF=""^UTILITY(""_$J_"",1,RTN,0,"" X ^%ZOSF(""TEST"") Q:'$T X ^%ZOSF(""LOAD"") S ^UTILITY($J,1,RTN,0,0)=XCNP-1"
-,19,467," I $D(^UTILITY($J,1,RTN,0,0)) S ^UTILITY($J,1,RTN,""RSUM"")=""B""_$$SUMB^XPDRSUM($NA(^UTILITY($J,1,RTN,0)))"
-,20,467," Q"
-,21,0,"BEG ;"
-,22,467," S %=INDLC*5 W:$X+10+%>IOM ! W RTN,$J("""",10+%-$L(RTN))"
-,23,467," S (IND(""DO""),IND(""SZT""),IND(""SZC""),LABO)=0,LC=$G(^UTILITY($J,1,RTN,0,0))"
-,24,467," I LC="""" W !,"">>>Routine '"",RTN,""' not found <<<"",! Q"
-,25,467," S TXT="""",LAB=$P(^UTILITY($J,1,RTN,0,1,0),"" "") I RTN'=$P(LAB,""("") D E^XINDX1(17)"
-,26,467," I 'INDLC,LAB[""("" D E^XINDX1(55) S LAB=$P(LAB,""("")"
-,27,0," ;if M routine(not compiled template or DD) and has more than 2 lines, check lines 1 & 2"
-,28,467," I 'INDLC,LC>2 D"
-,29,467," . N LABO S LABO=1"
-,30,467," . S LIN=$G(^UTILITY($J,1,RTN,0,1,0)),TXT=1"
-,31,0," . ;check 1st line (site/dev - ) patch 128"
-,32,467," . I $P(LIN,"";"",2,4)'?.E1""/"".E.1""-"".E D E^XINDX1(62)"
-,33,467," . S LIN=$G(^UTILITY($J,1,RTN,0,2,0)),TXT=2"
-,34,0," . ;check 2nd line (;;nn.nn[TV]nn;package;.anything)"
-,35,467," . I $P(LIN,"";"",3,99)'?1.2N1"".""1.2N.1(1""T"",1""V"").2N1"";""1A.AP1"";"".E D E^XINDX1(44) ;patch 121"
-,36,467," . I $L(INP(11)) X INP(11) ;Version number check"
-,37,467," . I $L(INP(12)) X INP(12) ;Patch number check"
-,38,467,"B5 F TXT=1:1:LC S LIN=^UTILITY($J,1,RTN,0,TXT,0),LN=$L(LIN),IND(""SZT"")=IND(""SZT"")+LN+2 D LN,ST ;Process Line"
-,39,467," S LAB="""",LABO=0,TXT=0,^UTILITY($J,1,RTN,0)=IND(""SZT"")_""^""_LC_""^""_IND(""SZC"")"
-,40,467," I IND(""SZT"")>INP(""MAX""),'INDLC S ERR=35,ERR(1)=IND(""SZT"") D ^XINDX1"
-,41,467," I IND(""SZT"")-IND(""SZC"")>INP(""CMAX""),'INDLC S ERR=58,ERR(1)=IND(""SZT"")-IND(""SZC"") D ^XINDX1"
-,42,467," D POSTRTN"
-,43,467," Q"
-,44,0," ;Proccess one line, LN = Length, LIN = Line."
-,45,44620,"LN K V S (ARG,GRB,IND(""COM""),IND(""DOL""),IND(""F""))="""",X=$P(LIN,"" "")"
-,46,44620," I '$L(X) S LABO=LABO+1 G CD"
-,47,5073," S (IND(""COM""),LAB)=$P(X,""(""),ARG=$P($P(X,""("",2),"")""),LABO=0,IND(""PP"")=X?1.8E1""("".E1"")"""
-,48,5073," D:$L(ARG) NE^XINDX3 ;Process formal parameters as New list."
-,49,5073," I 'INDLC,'$$VT^XINDX2(LAB) D E^XINDX1($S(LAB=$$CASE^XINDX52(LAB):37,1:55)) ;Check for bad labels"
-,50,5073," I $D(^UTILITY($J,1,RTN,""T"",LAB)) D E^XINDX1(15) G CD ;DUP label"
-,51,5073," S ^UTILITY($J,1,RTN,""T"",LAB)="""""
-,52,44620,"CD I LN>245 D:'(LN=246&($E(RTN,1,3)=""|dd"")) E^XINDX1(19) ;patch 119"
-,53,44620," D:LIN'?1.ANP E^XINDX1(18)"
-,54,44620," S LIN=$P(LIN,"" "",2,999),IND(""LCC"")=1"
-,55,44620," I LIN="""" D E^XINDX1(42) Q ;Blank line ;p110"
-,56,44620," S I=0 ;Watch the scope of I, counts dots"
-,57,44620," I "" .""[$E(LIN) D S X=$L($E(LIN,1,I),""."")-1,LIN=$E(LIN,I,999)"
-,58,10770," . F I=1:1:245 Q:"". ""'[$E(LIN,I)"
-,59,10770," . Q"
-,60,0," ;check dots against Do level IND(""DO""), IND(""DOL"")=dot level"
-,61,44620," D:'I&$G(IND(""DO1"")) E^XINDX1(51) S IND(""DO1"")=0 S:'I IND(""DO"")=0"
-,62,44620," I I D:X>IND(""DO"") E^XINDX1(51) S (IND(""DO""),IND(""DOL""))=X"
-,63,0," ;Count Comment lines, skip ;; lines"
-,64,44620," I $E(LIN)="";"",$E(LIN,2)'="";"" S IND(""SZC"")=IND(""SZC"")+$L(LIN) ;p110"
-,65,0," ;Process commands on line."
-,66,116081,"EE I LIN="""" D ^XINDX2 Q"
-,67,71461," S COM=$E(LIN),GK="""",ARG="""""
-,68,71461," I COM="";"" S LIN="""" G EE ;p110"
-,69,54870," I COM="" "" S ERR=$S(LIN?1."" "":13,1:0),LIN=$S(ERR:"""",1:$E(LIN,2,999)) D:ERR ^XINDX1 G EE"
-,70,53608," D SEP"
-,71,53608," S CM=$P(ARG,"":"",1),POST=$P(ARG,"":"",2,999),IND(""COM"")=IND(""COM"")_$C(9)_COM,ERR=48"
-,72,53608," D:ARG["":""&(POST']"""") ^XINDX1 S:POST]"""" GRB=GRB_$C(9)_POST,IND(""COM"")=IND(""COM"")_"":"""
-,73,0," ;SAC now allows lowercase commands"
-,74,53608," I CM?.E1L.E S CM=$$CASE^XINDX52(CM),COM=$E(CM) ;I IND(""LCC"") S IND(""LCC"")=0 D E^XINDX1(47)"
-,75,53608," I CM="""" D E^XINDX1(21) G EE ;Missing command"
-,76,53608," S CX=$G(IND(""CMD"",CM)) I CX="""" D G:CX="""" EE"
-,77,0," . I $E(CM)=""Z"" S CX=""^Z"" Q ;Proccess Z commands"
-,78,0," . D E^XINDX1(1) S LIN="""" Q"
-,79,53608," S CX=$P(CX,""^"",2,9)"
-,80,53608," D SEP I '$L(LIN),CH="" "" D E^XINDX1(13) ;trailing space"
-,81,53608," I ARG="""",""CGJMORSUWX""[COM S ERR=49 G ^XINDX1"
-,82,53608," I CX>0 D E^XINDX1(CX) S CX="""""
-,83,53608," D:$L(CX) @CX S:ARG'="""" GRB=GRB_$C(9)_ARG G EE"
-,84,0,"B S ERR=25 G ^XINDX1"
-,85,0,"C S ERR=29 G ^XINDX1"
-,86,0,"D G DG1^XINDX4"
-,87,0,"E Q:ARG="""" S ERR=7 G ^XINDX1"
-,88,1559,"F G:ARG]"""" FR^XINDX4 S IND(""F"")=1 Q"
-,89,1932,"G G DG^XINDX4"
-,90,11,"H Q:ARG'="""" S ERR=32 G ^XINDX1"
-,91,0,"J S ERR=36,ARG="""" G ^XINDX1"
-,92,2218,"K S ERR=$S(ARG?1""("".E:22,ARG?."" "":23,1:0) D:ERR ^XINDX1"
-,93,2218," G KL^XINDX3"
-,94,259,"L G LO^XINDX4"
-,95,30,"M G S^XINDX3"
-,96,1721,"N G NE^XINDX3"
-,97,0,"O S ERR=34 D ^XINDX1,O^XINDX3 Q"
-,98,7762,"Q Q:ARG="""" G Q^XINDX4"
-,99,85,"R S RDTIME=0 G RD^XINDX3"
-,100,17549,"S G S^XINDX3"
-,101,0,"TR Q ;What to process. p110"
-,102,72,"U S ARG=$P(ARG,"":"") Q"
-,103,0,"V S ARG="""",ERR=20 G ^XINDX1"
-,104,4584,"W G WR^XINDX4"
-,105,220,"X G XE^XINDX4"
-,106,0,"Z S ERR=2 D ^XINDX1 G ZC^XINDX4"
-,107,0," ;"
-,108,0," ;Save off items from line."
-,109,44620,"ST S R=LAB_$S(LABO:""+""_LABO,1:"""")"
-,110,0," ;Local variable, Global, Marked Items, Naked global, Internal ref, eXternal ref., Tag ref."
-,111,44620," S LOC="""" F S LOC=$O(V(LOC)),S="""" Q:LOC="""" F S S=$O(V(LOC,S)) Q:S="""" D SET"
-,112,44620," S ^UTILITY($J,1,RTN,""COM"",TXT)=IND(""COM"")"
-,113,44620," Q"
-,114,0," ;"
-,115,85079,"SET I V(LOC,S)]"""" F %=""!"",""~"" I V(LOC,S)[%,$G(^UTILITY($J,1,RTN,LOC,S))'[% S ^(S)=$G(^(S))_%"
-,116,85079," S %=0"
-,117,86891,"SE2 S ARG=$G(^UTILITY($J,1,RTN,LOC,S,%)) I $L(ARG)>230 S %=%+1 G SE2"
-,118,85079," S ^UTILITY($J,1,RTN,LOC,S,%)=ARG_R_V(LOC,S)_"","""
-,119,85079," Q"
-,120,0," ;"
-,121,0,"POSTRTN ;Do more overall checking"
-,122,467," N V,E,T,T1,T2"
-,123,467," S T="""" ;Check for missing Labels"
-,124,467," F S T=$O(^UTILITY($J,1,RTN,""I"",T)),T2=T Q:T="""" S T1=$G(^(T,0)) D"
-,125,2091," . Q:$E(T2,1,2)=""@("""
-,126,2044," . S:$E(T2,1,2)=""$$"" T2=$E(T2,3,99)"
-,127,2044," . I T2]"""",'$D(^UTILITY($J,1,RTN,""T"",$P(T2,""+"",1))) D"
-,128,0," . . F I=1:1:$L(T1,"","")-1 S LAB=$P(T1,"","",I),LABO=+$P(LAB,""+"",2),LAB=$P(LAB,""+""),E=14,E(1)=T D E^XINDX1(.E)"
-,129,0," . . Q"
-,130,2044," . Q"
-,131,467," S LAB="""",LABO=0 ;Check for valid label names"
-,132,467," I 'INDLC F S LAB=$O(^UTILITY($J,1,RTN,""T"",LAB)) Q:LAB="""" D"
-,133,5073," . I '$$VA^XINDX2(LAB) D E^XINDX1(55) Q"
-,134,5073," . D:'$$VT^XINDX2(LAB) E^XINDX1(37)"
-,135,5073," . Q"
-,136,467," S LAB="""",LABO=0 ;Check for valid variable names."
-,137,467," F S LAB=$O(^UTILITY($J,1,RTN,""L"",LAB)) Q:LAB="""" D"
-,138,15909," . D VLNF^XINDX3($P(LAB,""(""))"
-,139,15909," . Q"
-,140,467," Q"
-,141,0," ;"
-,142,0,"QUICK ;Quick, Just get a routine an print the results"
-,143,0," D QUICK^XINDX6()"
-,144,0," Q"
-Totals for XINDEX,,2446443,
-XINDX1,1,0,"XINDX1 ;ISC/REL,GRK,RWF - ERROR ROUTINE ;08/05/08 13:59"
-,2,2," ;;7.3;TOOLKIT;**20,61,66,68,110,121,128**;Apr 25, 1995;Build 1"
-,3,0," ; Per VHA Directive 2004-038, this routine should not be modified."
-,4,2," G A"
-,5,0,"E(ERR) ;"
-,6,75,"A N %,%1 ;TXT is the line of the error."
-,7,75," S ERTX=LAB_$S(LABO:""+""_LABO,1:"""")_$C(9),%1=$T(ERROR+ERR),ERTX=ERTX_$S(ERR:$P(%1,"";"",4,9),1:ERR) ;p110"
-,8,75," I ERTX[""|"" F %=1:1 S ERTX=$P(ERTX,""|"")_$S($D(ERR(%)):ERR(%),1:""??"")_$P(ERTX,""|"",%+1,99) Q:ERTX'[""|"""
-,9,75,"B I $P(%1,"";"",3)]"""" D Q:%1]"""" ;Don't flag kernel doing kernel."
-,10,0," . S %1=$P(%1,"";"",3)"
-,11,0," . F Q:RTN[$P(%1,"","") S %1=$P(%1,"","",2,99) ;quit if RTN[%1 or null."
-,12,0," . Q"
-,13,75," I ERR=17,$E(RTN)'=""%"",$E(LAB)=""%"" Q ;Don't flag %RTN w/o %."
-,14,0," ;Global is Error Line,tab,error tag,tab,error text"
-,15,75," S %=$G(^UTILITY($J,1,RTN,""E"",0))+1,^(0)=%,^(%)=TXT_$C(9)_ERTX"
-,16,75," Q"
-,17,0," ;"
-,18,0," ;F = Fatal, S = Standard, W = Warning, I = Info"
-,19,0,"ERROR ;"
-,20,0,"1 ;;;F - UNDEFINED COMMAND (rest of line not checked)."
-,21,0,"2 ;;;F - Non-standard (Undefined) 'Z' command."
-,22,0,"3 ;;XTRMON;F - Undefined Function."
-,23,0,"4 ;;;F - Undefined Special Variable."
-,24,0,"5 ;;;F - Unmatched Parenthesis."
-,25,0,"6 ;;;F - Unmatched Quotation Marks."
-,26,0,"7 ;;;F - ELSE Command followed by only one space."
-,27,0,"8 ;;;F - FOR Command did not contain '='."
-,28,0,"9 ;;;I - QUIT Command followed by only one space."
-,29,0,"10 ;;;F - Unrecognized argument in SET command."
-,30,0,"11 ;;;W - Invalid local variable name."
-,31,0,"12 ;;;W - Invalid global variable name."
-,32,0,"13 ;;;W - Blank(s) at end of line."
-,33,0,"14 ;;;F - Call to missing label '|' in this routine."
-,34,0,"15 ;;;W - Duplicate label. (M57)"
-,35,0,"16 ;;;F - Error in pattern code."
-,36,0,"17 ;;;W - First line label NOT routine name."
-,37,0,"18 ;;;W - Line contains a CONTROL (non-graphic) character."
-,38,0,"19 ;;;S - Line is longer than 245 bytes."
-,39,0,"20 ;;;S - View command used."
-,40,0,"21 ;;;F - General Syntax Error."
-,41,0,"22 ;;;S - Exclusive Kill."
-,42,0,"23 ;;;S - Unargumented Kill."
-,43,0,"24 ;;;S - Kill of an unsubscripted global."
-,44,0,"25 ;;;S - Break command used."
-,45,0,"26 ;;;S - Exclusive or Unargumented NEW command."
-,46,0,"27 ;;;S - $View function used."
-,47,0,"28 ;;ZOSV,ZIS,ZT;S - Non-standard $Z special variable used."
-,48,0,"29 ;;ZIS,ZTM;S - 'Close' command should be invoked through 'D ^%ZISC'."
-,49,0,"30 ;;;S - LABEL+OFFSET syntax."
-,50,0,"31 ;;ZOSV,ZIS,ZT;S - Non-standard $Z function used."
-,51,0,"32 ;;;S - 'HALT' command should be invoked through 'G ^XUSCLEAN'."
-,52,0,"33 ;;;S - Read command doesn't have a timeout."
-,53,0,"34 ;;ZIS;S - 'OPEN' command should be invoked through ^%ZIS."
-,54,0,"35 ;;;S - Routine exceeds SACC maximum size of 20000 (|)."
-,55,0,"36 ;;ZTM;S - Should use 'TASKMAN' instead of 'JOB' command."
-,56,0,"37 ;;;F - Label is not valid."
-,57,0,"38 ;;;F - Call to this |"
-,58,0,"39 ;;ZIS,XUS,XUP;S - Kill of a protected variable (|)."
-,59,0,"40 ;;;S - Space where a command should be."
-,60,0,"41 ;;;I - Star or pound READ used."
-,61,0,"42 ;;;W - Null line (no commands or comment)."
-,62,0,"43 ;;;F - Invalid or wrong number of arguments to a function."
-,63,0,"44 ;;;S - 2nd line of routine violates the SAC."
-,64,0,"45 ;;ZT,ZIS,XUTM,XTER;S - Set to a '%' global."
-,65,0,"46 ;;;F - Quoted string not followed by a separator."
-,66,0,"47 ;;;S - Lowercase command(s) used in line."
-,67,0,"48 ;;;F - Missing argument to a command post-conditional."
-,68,0,"49 ;;;F - Command missing an argument."
-,69,0,"50 ;;ZTM;S - Extended reference."
-,70,0,"51 ;;;F - Block structure mismatch."
-,71,0,"52 ;;;F - Reference to routine '^|'. That isn't in this UCI."
-,72,0,"53 ;;;F - Bad Number."
-,73,0,"54 ;;XG;S - Access to SSVN's restricted to Kernel."
-,74,0,"55 ;;;S - Violates VA programming standards."
-,75,0,"56 ;;;S - Patch number '|' missing from second line."
-,76,0,"57 ;;;S - Lower/Mixed case Variable name used."
-,77,0,"58 ;;;S - Routine code exceeds SACC maximum size of 15000 (|)."
-,78,0,"59 ;;;F - Bad WRITE syntax."
-,79,0,"60 ;;;S - Lock missing Timeout."
-,80,0,"61 ;;;S - Non-Incremental Lock."
-,81,0,"62 ;;;S - First line of routine violates the SAC."
-,82,0,"63 ;;;F - GO or DO mismatch from block structure (M45)."
-Totals for XINDX1,,529,
diff --git a/Tests/MumpsCoverage/Accounts_ReceivableTest.mcov b/Tests/MumpsCoverage/Accounts_ReceivableTest.mcov deleted file mode 100644 index 3c585f5..0000000 --- a/Tests/MumpsCoverage/Accounts_ReceivableTest.mcov +++ /dev/null @@ -1,1445 +0,0 @@ -%GO Global Output Utility -GT.M 17-APR-2012 17:18:27 ZWR -^ZZCOVERAGE("%RSEL","SRC")="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",1)="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",2)="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",3)="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",4)="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",5)="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",6)="1:0:0:0" -^ZZCOVERAGE("%RSEL","SRC",7)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init")="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",1)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",3)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",4)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",5)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",6)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",7)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",8)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1 -^ZZCOVERAGE("%RSEL","init",9)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",10)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",11)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",12)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",13)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",14)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",15)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",16)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",17)="1:0:0:0" -^ZZCOVERAGE("%RSEL","init",17,"FOR_LOOP",1)=2 -^ZZCOVERAGE("%RSEL","init",18)="2:0:0:0" -^ZZCOVERAGE("%RSEL","init",19)="2:0:0:0" -^ZZCOVERAGE("%RSEL","init",20)="2:0:0:0" -^ZZCOVERAGE("%RSEL","init",40)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main")="1:32001:84004:116005" -^ZZCOVERAGE("%RSEL","main",1)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main",2)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main",3)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main",3,"FOR_LOOP",1)=468 -^ZZCOVERAGE("%RSEL","main",4)="468:0:24003:24003" -^ZZCOVERAGE("%RSEL","main",5)="468:0:0:0" -^ZZCOVERAGE("%RSEL","main",6)="468:32001:48001:80002" -^ZZCOVERAGE("%RSEL","main",7)="467:0:12000:12000" -^ZZCOVERAGE("%RSEL","main",8)="467:0:0:0" -^ZZCOVERAGE("%RSEL","main",9)="467:0:0:0" -^ZZCOVERAGE("%RSEL","main",10)="467:0:0:0" -^ZZCOVERAGE("%RSEL","main",11)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main",12)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main",13)="1:0:0:0" -^ZZCOVERAGE("%RSEL","main",14)="1:0:0:0" -^ZZCOVERAGE("%RSEL","next")="1403:12001:20002:32003" -^ZZCOVERAGE("%RSEL","next",0)="1403:0:0:0" -^ZZCOVERAGE("%RSEL","next",1)="1403:12001:20002:32003" -^ZZCOVERAGE("%RSEL","next",1,"FOR_LOOP",1)=1403 -^ZZCOVERAGE("%RSEL","next",2)="1403:0:0:0" -^ZZCOVERAGE("%RSEL","save")="467:0:4001:4001" -^ZZCOVERAGE("%RSEL","save",1)="467:0:0:0" -^ZZCOVERAGE("%RSEL","save",5)="467:0:0:0" -^ZZCOVERAGE("%RSEL","save",6)="467:0:0:0" -^ZZCOVERAGE("%RSEL","save",7)="467:0:0:0" -^ZZCOVERAGE("%RSEL","save",8)="467:0:4001:4001" -^ZZCOVERAGE("%RSEL","save",9)="467:0:0:0" -^ZZCOVERAGE("%RSEL","search")="934:0:16001:16001" -^ZZCOVERAGE("%RSEL","search",0)="934:0:4000:4000" -^ZZCOVERAGE("%RSEL","search",1)="934:0:0:0" -^ZZCOVERAGE("%RSEL","search",2)="934:0:4001:4001" -^ZZCOVERAGE("%RSEL","search",2,"FOR_LOOP",1)=1868 -^ZZCOVERAGE("%RSEL","search",3)="934:0:8000:8000" -^ZZCOVERAGE("%RSEL","search",4)="934:0:0:0" -^ZZCOVERAGE("%RSEL","search",5)="934:0:0:0" -^ZZCOVERAGE("%RSEL","start")="468:0:4001:4001" -^ZZCOVERAGE("%RSEL","start",0)="468:0:0:0" -^ZZCOVERAGE("%RSEL","start",1)="468:0:0:0" -^ZZCOVERAGE("%RSEL","start",2)="468:0:0:0" -^ZZCOVERAGE("%RSEL","start",2,"FOR_LOOP",1)=936 -^ZZCOVERAGE("%RSEL","start",3)="468:0:0:0" -^ZZCOVERAGE("%RSEL","work")="467:20002:24001:44003" -^ZZCOVERAGE("%RSEL","work",1)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",2)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",3)="467:0:4000:4000" -^ZZCOVERAGE("%RSEL","work",4)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",6)="467:4000:12000:16000" -^ZZCOVERAGE("%RSEL","work",6,"FOR_LOOP",1)=3421 -^ZZCOVERAGE("%RSEL","work",7)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",8)="467:4001:0:4001" -^ZZCOVERAGE("%RSEL","work",9)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",10)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",11)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",12)="467:4000:0:4000" -^ZZCOVERAGE("%RSEL","work",13)="467:0:4000:4000" -^ZZCOVERAGE("%RSEL","work",14)="467:0:0:0" -^ZZCOVERAGE("%RSEL","work",15)="467:4001:4001:8002" -^ZZCOVERAGE("%RSEL","work",15,"FOR_LOOP",1)=934 -^ZZCOVERAGE("%RSEL","work",16)="467:0:0:0" -^ZZCOVERAGE("%ZIS","%ZIS")="2:0:0:0" -^ZZCOVERAGE("%ZIS","%ZIS",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS","%ZIS",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS","A",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS","A",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS","CLEAN")="3:0:0:0" -^ZZCOVERAGE("%ZIS","CLEAN",1)="3:0:0:0" -^ZZCOVERAGE("%ZIS","CLEAN",2)="3:0:0:0" -^ZZCOVERAGE("%ZIS","CLEAN",3)="3:0:0:0" -^ZZCOVERAGE("%ZIS","CLEAN",4)="3:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME")="2:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",1)="1:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",3)="1:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",4)="1:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",5)="1:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",6)="1:0:0:0" -^ZZCOVERAGE("%ZIS","GETHOME",7)="1:0:0:0" -^ZZCOVERAGE("%ZIS","HOME")="1:0:0:0" -^ZZCOVERAGE("%ZIS","HOME",1)="1:0:0:0" -^ZZCOVERAGE("%ZIS","HOME",2)="1:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",6)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",8)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",10)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",11)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",12)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",13)="2:0:0:0" -^ZZCOVERAGE("%ZIS","INIT",15)="2:0:0:0" -^ZZCOVERAGE("%ZIS","K2",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS","K2",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS","K2",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS","K2",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS","VIRTUAL")="2:0:0:0" -^ZZCOVERAGE("%ZIS","VIRTUAL",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS","VIRTUAL",4,"FOR_LOOP",1)=6 -^ZZCOVERAGE("%ZIS","VIRTUAL",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS","VIRTUAL",7)="2:0:0:0" -^ZZCOVERAGE("%ZIS","VTLKUP")="4:0:0:0" -^ZZCOVERAGE("%ZIS","VTLKUP",0)="4:0:0:0" -^ZZCOVERAGE("%ZIS","VTLKUP",0,"FOR_LOOP",1)=8 -^ZZCOVERAGE("%ZIS","VTLKUP",1)="4:0:0:0" -^ZZCOVERAGE("%ZIS1","EX2",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EX2",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",6)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",7)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",8)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","EXIT",9)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","G",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","IOP")="1:0:0:0" -^ZZCOVERAGE("%ZIS1","IOP",1)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","K2")="2:0:0:0" -^ZZCOVERAGE("%ZIS1","K2",1)="4:0:0:0" -^ZZCOVERAGE("%ZIS1","K2",2)="4:0:0:0" -^ZZCOVERAGE("%ZIS1","K2",3)="4:0:0:0" -^ZZCOVERAGE("%ZIS1","K2",4)="4:0:0:0" -^ZZCOVERAGE("%ZIS1","KIL",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","KIL",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","KIL",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",6)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",7)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",8)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",9)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",10)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",11)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","L1",12)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","LKUP")="2:0:0:0" -^ZZCOVERAGE("%ZIS1","LKUP",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","LKUP",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","LKUP",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","MAIN",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","R")="1:0:0:0" -^ZZCOVERAGE("%ZIS1","R",0)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","R",1)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","R",2)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","RD",0)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","RD",1)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","RD",2)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","RD",3)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","RD",4)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","RD",5)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","SBR")="1:0:0:0" -^ZZCOVERAGE("%ZIS1","SBR",1)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","SBR",2)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","SBR",3)="1:0:0:0" -^ZZCOVERAGE("%ZIS1","SETQ")="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETQ",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETQ",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETQ",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETQ",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETQ",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",7)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",8)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",9)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",10)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",11)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",12)="2:0:0:0" -^ZZCOVERAGE("%ZIS1","SETVAR",13)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","CHECK",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","CHECK",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","CHECK",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","CHECK",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","CHECK",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","CHECK",6)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","IOPAR")="4:0:0:0" -^ZZCOVERAGE("%ZIS2","IOPAR",0)="4:0:0:0" -^ZZCOVERAGE("%ZIS2","IOPAR",1)="4:0:0:0" -^ZZCOVERAGE("%ZIS2","L2")="2:0:0:0" -^ZZCOVERAGE("%ZIS2","L2",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OCPU",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OOS",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OOS",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU")="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",2,"FOR_LOOP",1)=4 -^ZZCOVERAGE("%ZIS2","OTHCPU",3)="4:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",4)="4:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",5)="4:0:0:0" -^ZZCOVERAGE("%ZIS2","OTHCPU",15)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","PTIME",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK")="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK",9)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","QUECHK",13)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","SLAVE",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","T2",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","T2",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",10)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",11)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",12)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",15)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",16)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","TMPVAR",18)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","VTRM",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS2","VTRM",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","%ZIS3",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","%ZIS3",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","%ZIS3",6)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","%ZIS3",8)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","%ZIS3",9)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","%ZIS3",11)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ALTP",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ASKMAR",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ASKMAR",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","MARGN")="2:0:0:0" -^ZZCOVERAGE("%ZIS3","MARGN",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","MARGN",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","MARGN",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","MARGN",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","Q",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","Q",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","Q",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","SETPAR")="2:0:0:0" -^ZZCOVERAGE("%ZIS3","SETPAR",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","SETPAR",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ST")="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ST",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ST",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ST",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","ST",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","STP",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","STP",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","STP",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","STP",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","TRM",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","TRM",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","TRM",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","TRM",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","TRM",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","W")="2:0:0:0" -^ZZCOVERAGE("%ZIS3","W",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","W",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS3","W",2)="1:0:0:0" -^ZZCOVERAGE("%ZIS3","W",3)="1:0:0:0" -^ZZCOVERAGE("%ZIS4","O")="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O1")="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O1",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O1",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O1",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","O1",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",4)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",5)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",9)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",10)="2:0:0:0" -^ZZCOVERAGE("%ZIS4","OPAR",12)="2:0:0:0" -^ZZCOVERAGE("%ZIS6","ANSBAK",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS6","ANSBAK",2)="2:0:0:0" -^ZZCOVERAGE("%ZIS6","ANSBAK",3)="2:0:0:0" -^ZZCOVERAGE("%ZIS6","OXECUTE",1)="2:0:0:0" -^ZZCOVERAGE("%ZIS6","QUIT",0)="2:0:0:0" -^ZZCOVERAGE("%ZIS6","QUIT",1)="2:0:0:0" -^ZZCOVERAGE("%ZISC","C0")="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",3)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",5)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",6)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",8)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",9)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",10)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",13)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",16)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",17)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",21)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",26)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",27)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",29)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",32)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",33)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",34)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",37)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",41)="1:0:0:0" -^ZZCOVERAGE("%ZISC","C0",43)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS")="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",0)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",2)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",3)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",4)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",5)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",6)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",7)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CIOS",8)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CLOSPP")="1:0:0:0" -^ZZCOVERAGE("%ZISC","CLOSPP",0)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CLOSPP",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","CLOSPP",2)="1:0:0:0" -^ZZCOVERAGE("%ZISC","END",0)="1:0:0:0" -^ZZCOVERAGE("%ZISC","END",2)="1:0:0:0" -^ZZCOVERAGE("%ZISC","END",4)="1:0:0:0" -^ZZCOVERAGE("%ZISC","FF")="1:0:0:0" -^ZZCOVERAGE("%ZISC","FF",0)="1:0:0:0" -^ZZCOVERAGE("%ZISC","FF",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","FF",2)="1:0:0:0" -^ZZCOVERAGE("%ZISC","RM")="1:0:0:0" -^ZZCOVERAGE("%ZISC","RM",0)="1:0:0:0" -^ZZCOVERAGE("%ZISC","RM",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","S1",0)="1:0:0:0" -^ZZCOVERAGE("%ZISC","S1",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",2)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",4)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",5)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",6)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",7)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",8)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",9)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",10)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SETIO",12)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SUBTYPE")="1:0:0:0" -^ZZCOVERAGE("%ZISC","SUBTYPE",1)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SUBTYPE",2)="1:0:0:0" -^ZZCOVERAGE("%ZISC","SUBTYPE",3)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT")="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT",0)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT",2)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT",3)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT",4)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT",5)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LINEPORT",6)="1:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTIEN")="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTIEN",0)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTIEN",1)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM")="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM",0)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM",1)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM",2)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM",3)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM",5)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTNAM",6)="3:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTSUB")="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTSUB",0)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTSUB",1)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTSUB",2)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","LNPRTSUB",3)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL")="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",0)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",1)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",3)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",4)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",5)="2:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",5,"FOR_LOOP",1)=40 -^ZZCOVERAGE("%ZISUTL","SYMBOL",6)="40:0:0:0" -^ZZCOVERAGE("%ZISUTL","SYMBOL",10)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","GETENV")="2:0:0:0" -^ZZCOVERAGE("%ZOSV","GETENV",1)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","GETENV",2)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","GETENV",3)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","LGR")="2:0:0:0" -^ZZCOVERAGE("%ZOSV","LGR",0)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","LGR",1)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","PRI")="1:0:0:0" -^ZZCOVERAGE("%ZOSV","PRI",0)="1:0:0:0" -^ZZCOVERAGE("%ZOSV","PRI",3)="1:0:0:0" -^ZZCOVERAGE("%ZOSV","RETURN")="2:0:4000:4000" -^ZZCOVERAGE("%ZOSV","RETURN",0)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","RETURN",2)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","RETURN",3)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","RETURN",4)="2:0:4000:4000" -^ZZCOVERAGE("%ZOSV","RETURN",5)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","RETURN",7)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","TEMP")="2:0:0:0" -^ZZCOVERAGE("%ZOSV","TEMP",0)="2:0:0:0" -^ZZCOVERAGE("%ZOSV","TEMP",2)="2:0:0:0" -^ZZCOVERAGE("%ZOSV2","LOAD")="467:1000060:340019:1340079" -^ZZCOVERAGE("%ZOSV2","LOAD",0)="467:0:0:0" -^ZZCOVERAGE("%ZOSV2","LOAD",1)="467:0:8001:8001" -^ZZCOVERAGE("%ZOSV2","LOAD",2)="467:1000060:320018:1320078" -^ZZCOVERAGE("%ZOSV2","LOAD",2,"FOR_LOOP",1)=45087 -^ZZCOVERAGE("%ZOSV2","LOAD",3)="467:0:12000:12000" -^ZZCOVERAGE("DIALOG","EZBLD")="2:0:4000:4000" -^ZZCOVERAGE("DIALOG","EZBLD",0)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",2)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",3)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",4)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",5)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",6)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",7)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",8)="2:0:0:0" -^ZZCOVERAGE("DIALOG","EZBLD",9)="2:0:0:0" -^ZZCOVERAGE("DIALOG","PARAM")="2:0:0:0" -^ZZCOVERAGE("DIALOG","PARAM",0)="4:0:0:0" -^ZZCOVERAGE("DIALOG","PARAM",1)="2:0:0:0" -^ZZCOVERAGE("DIALOG","PARAM",2)="2:0:0:0" -^ZZCOVERAGE("DIALOG","PARAM",3)="2:0:0:0" -^ZZCOVERAGE("DIALOG","Q1",0)="2:0:0:0" -^ZZCOVERAGE("DIALOG","Q2")="2:0:0:0" -^ZZCOVERAGE("DIALOG","Q2",0)="2:0:0:0" -^ZZCOVERAGE("DIALOG","QEZ",0)="2:0:4000:4000" -^ZZCOVERAGE("DIALOG","QEZ",1)="2:0:0:0" -^ZZCOVERAGE("DIALOG","QP",0)="2:0:0:0" -^ZZCOVERAGE("DIC","A1",0)="2:0:0:0" -^ZZCOVERAGE("DIC","ASK",0)="2:0:0:0" -^ZZCOVERAGE("DIC","ASK",1)="2:0:0:0" -^ZZCOVERAGE("DIC","ASK",2)="2:0:0:0" -^ZZCOVERAGE("DIC","ASK",3)="2:0:0:0" -^ZZCOVERAGE("DIC","ASK",4)="2:0:0:0" -^ZZCOVERAGE("DIC","DIC")="2:0:0:0" -^ZZCOVERAGE("DIC","DIC",3)="2:0:0:0" -^ZZCOVERAGE("DIC","DIC",4)="2:0:0:0" -^ZZCOVERAGE("DIC","DIC",5)="2:0:0:0" -^ZZCOVERAGE("DIC","DIC",6)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",0)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",1)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",2)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",3)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",4)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",5)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",6)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",7)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",8)="2:0:0:0" -^ZZCOVERAGE("DIC","EN",9)="2:0:0:0" -^ZZCOVERAGE("DIC","RTN",0)="2:0:0:0" -^ZZCOVERAGE("DIC","RTN",3)="2:0:0:0" -^ZZCOVERAGE("DIC","RTN",6)="2:0:0:0" -^ZZCOVERAGE("DIC","X",1)="2:0:0:0" -^ZZCOVERAGE("DIC","X",4)="2:0:0:0" -^ZZCOVERAGE("DIC","X",5)="2:0:0:0" -^ZZCOVERAGE("DIC","X",6)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE")="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",0)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",1)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",2)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",3)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",4)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",7)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",8)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",11)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",12)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",13)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",14)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",15)="2:0:0:0" -^ZZCOVERAGE("DIC0","GETFILE",16)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT")="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",1)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",2)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",3)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",4)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",5)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",6)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",7)="2:0:0:0" -^ZZCOVERAGE("DIC0","INIT",8)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN")="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",0)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",1)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",2)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",3)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",4)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",5)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",5,"FOR_LOOP",1)=2 -^ZZCOVERAGE("DIC0","SETIEN",6)="2:0:0:0" -^ZZCOVERAGE("DIC0","SETIEN",7)="2:0:0:0" -^ZZCOVERAGE("DIC1","B",0)="2:0:0:0" -^ZZCOVERAGE("DIC1","DIC1")="2:0:0:0" -^ZZCOVERAGE("DIC1","DIC1",3)="2:0:0:0" -^ZZCOVERAGE("DIC1","DIC1",4)="2:0:0:0" -^ZZCOVERAGE("DIC1","DIC1",5)="2:0:0:0" -^ZZCOVERAGE("DIC1","DO")="4:0:0:0" -^ZZCOVERAGE("DIC1","DO",1)="4:0:0:0" -^ZZCOVERAGE("DIC1","DO",2)="2:0:0:0" -^ZZCOVERAGE("DIC1","DO2",0)="2:0:0:0" -^ZZCOVERAGE("DIC1","DO2",1)="2:0:0:0" -^ZZCOVERAGE("DIC1","DO2",2)="2:0:0:0" -^ZZCOVERAGE("DIC1","DO2",3)="2:0:0:0" -^ZZCOVERAGE("DIC1","GETFA")="4:0:0:0" -^ZZCOVERAGE("DIC1","GETFA",0)="4:0:0:0" -^ZZCOVERAGE("DIC1","GETFA",2)="4:0:0:0" -^ZZCOVERAGE("DIC1","P",1)="2:0:0:0" -^ZZCOVERAGE("DIC1","P",2)="2:0:0:0" -^ZZCOVERAGE("DIC1","PROMPT",1)="2:0:0:0" -^ZZCOVERAGE("DIC1","PROMPT",2)="2:0:0:0" -^ZZCOVERAGE("DIC1","W",0)="2:0:0:0" -^ZZCOVERAGE("DIC1","W",0,"FOR_LOOP",1)=4 -^ZZCOVERAGE("DIC1","W",1)="3:0:0:0" -^ZZCOVERAGE("DIC1","W",2)="3:0:0:0" -^ZZCOVERAGE("DIC1","W",3)="2:0:0:0" -^ZZCOVERAGE("DIC1","W",4)="2:0:0:0" -^ZZCOVERAGE("DIC1","W",5)="2:0:0:0" -^ZZCOVERAGE("DIC1","W",6)="2:0:0:0" -^ZZCOVERAGE("DIC1","WOV")="1:0:0:0" -^ZZCOVERAGE("DIC1","WOV",0)="1:0:0:0" -^ZZCOVERAGE("DIC1","WOV",1)="1:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT")="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",0)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",1)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",2)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",3)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",3,"FOR_LOOP",1)=2 -^ZZCOVERAGE("DIC11","GETPRMT",4)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",8)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",9)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",10)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",11)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",12)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",13)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",14)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",15)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",16)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",17)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",18)="2:0:0:0" -^ZZCOVERAGE("DIC11","GETPRMT",19)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",0)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",1)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",2)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",3)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",4)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",6)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",8)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",9)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",11)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",12)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",13)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",14)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",15)="2:0:0:0" -^ZZCOVERAGE("DIC11","PR1",16)="2:0:0:0" -^ZZCOVERAGE("DIC11","PROMPT")="2:0:0:0" -^ZZCOVERAGE("DIC11","PROMPT",0)="2:0:0:0" -^ZZCOVERAGE("DIC11","PROMPT",1)="2:0:0:0" -^ZZCOVERAGE("DIC11","PROMPT",1,"FOR_LOOP",1)=2 -^ZZCOVERAGE("DIC11","PROMPT",2)="2:0:0:0" -^ZZCOVERAGE("DIC11","PROMPT",3)="2:0:0:0" -^ZZCOVERAGE("DIC11","PROMPT",5)="2:0:0:0" -^ZZCOVERAGE("DIC2","PGM")="4:0:0:0" -^ZZCOVERAGE("DIC2","PGM",0)="4:0:0:0" -^ZZCOVERAGE("DIC2","PGM",1)="4:0:0:0" -^ZZCOVERAGE("DIC2","PGM",2)="4:0:0:0" -^ZZCOVERAGE("DIC2","Q")="2:0:0:0" -^ZZCOVERAGE("DIC2","Q",0)="2:0:0:0" -^ZZCOVERAGE("DIC2","Q",1)="2:0:0:0" -^ZZCOVERAGE("DIC2","Q",2)="2:0:0:0" -^ZZCOVERAGE("DICL","DINDEX")="2:0:0:0" -^ZZCOVERAGE("DICL","DINDEX",0)="2:0:0:0" -^ZZCOVERAGE("DICL","DINDEX",1)="2:0:0:0" -^ZZCOVERAGE("DICL","DINDEX",2)="2:0:0:0" -^ZZCOVERAGE("DICL","DINDEX",5)="2:0:0:0" -^ZZCOVERAGE("DICL","DINDEX",6)="2:0:0:0" -^ZZCOVERAGE("DICUIX","I1",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX","I1",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX","I1",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX","I1",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX","INDEX")="2:0:0:0" -^ZZCOVERAGE("DICUIX","INDEX",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X1",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X1",8)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X1",9)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",8)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",11)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",12)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",13)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",14)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",15)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",15,"FOR_LOOP",1)=2 -^ZZCOVERAGE("DICUIX","X2",16)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",17)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",18)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",19)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",20)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",21)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",22)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",23)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",24)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",25)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",26)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",27)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",28)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",29)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",30)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",31)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",32)="2:0:0:0" -^ZZCOVERAGE("DICUIX","X2",33)="2:0:0:0" -^ZZCOVERAGE("DICUIX","XREF")="2:0:0:0" -^ZZCOVERAGE("DICUIX","XREF",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G1",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G1",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G1",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G2",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G2",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G3",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G30",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G4",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G4",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G4",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G4",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G4",6)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G4",7)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G5",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G5",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","G5",7)="2:0:0:0" -^ZZCOVERAGE("DICUIX1","GET")="2:0:0:0" -^ZZCOVERAGE("DICUIX1","GET",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C1",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C1",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C2",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C2",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C3",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C3",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C3",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C3",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",6)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",7)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",8)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",9)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",10)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",11)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",12)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",17)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",18)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",23)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C4",24)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C5",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C5",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C6",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C6",18)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C6",19)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C6",20)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C7",0)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","C7",7)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1")="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",6)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON1",7)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2")="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",1)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",2)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",3)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",4)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",5)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",6)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",7)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",8)="2:0:0:0" -^ZZCOVERAGE("DICUIX2","COMMON2",9)="2:0:0:0" -^ZZCOVERAGE("DIEFU","IENX",1)="2:0:0:0" -^ZZCOVERAGE("DIEFU","IENX",2)="2:0:0:0" -^ZZCOVERAGE("DIEFU","IENX",3)="2:0:0:0" -^ZZCOVERAGE("DIEFU","IENX",3,"FOR_LOOP",1)=4 -^ZZCOVERAGE("DIEFU","IENX",4)="2:0:0:0" -^ZZCOVERAGE("DIEFU","IENX",5)="2:0:0:0" -^ZZCOVERAGE("DILF","CREF")="4:0:0:0" -^ZZCOVERAGE("DILF","CREF",0)="4:0:0:0" -^ZZCOVERAGE("DILF","IENS")="2:0:0:0" -^ZZCOVERAGE("DILF","IENS",0)="2:0:0:0" -^ZZCOVERAGE("DILF","IENS",1)="2:0:0:0" -^ZZCOVERAGE("DILF","OREF")="2:0:0:0" -^ZZCOVERAGE("DILF","OREF",0)="2:0:0:0" -^ZZCOVERAGE("DILIBF","FNO")="2:0:0:0" -^ZZCOVERAGE("DILIBF","FNO",0)="2:0:0:0" -^ZZCOVERAGE("DILIBF","FNO",1)="2:0:0:0" -^ZZCOVERAGE("DILIBF","FNO",2)="2:0:0:0" -^ZZCOVERAGE("DIQGU","ENCREF",0)="4:0:0:0" -^ZZCOVERAGE("DIQGU","ENOREF",0)="2:0:0:0" -^ZZCOVERAGE("DIQGU","OR2")="2:0:0:0" -^ZZCOVERAGE("DIQGU","OR2",0)="2:0:0:0" -^ZZCOVERAGE("XINDEX","A2",0)="468:0:4000:4000" -^ZZCOVERAGE("XINDEX","A2",1)="467:0:0:0" -^ZZCOVERAGE("XINDEX","A2",2)="467:0:0:0" -^ZZCOVERAGE("XINDEX","A2",3)="467:4000:0:4000" -^ZZCOVERAGE("XINDEX","A2",4)="467:0:4000:4000" -^ZZCOVERAGE("XINDEX","A2",5)="467:0:0:0" -^ZZCOVERAGE("XINDEX","ALIVE",1)="1:0:0:0" -^ZZCOVERAGE("XINDEX","B5",0)="467:188012:220012:408024" -^ZZCOVERAGE("XINDEX","B5",0,"FOR_LOOP",1)=44620 -^ZZCOVERAGE("XINDEX","B5",1)="467:20000:8000:28000" -^ZZCOVERAGE("XINDEX","B5",2)="467:4000:0:4000" -^ZZCOVERAGE("XINDEX","B5",3)="467:0:0:0" -^ZZCOVERAGE("XINDEX","B5",4)="467:4000:0:4000" -^ZZCOVERAGE("XINDEX","B5",5)="467:0:0:0" -^ZZCOVERAGE("XINDEX","BEG")="467:2460149:2872194:5332343" -^ZZCOVERAGE("XINDEX","BEG",1)="467:8000:0:8000" -^ZZCOVERAGE("XINDEX","BEG",2)="467:4000:0:4000" -^ZZCOVERAGE("XINDEX","BEG",3)="467:0:4000:4000" -^ZZCOVERAGE("XINDEX","BEG",4)="467:0:4000:4000" -^ZZCOVERAGE("XINDEX","BEG",5)="467:4001:0:4001" -^ZZCOVERAGE("XINDEX","BEG",7)="467:0:0:0" -^ZZCOVERAGE("XINDEX","BEG",8)="467:0:0:0" -^ZZCOVERAGE("XINDEX","BEG",9)="467:0:0:0" -^ZZCOVERAGE("XINDEX","BEG",11)="467:4000:0:4000" -^ZZCOVERAGE("XINDEX","BEG",12)="467:0:4000:4000" -^ZZCOVERAGE("XINDEX","BEG",14)="467:0:0:0" -^ZZCOVERAGE("XINDEX","BEG",15)="467:0:0:0" -^ZZCOVERAGE("XINDEX","BEG",16)="467:0:0:0" -^ZZCOVERAGE("XINDEX","CD",0)="44620:32001:36002:68003" -^ZZCOVERAGE("XINDEX","CD",1)="44620:40002:60004:100006" -^ZZCOVERAGE("XINDEX","CD",2)="44620:40001:60002:100003" -^ZZCOVERAGE("XINDEX","CD",3)="44620:36002:44004:80006" -^ZZCOVERAGE("XINDEX","CD",4)="44620:28000:40002:68002" -^ZZCOVERAGE("XINDEX","CD",5)="44620:28002:52001:80003" -^ZZCOVERAGE("XINDEX","CD",6)="10770:28003:20000:48003" -^ZZCOVERAGE("XINDEX","CD",6,"FOR_LOOP",1)=57531 -^ZZCOVERAGE("XINDEX","CD",7)="10770:24004:16000:40004" -^ZZCOVERAGE("XINDEX","CD",9)="44620:60005:40004:100009" -^ZZCOVERAGE("XINDEX","CD",10)="44620:44003:48005:92008" -^ZZCOVERAGE("XINDEX","CD",12)="44620:52004:44002:96006" -^ZZCOVERAGE("XINDEX","EE",0)="116081:148007:200014:348021" -^ZZCOVERAGE("XINDEX","EE",1)="71461:44004:44002:88006" -^ZZCOVERAGE("XINDEX","EE",2)="71461:100007:80003:180010" -^ZZCOVERAGE("XINDEX","EE",3)="54870:44001:48001:92002" -^ZZCOVERAGE("XINDEX","EE",4)="53608:88008:100009:188017" -^ZZCOVERAGE("XINDEX","EE",5)="53608:72006:68004:140010" -^ZZCOVERAGE("XINDEX","EE",6)="53608:76005:72004:148009" -^ZZCOVERAGE("XINDEX","EE",8)="53608:60003:64005:124008" -^ZZCOVERAGE("XINDEX","EE",9)="53608:48003:72003:120006" -^ZZCOVERAGE("XINDEX","EE",10)="53608:52002:96008:148010" -^ZZCOVERAGE("XINDEX","EE",13)="53608:52003:44001:96004" -^ZZCOVERAGE("XINDEX","EE",14)="53608:96007:112006:208013" -^ZZCOVERAGE("XINDEX","EE",15)="53608:24001:52004:76005" -^ZZCOVERAGE("XINDEX","EE",16)="53608:52005:88007:140012" -^ZZCOVERAGE("XINDEX","EE",17)="53608:128008:208017:336025" -^ZZCOVERAGE("XINDEX","F")="1559:4000:4001:8001" -^ZZCOVERAGE("XINDEX","F",0)="1559:4000:0:4000" -^ZZCOVERAGE("XINDEX","G")="1932:56003:96009:152012" -^ZZCOVERAGE("XINDEX","G",0)="1932:4000:8002:12002" -^ZZCOVERAGE("XINDEX","H")="11:0:0:0" -^ZZCOVERAGE("XINDEX","H",0)="11:0:0:0" -^ZZCOVERAGE("XINDEX","K")="2218:40001:24002:64003" -^ZZCOVERAGE("XINDEX","K",0)="2218:4000:4000:8000" -^ZZCOVERAGE("XINDEX","K",1)="2218:0:4001:4001" -^ZZCOVERAGE("XINDEX","L")="259:4001:4000:8001" -^ZZCOVERAGE("XINDEX","L",0)="259:0:0:0" -^ZZCOVERAGE("XINDEX","LN",0)="44620:68005:104005:172010" -^ZZCOVERAGE("XINDEX","LN",1)="44620:40001:64004:104005" -^ZZCOVERAGE("XINDEX","LN",2)="5073:12000:4001:16001" -^ZZCOVERAGE("XINDEX","LN",3)="5073:4000:8000:12000" -^ZZCOVERAGE("XINDEX","LN",4)="5073:20001:0:20001" -^ZZCOVERAGE("XINDEX","LN",5)="5073:20003:12002:32005" -^ZZCOVERAGE("XINDEX","LN",6)="5073:12002:16000:28002" -^ZZCOVERAGE("XINDEX","LOAD")="467:88003:196019:284022" -^ZZCOVERAGE("XINDEX","LOAD",0)="467:88003:196019:284022" -^ZZCOVERAGE("XINDEX","LOAD",1)="467:0:0:0" -^ZZCOVERAGE("XINDEX","LOAD",2)="467:0:0:0" -^ZZCOVERAGE("XINDEX","M")="30:4000:0:4000" -^ZZCOVERAGE("XINDEX","M",0)="30:0:0:0" -^ZZCOVERAGE("XINDEX","N")="1721:88005:80004:168009" -^ZZCOVERAGE("XINDEX","N",0)="1721:4000:0:4000" -^ZZCOVERAGE("XINDEX","POSTRTN")="467:108009:96003:204012" -^ZZCOVERAGE("XINDEX","POSTRTN",1)="467:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",2)="467:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",3)="467:12000:8000:20000" -^ZZCOVERAGE("XINDEX","POSTRTN",3,"FOR_LOOP",1)=2558 -^ZZCOVERAGE("XINDEX","POSTRTN",4)="2091:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",5)="2044:4000:0:4000" -^ZZCOVERAGE("XINDEX","POSTRTN",6)="2044:4000:0:4000" -^ZZCOVERAGE("XINDEX","POSTRTN",9)="2044:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",10)="467:0:4000:4000" -^ZZCOVERAGE("XINDEX","POSTRTN",11)="467:12002:16001:28003" -^ZZCOVERAGE("XINDEX","POSTRTN",11,"FOR_LOOP",1)=5540 -^ZZCOVERAGE("XINDEX","POSTRTN",12)="5073:0:4000:4000" -^ZZCOVERAGE("XINDEX","POSTRTN",13)="5073:8000:4000:12000" -^ZZCOVERAGE("XINDEX","POSTRTN",14)="5073:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",15)="467:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",16)="467:28001:20001:48002" -^ZZCOVERAGE("XINDEX","POSTRTN",16,"FOR_LOOP",1)=16376 -^ZZCOVERAGE("XINDEX","POSTRTN",17)="15909:40006:40001:80007" -^ZZCOVERAGE("XINDEX","POSTRTN",18)="15909:0:0:0" -^ZZCOVERAGE("XINDEX","POSTRTN",19)="467:0:0:0" -^ZZCOVERAGE("XINDEX","Q")="7762:12000:20001:32001" -^ZZCOVERAGE("XINDEX","Q",0)="7762:4000:16001:20001" -^ZZCOVERAGE("XINDEX","QUOTE")="36371:188012:232009:420021" -^ZZCOVERAGE("XINDEX","QUOTE",0)="36371:156010:192008:348018" -^ZZCOVERAGE("XINDEX","QUOTE",0,"FOR_LOOP",1)=323268 -^ZZCOVERAGE("XINDEX","QUOTE",1)="36371:20002:20001:40003" -^ZZCOVERAGE("XINDEX","R")="85:0:8001:8001" -^ZZCOVERAGE("XINDEX","R",0)="85:0:0:0" -^ZZCOVERAGE("XINDEX","S")="17549:716055:988057:1704112" -^ZZCOVERAGE("XINDEX","S",0)="17549:28003:28003:56006" -^ZZCOVERAGE("XINDEX","SE2",0)="86891:176010:272017:448027" -^ZZCOVERAGE("XINDEX","SE2",1)="85079:264015:376016:640031" -^ZZCOVERAGE("XINDEX","SE2",2)="85079:72005:112010:184015" -^ZZCOVERAGE("XINDEX","SEP")="107216:736054:648038:1384092" -^ZZCOVERAGE("XINDEX","SEP",0)="107216:580045:440030:1020075" -^ZZCOVERAGE("XINDEX","SEP",0,"FOR_LOOP",1)=1019212 -^ZZCOVERAGE("XINDEX","SEP",1)="107216:120007:144005:264012" -^ZZCOVERAGE("XINDEX","SET")="85079:772044:1124063:1896107" -^ZZCOVERAGE("XINDEX","SET",0)="85079:176007:168008:344015" -^ZZCOVERAGE("XINDEX","SET",0,"FOR_LOOP",1)=74812 -^ZZCOVERAGE("XINDEX","SET",1)="85079:64005:144010:208015" -^ZZCOVERAGE("XINDEX","ST",0)="44620:68001:56004:124005" -^ZZCOVERAGE("XINDEX","ST",2)="44620:260012:376038:636050" -^ZZCOVERAGE("XINDEX","ST",2,"FOR_LOOP",1)=85813 -^ZZCOVERAGE("XINDEX","ST",2,"FOR_LOOP",2)=126272 -^ZZCOVERAGE("XINDEX","ST",3)="44620:224014:184014:408028" -^ZZCOVERAGE("XINDEX","ST",4)="44620:0:0:0" -^ZZCOVERAGE("XINDEX","U")="72:0:0:0" -^ZZCOVERAGE("XINDEX","U",0)="72:0:0:0" -^ZZCOVERAGE("XINDEX","W")="4584:156009:200014:356023" -^ZZCOVERAGE("XINDEX","W",0)="4584:0:16001:16001" -^ZZCOVERAGE("XINDEX","X")="220:0:0:0" -^ZZCOVERAGE("XINDEX","X",0)="220:0:0:0" -^ZZCOVERAGE("XINDEX","XINDEX")="1:32002:36000:68002" -^ZZCOVERAGE("XINDEX","XINDEX",3)="1:0:0:0" -^ZZCOVERAGE("XINDX1","A",0)="75:0:4000:4000" -^ZZCOVERAGE("XINDX1","A",1)="75:0:0:0" -^ZZCOVERAGE("XINDX1","A",2)="75:0:0:0" -^ZZCOVERAGE("XINDX1","B",0)="75:0:0:0" -^ZZCOVERAGE("XINDX1","B",4)="75:0:0:0" -^ZZCOVERAGE("XINDX1","B",6)="75:0:0:0" -^ZZCOVERAGE("XINDX1","B",7)="75:0:0:0" -^ZZCOVERAGE("XINDX1","E")="73:0:4000:4000" -^ZZCOVERAGE("XINDX1","E",0)="73:0:0:0" -^ZZCOVERAGE("XINDX1","XINDX1")="2:0:0:0" -^ZZCOVERAGE("XINDX1","XINDX1",3)="2:0:0:0" -^ZZCOVERAGE("XINDX10","ASK")="1:0:0:0" -^ZZCOVERAGE("XINDX10","ASK",1)="1:0:0:0" -^ZZCOVERAGE("XINDX10","ASK",2)="1:0:0:0" -^ZZCOVERAGE("XINDX10","ASK",3)="1:0:0:0" -^ZZCOVERAGE("XINDX10","ASK",8)="1:0:0:0" -^ZZCOVERAGE("XINDX2","%")="44620:132010:232014:364024" -^ZZCOVERAGE("XINDX2","%",0)="44620:96008:92005:188013" -^ZZCOVERAGE("XINDX2","%",0,"FOR_LOOP",1)=62810 -^ZZCOVERAGE("XINDX2","%",1)="44620:16001:68003:84004" -^ZZCOVERAGE("XINDX2","ARG")="329774:1516089:2124136:3640225" -^ZZCOVERAGE("XINDX2","ARG",1)="330498:328020:360021:688041" -^ZZCOVERAGE("XINDX2","ARG",2)="262221:228015:296022:524037" -^ZZCOVERAGE("XINDX2","ARG",3)="226556:260020:468034:728054" -^ZZCOVERAGE("XINDX2","ARG",4)="126854:104004:160011:264015" -^ZZCOVERAGE("XINDX2","ARG",5)="117750:136007:148011:284018" -^ZZCOVERAGE("XINDX2","ARG",6)="88629:60001:96003:156004" -^ZZCOVERAGE("XINDX2","ARG",7)="88424:80005:100006:180011" -^ZZCOVERAGE("XINDX2","ARG",8)="86550:72002:108007:180009" -^ZZCOVERAGE("XINDX2","ARGG")="18715:288018:352019:640037" -^ZZCOVERAGE("XINDX2","ARGG",0)="18715:76007:84005:160012" -^ZZCOVERAGE("XINDX2","ARGG",0,"FOR_LOOP",1)=49672 -^ZZCOVERAGE("XINDX2","ARGS")="44410:464031:676031:1140062" -^ZZCOVERAGE("XINDX2","ARGS",1)="63125:620038:844037:1464075" -^ZZCOVERAGE("XINDX2","ARGS",1,"FOR_LOOP",1)=291597 -^ZZCOVERAGE("XINDX2","ARGS",2)="63125:24001:60004:84005" -^ZZCOVERAGE("XINDX2","DN")="44410:208011:284017:492028" -^ZZCOVERAGE("XINDX2","DN",0)="44410:44003:108008:152011" -^ZZCOVERAGE("XINDX2","DN",1)="44410:152008:144006:296014" -^ZZCOVERAGE("XINDX2","EXT",1)="1970:4000:8001:12001" -^ZZCOVERAGE("XINDX2","EXT",2)="1970:0:0:0" -^ZZCOVERAGE("XINDX2","EXT",3)="1970:8001:12001:20002" -^ZZCOVERAGE("XINDX2","EXT",4)="1970:0:4000:4000" -^ZZCOVERAGE("XINDX2","FLUSH")="94:0:0:0" -^ZZCOVERAGE("XINDX2","FLUSH",0)="94:0:0:0" -^ZZCOVERAGE("XINDX2","FLUSH",1)="94:0:0:0" -^ZZCOVERAGE("XINDX2","FLUSH",1,"FOR_LOOP",1)=415 -^ZZCOVERAGE("XINDX2","FLUSH",2)="94:0:0:0" -^ZZCOVERAGE("XINDX2","FNC")="12:0:0:0" -^ZZCOVERAGE("XINDX2","FNC",0)="12:0:0:0" -^ZZCOVERAGE("XINDX2","FNC",1)="12:0:0:0" -^ZZCOVERAGE("XINDX2","FNC",2)="12:0:0:0" -^ZZCOVERAGE("XINDX2","FNC",3)="12:0:0:0" -^ZZCOVERAGE("XINDX2","FNC",4)="12:0:0:0" -^ZZCOVERAGE("XINDX2","FUN")="29121:340019:424027:764046" -^ZZCOVERAGE("XINDX2","FUN",0)="29121:36004:40002:76006" -^ZZCOVERAGE("XINDX2","FUN",1)="23452:48002:72003:120005" -^ZZCOVERAGE("XINDX2","FUN",2)="23452:20000:44003:64003" -^ZZCOVERAGE("XINDX2","FUN",3)="23393:96004:56005:152009" -^ZZCOVERAGE("XINDX2","FUN",3,"FOR_LOOP",1)=147754 -^ZZCOVERAGE("XINDX2","FUN",4)="23393:48003:56005:104008" -^ZZCOVERAGE("XINDX2","FUN",5)="23393:60004:92005:152009" -^ZZCOVERAGE("XINDX2","GLO",0)="9104:28002:28001:56003" -^ZZCOVERAGE("XINDX2","GLO",1)="9104:12001:20001:32002" -^ZZCOVERAGE("XINDX2","GLO",2)="9104:16000:28001:44001" -^ZZCOVERAGE("XINDX2","GLO",3)="9104:36002:80004:116006" -^ZZCOVERAGE("XINDX2","GLO",4)="9104:8000:4000:12000" -^ZZCOVERAGE("XINDX2","INC")="322910:416022:652029:1068051" -^ZZCOVERAGE("XINDX2","INC",0)="365505:320019:472020:792039" -^ZZCOVERAGE("XINDX2","INC2")="42595:104006:148008:252014" -^ZZCOVERAGE("XINDX2","INC2",0)="42595:48001:40003:88004" -^ZZCOVERAGE("XINDX2","LOC")="99702:576031:736052:1312083" -^ZZCOVERAGE("XINDX2","LOC",0)="99702:144010:156013:300023" -^ZZCOVERAGE("XINDX2","LOC",1)="99702:124004:148011:272015" -^ZZCOVERAGE("XINDX2","LOC",2)="99702:212011:272014:484025" -^ZZCOVERAGE("XINDX2","LOC",3)="99702:52005:96006:148011" -^ZZCOVERAGE("XINDX2","NAK",0)="996:0:0:0" -^ZZCOVERAGE("XINDX2","NAK",1)="996:0:0:0" -^ZZCOVERAGE("XINDX2","PAT")="205:4000:0:4000" -^ZZCOVERAGE("XINDX2","PAT",0)="205:0:0:0" -^ZZCOVERAGE("XINDX2","PAT",1)="205:4000:0:4000" -^ZZCOVERAGE("XINDX2","PAT",1,"FOR_LOOP",1)=457 -^ZZCOVERAGE("XINDX2","PAT",2)="205:0:0:0" -^ZZCOVERAGE("XINDX2","PATCODE")="457:4000:4000:8000" -^ZZCOVERAGE("XINDX2","PATCODE",0)="457:0:4000:4000" -^ZZCOVERAGE("XINDX2","PATCODE",1)="358:4000:0:4000" -^ZZCOVERAGE("XINDX2","PATCODE",1,"FOR_LOOP",1)=791 -^ZZCOVERAGE("XINDX2","PATCODE",2)="358:0:0:0" -^ZZCOVERAGE("XINDX2","PATCODE",3)="358:0:0:0" -^ZZCOVERAGE("XINDX2","PATCODE",4)="358:0:0:0" -^ZZCOVERAGE("XINDX2","PATQ")="99:4000:4000:8000" -^ZZCOVERAGE("XINDX2","PATQ",0)="99:0:4000:4000" -^ZZCOVERAGE("XINDX2","PATQ",0,"FOR_LOOP",1)=247 -^ZZCOVERAGE("XINDX2","PATQ",1)="99:4000:0:4000" -^ZZCOVERAGE("XINDX2","PATQ",2)="99:0:0:0" -^ZZCOVERAGE("XINDX2","PEEK")="112687:168013:248022:416035" -^ZZCOVERAGE("XINDX2","PEEK",0)="112687:120009:164010:284019" -^ZZCOVERAGE("XINDX2","PEEKDN")="17373:56002:40000:96002" -^ZZCOVERAGE("XINDX2","PEEKDN",0)="17373:48002:32000:80002" -^ZZCOVERAGE("XINDX2","REPCNT")="457:0:0:0" -^ZZCOVERAGE("XINDX2","REPCNT",0)="457:0:0:0" -^ZZCOVERAGE("XINDX2","REPCNT",0,"FOR_LOOP",1)=1004 -^ZZCOVERAGE("XINDX2","REPCNT",1)="457:0:0:0" -^ZZCOVERAGE("XINDX2","REPCNT",2)="457:0:0:0" -^ZZCOVERAGE("XINDX2","SPV",1)="3699:0:8001:8001" -^ZZCOVERAGE("XINDX2","SPV",2)="3699:0:0:0" -^ZZCOVERAGE("XINDX2","ST")="110835:464030:648049:1112079" -^ZZCOVERAGE("XINDX2","ST",0)="110835:192009:248021:440030" -^ZZCOVERAGE("XINDX2","ST",1)="110835:100008:156011:256019" -^ZZCOVERAGE("XINDX2","ST",2)="110835:76005:116005:192010" -^ZZCOVERAGE("XINDX2","TEXT",0)="59:0:0:0" -^ZZCOVERAGE("XINDX2","TEXT",1)="59:0:0:0" -^ZZCOVERAGE("XINDX2","TEXT",2)="59:0:0:0" -^ZZCOVERAGE("XINDX2","TEXT",3)="59:0:0:0" -^ZZCOVERAGE("XINDX2","UP")="44410:116012:180012:296024" -^ZZCOVERAGE("XINDX2","UP",1)="44410:112012:116006:228018" -^ZZCOVERAGE("XINDX2","VA")="5073:16001:20000:36001" -^ZZCOVERAGE("XINDX2","VA",0)="5073:4000:12000:16000" -^ZZCOVERAGE("XINDX2","VA",1)="5073:8000:4000:12000" -^ZZCOVERAGE("XINDX2","VT")="10205:4001:24002:28003" -^ZZCOVERAGE("XINDX2","VT",0)="10205:0:8000:8000" -^ZZCOVERAGE("XINDX2","VT",1)="10205:0:4000:4000" -^ZZCOVERAGE("XINDX3","A",0)="8136:36001:12001:48002" -^ZZCOVERAGE("XINDX3","ASM")="312:12001:0:12001" -^ZZCOVERAGE("XINDX3","ASM",0)="312:0:0:0" -^ZZCOVERAGE("XINDX3","ASM",1)="312:8001:0:8001" -^ZZCOVERAGE("XINDX3","ASM",1,"FOR_LOOP",1)=2110 -^ZZCOVERAGE("XINDX3","ASM",2)="312:0:0:0" -^ZZCOVERAGE("XINDX3","DN")="498:4000:4000:8000" -^ZZCOVERAGE("XINDX3","DN",0)="498:0:4000:4000" -^ZZCOVERAGE("XINDX3","DN",1)="498:4000:0:4000" -^ZZCOVERAGE("XINDX3","FL")="63250:152007:260014:412021" -^ZZCOVERAGE("XINDX3","FL",1)="63250:72000:144009:216009" -^ZZCOVERAGE("XINDX3","FL",2)="63250:64006:80004:144010" -^ZZCOVERAGE("XINDX3","INC")="145482:224018:308026:532044" -^ZZCOVERAGE("XINDX3","INC",0)="145482:188015:196015:384030" -^ZZCOVERAGE("XINDX3","KL",1)="2218:0:4000:4000" -^ZZCOVERAGE("XINDX3","KL1")="28:0:0:0" -^ZZCOVERAGE("XINDX3","KL1",0)="28:0:0:0" -^ZZCOVERAGE("XINDX3","KL2")="724:4000:28000:32000" -^ZZCOVERAGE("XINDX3","KL2",0)="724:0:0:0" -^ZZCOVERAGE("XINDX3","KL2",1)="724:0:4000:4000" -^ZZCOVERAGE("XINDX3","KL2",2)="724:0:0:0" -^ZZCOVERAGE("XINDX3","KL3")="3320:12002:36002:48004" -^ZZCOVERAGE("XINDX3","KL3",0)="3320:4000:8000:12000" -^ZZCOVERAGE("XINDX3","KL3",1)="3320:4001:4000:8001" -^ZZCOVERAGE("XINDX3","KL5",0)="3320:0:20002:20002" -^ZZCOVERAGE("XINDX3","MULT")="498:8001:4000:12001" -^ZZCOVERAGE("XINDX3","MULT",0)="498:4001:0:4001" -^ZZCOVERAGE("XINDX3","MULT",1)="498:4000:4000:8000" -^ZZCOVERAGE("XINDX3","MULT",1,"FOR_LOOP",1)=2401 -^ZZCOVERAGE("XINDX3","MULT",2)="498:0:0:0" -^ZZCOVERAGE("XINDX3","N2",0)="23604:68004:36003:104007" -^ZZCOVERAGE("XINDX3","N2",3)="11802:16002:4000:20002" -^ZZCOVERAGE("XINDX3","N2",4)="187:0:0:0" -^ZZCOVERAGE("XINDX3","N2",5)="187:0:0:0" -^ZZCOVERAGE("XINDX3","N2",6)="11628:12001:20002:32003" -^ZZCOVERAGE("XINDX3","N2",7)="11628:12000:8000:20000" -^ZZCOVERAGE("XINDX3","NE")="779:32002:16001:48003" -^ZZCOVERAGE("XINDX3","NE",1)="2500:4000:4000:8000" -^ZZCOVERAGE("XINDX3","NE",2)="2500:4000:20000:24000" -^ZZCOVERAGE("XINDX3","PEEK")="498:0:0:0" -^ZZCOVERAGE("XINDX3","PEEK",0)="498:0:0:0" -^ZZCOVERAGE("XINDX3","PEEKDN")="39:0:0:0" -^ZZCOVERAGE("XINDX3","PEEKDN",0)="39:0:0:0" -^ZZCOVERAGE("XINDX3","RD",0)="85:0:0:0" -^ZZCOVERAGE("XINDX3","RD1",0)="278:0:4001:4001" -^ZZCOVERAGE("XINDX3","RD1",3)="193:0:4000:4000" -^ZZCOVERAGE("XINDX3","RD1",4)="85:0:0:0" -^ZZCOVERAGE("XINDX3","RD1",5)="85:0:0:0" -^ZZCOVERAGE("XINDX3","RD2")="85:0:4000:4000" -^ZZCOVERAGE("XINDX3","RD2",0)="255:0:0:0" -^ZZCOVERAGE("XINDX3","RD2",1)="170:0:0:0" -^ZZCOVERAGE("XINDX3","RD2",2)="170:0:4000:4000" -^ZZCOVERAGE("XINDX3","RD2",3)="85:0:0:0" -^ZZCOVERAGE("XINDX3","RD3")="108:0:0:0" -^ZZCOVERAGE("XINDX3","RD3",0)="161:0:0:0" -^ZZCOVERAGE("XINDX3","RD3",1)="37:0:0:0" -^ZZCOVERAGE("XINDX3","RD3",2)="37:0:0:0" -^ZZCOVERAGE("XINDX3","S",1)="17579:48005:56003:104008" -^ZZCOVERAGE("XINDX3","S2",0)="110559:164008:220011:384019" -^ZZCOVERAGE("XINDX3","S2",1)="92980:64007:96005:160012" -^ZZCOVERAGE("XINDX3","S2",2)="92980:52004:100005:152009" -^ZZCOVERAGE("XINDX3","S2",3)="87238:60005:68003:128008" -^ZZCOVERAGE("XINDX3","S2",4)="63916:68007:68004:136011" -^ZZCOVERAGE("XINDX3","S2",5)="846:0:0:0" -^ZZCOVERAGE("XINDX3","S2",6)="846:0:4000:4000" -^ZZCOVERAGE("XINDX3","S2",10)="63916:56004:60003:116007" -^ZZCOVERAGE("XINDX3","S2",11)="62481:40002:60003:100005" -^ZZCOVERAGE("XINDX3","S2",12)="62313:56003:56005:112008" -^ZZCOVERAGE("XINDX3","S2",13)="61815:76007:152010:228017" -^ZZCOVERAGE("XINDX3","UP")="498:8000:4000:12000" -^ZZCOVERAGE("XINDX3","UP",1)="498:8000:4000:12000" -^ZZCOVERAGE("XINDX3","VLN",1)="15909:32002:16001:48003" -^ZZCOVERAGE("XINDX3","VLN",2)="15909:44002:28003:72005" -^ZZCOVERAGE("XINDX3","VLNF")="15909:120006:60005:180011" -^ZZCOVERAGE("XINDX3","VLNF",0)="15909:32002:12001:44003" -^ZZCOVERAGE("XINDX4","CNG")="2186:0:24001:24001" -^ZZCOVERAGE("XINDX4","CNG",0)="2186:0:0:0" -^ZZCOVERAGE("XINDX4","CNG",2)="2186:0:8001:8001" -^ZZCOVERAGE("XINDX4","CNG",2,"FOR_LOOP",1)=2202 -^ZZCOVERAGE("XINDX4","CNG",3)="2186:0:12000:12000" -^ZZCOVERAGE("XINDX4","DG",0)="8937:20003:16000:36003" -^ZZCOVERAGE("XINDX4","DG",1)="8937:12000:16001:28001" -^ZZCOVERAGE("XINDX4","DG",2)="8937:8001:20002:28003" -^ZZCOVERAGE("XINDX4","DG",3)="8937:16000:12000:28000" -^ZZCOVERAGE("XINDX4","DG",4)="8937:4000:12001:16001" -^ZZCOVERAGE("XINDX4","DG",5)="8937:0:12002:12002" -^ZZCOVERAGE("XINDX4","DG",6)="8937:12001:12000:24001" -^ZZCOVERAGE("XINDX4","DG",7)="8937:12000:20003:32003" -^ZZCOVERAGE("XINDX4","DG",8)="8937:24001:4001:28002" -^ZZCOVERAGE("XINDX4","DG",9)="8937:4000:12001:16001" -^ZZCOVERAGE("XINDX4","DG",10)="8937:16001:28001:44002" -^ZZCOVERAGE("XINDX4","DG",11)="8937:8000:12000:20000" -^ZZCOVERAGE("XINDX4","DG",12)="8937:4000:16002:20002" -^ZZCOVERAGE("XINDX4","DG",13)="8937:8000:12002:20002" -^ZZCOVERAGE("XINDX4","DG",14)="8937:0:4000:4000" -^ZZCOVERAGE("XINDX4","DG",15)="8937:36002:32002:68004" -^ZZCOVERAGE("XINDX4","DG",16)="8937:8001:4001:12002" -^ZZCOVERAGE("XINDX4","DG",17)="8387:12002:4000:16002" -^ZZCOVERAGE("XINDX4","DG1")="8449:168011:180013:348024" -^ZZCOVERAGE("XINDX4","DG1",0)="8449:12001:16001:28002" -^ZZCOVERAGE("XINDX4","FR",0)="525:0:4001:4001" -^ZZCOVERAGE("XINDX4","FR",1)="525:0:0:0" -^ZZCOVERAGE("XINDX4","FR",2)="525:0:0:0" -^ZZCOVERAGE("XINDX4","INSIDE")="2202:4001:32001:36002" -^ZZCOVERAGE("XINDX4","INSIDE",0)="2202:0:16000:16000" -^ZZCOVERAGE("XINDX4","INSIDE",1)="2202:0:4000:4000" -^ZZCOVERAGE("XINDX4","INSIDE",2)="2202:4001:4000:8001" -^ZZCOVERAGE("XINDX4","LO",1)="259:0:0:0" -^ZZCOVERAGE("XINDX4","LO",2)="259:0:0:0" -^ZZCOVERAGE("XINDX4","LO",3)="259:0:0:0" -^ZZCOVERAGE("XINDX4","LO",4)="259:0:4000:4000" -^ZZCOVERAGE("XINDX4","LO",4,"FOR_LOOP",1)=260 -^ZZCOVERAGE("XINDX4","LO",5)="260:0:0:0" -^ZZCOVERAGE("XINDX4","LO",6)="260:0:0:0" -^ZZCOVERAGE("XINDX4","LO",7)="260:0:0:0" -^ZZCOVERAGE("XINDX4","LO",8)="89:0:0:0" -^ZZCOVERAGE("XINDX4","LO",9)="89:0:0:0" -^ZZCOVERAGE("XINDX4","LO",10)="89:4001:0:4001" -^ZZCOVERAGE("XINDX4","LO",12)="259:0:0:0" -^ZZCOVERAGE("XINDX4","LO",13)="259:0:0:0" -^ZZCOVERAGE("XINDX4","LOOP")="14735:44003:108008:152011" -^ZZCOVERAGE("XINDX4","LOOP",0)="14735:28002:72005:100007" -^ZZCOVERAGE("XINDX4","LOOP",0,"FOR_LOOP",1)=68121 -^ZZCOVERAGE("XINDX4","LOOP",1)="14735:4000:32003:36003" -^ZZCOVERAGE("XINDX4","PAREN")="2638:24000:36004:60004" -^ZZCOVERAGE("XINDX4","PAREN",0)="2638:4000:8000:12000" -^ZZCOVERAGE("XINDX4","PAREN",1)="2638:20000:16001:36001" -^ZZCOVERAGE("XINDX4","PAREN",1,"FOR_LOOP",1)=50171 -^ZZCOVERAGE("XINDX4","PAREN",2)="2638:0:8002:8002" -^ZZCOVERAGE("XINDX4","PAREN",3)="2638:0:0:0" -^ZZCOVERAGE("XINDX4","PRUNE")="2186:8001:16001:24002" -^ZZCOVERAGE("XINDX4","PRUNE",0)="2186:8001:4000:12001" -^ZZCOVERAGE("XINDX4","PRUNE",1)="2186:0:8001:8001" -^ZZCOVERAGE("XINDX4","PRUNE",1,"FOR_LOOP",1)=2186 -^ZZCOVERAGE("XINDX4","PRUNE",2)="2186:0:4000:4000" -^ZZCOVERAGE("XINDX4","PRUNE",2,"FOR_LOOP",1)=2187 -^ZZCOVERAGE("XINDX4","PRUNE",3)="2186:0:0:0" -^ZZCOVERAGE("XINDX4","Q",1)="747:8000:0:8000" -^ZZCOVERAGE("XINDX4","Q",2)="747:0:0:0" -^ZZCOVERAGE("XINDX4","QUOTE")="2402:28002:28000:56002" -^ZZCOVERAGE("XINDX4","QUOTE",0)="2402:20002:20000:40002" -^ZZCOVERAGE("XINDX4","QUOTE",0,"FOR_LOOP",1)=23674 -^ZZCOVERAGE("XINDX4","QUOTE",1)="2402:0:0:0" -^ZZCOVERAGE("XINDX4","QUOTE",2)="2402:8000:4000:12000" -^ZZCOVERAGE("XINDX4","ST")="8937:24000:16002:40002" -^ZZCOVERAGE("XINDX4","ST",0)="8937:12000:8000:20000" -^ZZCOVERAGE("XINDX4","ST",1)="8937:8000:8002:16002" -^ZZCOVERAGE("XINDX4","WR",0)="4584:12001:12000:24001" -^ZZCOVERAGE("XINDX4","WR",1)="4584:0:8000:8000" -^ZZCOVERAGE("XINDX4","WR",2)="4584:72004:56006:128010" -^ZZCOVERAGE("XINDX4","WR",2,"FOR_LOOP",1)=27607 -^ZZCOVERAGE("XINDX4","WR",3)="23023:8002:32003:40005" -^ZZCOVERAGE("XINDX4","WR",4)="20835:12000:32001:44001" -^ZZCOVERAGE("XINDX4","WR",5)="20835:24002:8001:32003" -^ZZCOVERAGE("XINDX4","WR",6)="20835:24000:36002:60002" -^ZZCOVERAGE("XINDX4","WR",7)="20835:0:0:0" -^ZZCOVERAGE("XINDX4","WR",8)="4584:4000:0:4000" -^ZZCOVERAGE("XINDX4","XE",0)="220:0:0:0" -^ZZCOVERAGE("XINDX4","XE",1)="220:0:0:0" -^ZZCOVERAGE("XINDX5","A",0)="468:0:4000:4000" -^ZZCOVERAGE("XINDX5","A",1)="467:28002:24000:52002" -^ZZCOVERAGE("XINDX5","A",1,"FOR_LOOP",1)=4011 -^ZZCOVERAGE("XINDX5","A",2)="467:0:0:0" -^ZZCOVERAGE("XINDX5","AA")="3544:48004:68006:116010" -^ZZCOVERAGE("XINDX5","AA",0)="3544:8002:16003:24005" -^ZZCOVERAGE("XINDX5","AA",1)="1902:0:4000:4000" -^ZZCOVERAGE("XINDX5","AA",2)="1902:4001:0:4001" -^ZZCOVERAGE("XINDX5","AA",3)="1902:12001:4001:16002" -^ZZCOVERAGE("XINDX5","AA",4)="1902:12000:32002:44002" -^ZZCOVERAGE("XINDX5","AA",5)="1902:0:0:0" -^ZZCOVERAGE("XINDX5","AA",6)="1209:0:0:0" -^ZZCOVERAGE("XINDX5","AA",7)="1209:8000:4000:12000" -^ZZCOVERAGE("XINDX5","AA",8)="1209:0:0:0" -^ZZCOVERAGE("XINDX5","AA",9)="1642:0:4000:4000" -^ZZCOVERAGE("XINDX5","AA",10)="1594:0:0:0" -^ZZCOVERAGE("XINDX5","AA",11)="1594:4000:4000:8000" -^ZZCOVERAGE("XINDX5","AA",12)="1642:0:0:0" -^ZZCOVERAGE("XINDX5","B",0)="1:0:0:0" -^ZZCOVERAGE("XINDX5","CLEAN",1)="1:0:0:0" -^ZZCOVERAGE("XINDX5","CLEAN",2)="1:0:0:0" -^ZZCOVERAGE("XINDX5","CLEAN",3)="1:0:0:0" -^ZZCOVERAGE("XINDX5","END",0)="1:0:0:0" -^ZZCOVERAGE("XINDX5","END",1)="1:0:0:0" -^ZZCOVERAGE("XINDX5","END",2)="1:0:0:0" -^ZZCOVERAGE("XINDX5","END",3)="1:0:0:0" -^ZZCOVERAGE("XINDX5","VTAG")="4320:12000:16001:28001" -^ZZCOVERAGE("XINDX5","VTAG",0)="4320:12000:8001:20001" -^ZZCOVERAGE("XINDX5","VTAG",1)="4320:0:4000:4000" -^ZZCOVERAGE("XINDX5","XINDX5",3)="1:0:0:0" -^ZZCOVERAGE("XINDX5","XINDX5",4)="1:0:0:0" -^ZZCOVERAGE("XINDX5","XINDX5",5)="1:0:0:0" -^ZZCOVERAGE("XINDX5","XINDX5",7)="1:0:0:0" -^ZZCOVERAGE("XINDX51","B")="1:0:4001:4001" -^ZZCOVERAGE("XINDX51","B",0)="1:0:0:0" -^ZZCOVERAGE("XINDX51","B",1)="1:0:0:0" -^ZZCOVERAGE("XINDX51","B",3)="1:0:4001:4001" -^ZZCOVERAGE("XINDX51","B",3,"FOR_LOOP",1)=468 -^ZZCOVERAGE("XINDX51","B",4)="1:0:0:0" -^ZZCOVERAGE("XINDX51","B",6)="1:0:0:0" -^ZZCOVERAGE("XINDX51","BHDR")="60:0:4000:4000" -^ZZCOVERAGE("XINDX51","BHDR",0)="60:0:4000:4000" -^ZZCOVERAGE("XINDX51","BHDR",1)="60:0:0:0" -^ZZCOVERAGE("XINDX51","END",0)="1:0:0:0" -^ZZCOVERAGE("XINDX51","HD")="60:0:0:0" -^ZZCOVERAGE("XINDX51","HD",0)="60:0:0:0" -^ZZCOVERAGE("XINDX51","HD",1)="60:0:0:0" -^ZZCOVERAGE("XINDX51","HD1")="1:0:0:0" -^ZZCOVERAGE("XINDX51","HD1",0)="1:0:0:0" -^ZZCOVERAGE("XINDX51","HD1",1)="1:0:0:0" -^ZZCOVERAGE("XINDX51","HD2")="60:4000:0:4000" -^ZZCOVERAGE("XINDX51","HD2",0)="60:4000:0:4000" -^ZZCOVERAGE("XINDX51","HD2",1)="60:0:0:0" -^ZZCOVERAGE("XINDX51","WAIT")="1:0:0:0" -^ZZCOVERAGE("XINDX51","WAIT",0)="1:0:0:0" -^ZZCOVERAGE("XINDX51","WAIT",1)="1:0:0:0" -^ZZCOVERAGE("XINDX51","WAIT",2)="1:0:0:0" -^ZZCOVERAGE("XINDX51","WERR")="60:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",0)="60:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",1)="60:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",2)="60:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",2,"FOR_LOOP",1)=135 -^ZZCOVERAGE("XINDX51","WERR",3)="75:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",4)="75:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",5)="75:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",6)="75:0:0:0" -^ZZCOVERAGE("XINDX51","WERR",7)="60:0:0:0" -^ZZCOVERAGE("XINDX51","WORL")="70:0:0:0" -^ZZCOVERAGE("XINDX51","WORL",0)="70:0:0:0" -^ZZCOVERAGE("XINDX51","WORL",1)="70:0:0:0" -^ZZCOVERAGE("XINDX51","WORL",2)="70:0:0:0" -^ZZCOVERAGE("XINDX51","WORL",3)="70:0:0:0" -^ZZCOVERAGE("XINDX51","WORL",3,"FOR_LOOP",1)=76 -^ZZCOVERAGE("XINDX51","WORL",4)="70:0:0:0" -^ZZCOVERAGE("XINDX52","CASE")="2:0:0:0" -^ZZCOVERAGE("XINDX52","CASE",0)="2:0:0:0" -^ZZCOVERAGE("XINDX52","CASE",1)="2:0:0:0" -^ZZCOVERAGE("XINDX6","ANS")="2:0:0:0" -^ZZCOVERAGE("XINDX6","ANS",0)="2:0:0:0" -^ZZCOVERAGE("XINDX6","ANS",1)="2:0:0:0" -^ZZCOVERAGE("XINDX6","ANS",1,"FOR_LOOP",1)=2 -^ZZCOVERAGE("XINDX6","ANS",2)="2:0:0:0" -^ZZCOVERAGE("XINDX6","ASKRTN")="1:4000:0:4000" -^ZZCOVERAGE("XINDX6","ASKRTN",1)="1:0:0:0" -^ZZCOVERAGE("XINDX6","ASKRTN",1,"FOR_LOOP",1)=468 -^ZZCOVERAGE("XINDX6","ASKRTN",2)="1:4000:0:4000" -^ZZCOVERAGE("XINDX6","ASKRTN",2,"FOR_LOOP",1)=468 -^ZZCOVERAGE("XINDX6","ASKRTN",3)="1:0:0:0" -^ZZCOVERAGE("XINDX6","DEVICE",0)="1:0:0:0" -^ZZCOVERAGE("XINDX6","DEVICE",2)="1:0:0:0" -^ZZCOVERAGE("XINDX6","DEVICE",3)="1:0:0:0" -^ZZCOVERAGE("XINDX6","L7",0)="1:0:0:0" -^ZZCOVERAGE("XINDX6","L7",1)="1:0:0:0" -^ZZCOVERAGE("XINDX6","NY")="1:0:0:0" -^ZZCOVERAGE("XINDX6","NY",0)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM")="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",1)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",2)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",2,"FOR_LOOP",1)=10 -^ZZCOVERAGE("XINDX6","PARAM",3)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",4)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",5)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",6)="1:0:0:0" -^ZZCOVERAGE("XINDX6","PARAM",7)="1:0:0:0" -^ZZCOVERAGE("XINDX6","RD")="2:0:0:0" -^ZZCOVERAGE("XINDX6","RD",0)="2:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",5)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",6)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",7)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",8)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",9)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",10)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",11)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",12)="1:0:0:0" -^ZZCOVERAGE("XINDX6","XINDX6",13)="1:0:0:0" -^ZZCOVERAGE("XINDX6","YN")="1:0:0:0" -^ZZCOVERAGE("XINDX6","YN",0)="1:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD")="1:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",0)="1:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",1)="1:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",1,"FOR_LOOP",1)=10 -^ZZCOVERAGE("XINDX7","BUILD",2)="9:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",3)="6:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",3,"FOR_LOOP",1)=85 -^ZZCOVERAGE("XINDX7","BUILD",4)="79:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",5)="79:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",6)="6:0:0:0" -^ZZCOVERAGE("XINDX7","BUILD",7)="1:0:0:0" -^ZZCOVERAGE("XINDX7","HDR")="2:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",0)="2:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",1)="2:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",2)="1:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",3)="1:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",4)="1:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",5)="1:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",6)="2:0:0:0" -^ZZCOVERAGE("XINDX7","HDR",7)="2:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP")="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",1)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",2)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",3)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",4)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",6)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",7)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",7,"FOR_LOOP",1)=468 -^ZZCOVERAGE("XINDX7","SETUP",8)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",9)="1:0:0:0" -^ZZCOVERAGE("XINDX7","SETUP",10)="1:0:0:0" -^ZZCOVERAGE("XINDX9","ADD")="406841:436032:684041:1120073" -^ZZCOVERAGE("XINDX9","ADD",0)="598820:552042:692040:1244082" -^ZZCOVERAGE("XINDX9","AR")="197699:748039:1052073:1800112" -^ZZCOVERAGE("XINDX9","AR",0)="197699:708036:936061:1644097" -^ZZCOVERAGE("XINDX9","CASE")="23461:28003:92005:120008" -^ZZCOVERAGE("XINDX9","CASE",0)="23461:12002:48003:60005" -^ZZCOVERAGE("XINDX9","CASE",1)="23461:12001:28000:40001" -^ZZCOVERAGE("XINDX9","DN")="45002:204010:248016:452026" -^ZZCOVERAGE("XINDX9","DN",0)="45002:176008:196011:372019" -^ZZCOVERAGE("XINDX9","DN",1)="45002:16001:24003:40004" -^ZZCOVERAGE("XINDX9","EXT",1)="1970:4000:12001:16001" -^ZZCOVERAGE("XINDX9","FNC")="29146:96005:104009:200014" -^ZZCOVERAGE("XINDX9","FNC",0)="29146:28001:20003:48004" -^ZZCOVERAGE("XINDX9","FNC",1)="29146:44002:72005:116007" -^ZZCOVERAGE("XINDX9","FNC",2)="12:0:0:0" -^ZZCOVERAGE("XINDX9","FNC",3)="12:0:0:0" -^ZZCOVERAGE("XINDX9","FUNC")="29134:284015:400024:684039" -^ZZCOVERAGE("XINDX9","FUNC",1)="29134:112005:120007:232012" -^ZZCOVERAGE("XINDX9","FUNC",2)="23461:48003:72004:120007" -^ZZCOVERAGE("XINDX9","FUNC",3)="23461:20000:32001:52001" -^ZZCOVERAGE("XINDX9","FX",0)="23461:68004:116009:184013" -^ZZCOVERAGE("XINDX9","GVAR")="29134:96004:180015:276019" -^ZZCOVERAGE("XINDX9","GVAR",0)="29134:28000:44003:72003" -^ZZCOVERAGE("XINDX9","GVAR",1)="29134:32001:72005:104006" -^ZZCOVERAGE("XINDX9","GVAR",2)="29134:16000:24002:40002" -^ZZCOVERAGE("XINDX9","INC")="29134:64003:64007:128010" -^ZZCOVERAGE("XINDX9","INC",0)="29134:20001:12001:32002" -^ZZCOVERAGE("XINDX9","INC",1)="29134:32002:40004:72006" -^ZZCOVERAGE("XINDX9","NEW")="287703:532032:660032:1192064" -^ZZCOVERAGE("XINDX9","NEW",0)="287703:200012:244014:444026" -^ZZCOVERAGE("XINDX9","NEW",1)="287703:220014:248008:468022" -^ZZCOVERAGE("XINDX9","NUM")="45379:292023:340026:632049" -^ZZCOVERAGE("XINDX9","NUM",0)="45379:92006:84006:176012" -^ZZCOVERAGE("XINDX9","NUM",0,"FOR_LOOP",1)=71145 -^ZZCOVERAGE("XINDX9","NUM",1)="45379:40005:48002:88007" -^ZZCOVERAGE("XINDX9","NUM",2)="45379:40004:56005:96009" -^ZZCOVERAGE("XINDX9","NUM",3)="45379:76003:88008:164011" -^ZZCOVERAGE("XINDX9","NUM",4)="45379:24003:40003:64006" -^ZZCOVERAGE("XINDX9","PA2",0)="518346:544028:668032:1212060" -^ZZCOVERAGE("XINDX9","PA2",1)="472665:532043:620035:1152078" -^ZZCOVERAGE("XINDX9","PA2",2)="317803:264019:292021:556040" -^ZZCOVERAGE("XINDX9","PA2",3)="317803:200013:324018:524031" -^ZZCOVERAGE("XINDX9","PA2",4)="307072:348020:492025:840045" -^ZZCOVERAGE("XINDX9","PA2",5)="197397:160015:296011:456026" -^ZZCOVERAGE("XINDX9","PA2",6)="152018:120016:132005:252021" -^ZZCOVERAGE("XINDX9","PA2",7)="152018:116009:112008:228017" -^ZZCOVERAGE("XINDX9","PA2",8)="151813:96008:168010:264018" -^ZZCOVERAGE("XINDX9","PA2",9)="151813:100008:172009:272017" -^ZZCOVERAGE("XINDX9","PA2",10)="151813:220008:324022:544030" -^ZZCOVERAGE("XINDX9","PA2",11)="151813:168011:152010:320021" -^ZZCOVERAGE("XINDX9","PA2",12)="151813:128009:148012:276021" -^ZZCOVERAGE("XINDX9","PA2",13)="151813:136005:104009:240014" -^ZZCOVERAGE("XINDX9","PARSE")="45681:3356226:4340257:7696483" -^ZZCOVERAGE("XINDX9","PARSE",0)="45681:104007:108007:212014" -^ZZCOVERAGE("XINDX9","PAT")="205:0:0:0" -^ZZCOVERAGE("XINDX9","PAT",0)="205:0:0:0" -^ZZCOVERAGE("XINDX9","PAT",1)="205:0:0:0" -^ZZCOVERAGE("XINDX9","PAT",1,"FOR_LOOP",1)=1185 -^ZZCOVERAGE("XINDX9","PAT",2)="205:0:0:0" -^ZZCOVERAGE("XINDX9","PAT",3)="205:0:0:0" -^ZZCOVERAGE("XINDX9","PAT",4)="205:0:0:0" -^ZZCOVERAGE("XINDX9","PATC")="28:0:0:0" -^ZZCOVERAGE("XINDX9","PATC",0)="28:0:0:0" -^ZZCOVERAGE("XINDX9","PATQ")="99:0:8000:8000" -^ZZCOVERAGE("XINDX9","PATQ",0)="99:0:0:0" -^ZZCOVERAGE("XINDX9","PATQ",0,"FOR_LOOP",1)=247 -^ZZCOVERAGE("XINDX9","PATQ",1)="99:0:0:0" -^ZZCOVERAGE("XINDX9","PATQ",2)="99:0:8000:8000" -^ZZCOVERAGE("XINDX9","PATU")="15:0:0:0" -^ZZCOVERAGE("XINDX9","PATU",0)="15:0:0:0" -^ZZCOVERAGE("XINDX9","PEND",0)="45681:68001:140014:208015" -^ZZCOVERAGE("XINDX9","PEND",1)="45681:36004:52005:88009" -^ZZCOVERAGE("XINDX9","QUOTE")="35724:244013:304019:548032" -^ZZCOVERAGE("XINDX9","QUOTE",0)="36272:172010:140009:312019" -^ZZCOVERAGE("XINDX9","QUOTE",0,"FOR_LOOP",1)=323021 -^ZZCOVERAGE("XINDX9","QUOTE",1)="36272:28001:72004:100005" -^ZZCOVERAGE("XINDX9","QUOTE",2)="35724:28001:24003:52004" -^ZZCOVERAGE("XINDX9","QUOTE",3)="35724:16001:52002:68003" -^ZZCOVERAGE("XINDX9","SPV",0)="3703:4000:12000:16000" -^ZZCOVERAGE("XINDX9","SPV",1)="3703:8001:4000:12001" -^ZZCOVERAGE("XINDX9","SPV",2)="3703:8001:4000:12001" -^ZZCOVERAGE("XINDX9","SPV",3)="3703:4000:8001:12001" -^ZZCOVERAGE("XINDX9","STR")="287703:560037:724043:1284080" -^ZZCOVERAGE("XINDX9","STR",0)="287703:300018:312020:612038" -^ZZCOVERAGE("XINDX9","SUM")="213322:612034:916052:1528086" -^ZZCOVERAGE("XINDX9","SUM",0)="213322:160009:208011:368020" -^ZZCOVERAGE("XINDX9","SUM",1)="213322:212007:280018:492025" -^ZZCOVERAGE("XINDX9","SUM",2)="213322:136012:268012:404024" -^ZZCOVERAGE("XINDX9","UP")="45002:396026:440029:836055" -^ZZCOVERAGE("XINDX9","UP",0)="45002:24003:44001:68004" -^ZZCOVERAGE("XINDX9","UP",1)="45002:180008:192016:372024" -^ZZCOVERAGE("XINDX9","UP",2)="45002:136010:128005:264015" -^ZZCOVERAGE("XINDX9","UP",3)="45002:40003:52003:92006" -^ZZCOVERAGE("XINDX9","VAR")="138809:828044:1004072:1832116" -^ZZCOVERAGE("XINDX9","VAR",0)="138809:376018:336017:712035" -^ZZCOVERAGE("XINDX9","VAR",0,"FOR_LOOP",1)=462128 -^ZZCOVERAGE("XINDX9","VAR",1)="138809:292018:376034:668052" -^ZZCOVERAGE("XINDX9","VAR",2)="138809:116003:144008:260011" -^ZZCOVERAGE("XINDX9","XINDX9")="45681:296016:320021:616037" -^ZZCOVERAGE("XINDX9","XINDX9",3)="45681:52003:128006:180009" -^ZZCOVERAGE("XINDX9","XINDX9",4)="45681:164006:112008:276014" -^ZZCOVERAGE("XINDX9","XINDX9",4,"FOR_LOOP",1)=128269 -^ZZCOVERAGE("XINDX9","XINDX9",5)="45681:48004:52005:100009" -^ZZCOVERAGE("XLFDT","DT")="1:0:0:0" -^ZZCOVERAGE("XLFDT","DT",0)="1:0:0:0" -^ZZCOVERAGE("XLFDT","DT",1)="1:0:0:0" -^ZZCOVERAGE("XLFDT","HR")="3:0:0:0" -^ZZCOVERAGE("XLFDT","HR",0)="3:0:0:0" -^ZZCOVERAGE("XLFDT","HR",1)="3:0:0:0" -^ZZCOVERAGE("XLFDT","HTE")="1:0:0:0" -^ZZCOVERAGE("XLFDT","HTE",0)="1:0:0:0" -^ZZCOVERAGE("XLFDT","HTE",1)="1:0:0:0" -^ZZCOVERAGE("XLFDT","HTE",2)="1:0:0:0" -^ZZCOVERAGE("XLFDT","HTE",3)="1:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM")="2:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM",0)="2:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM",1)="2:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM",2)="2:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM",3)="2:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM",4)="2:0:0:0" -^ZZCOVERAGE("XLFDT","HTFM",5)="2:0:0:0" -^ZZCOVERAGE("XLFDT","T2",0)="1:0:0:0" -^ZZCOVERAGE("XLFDT","T2",1)="1:0:0:0" -^ZZCOVERAGE("XLFDT","YMD")="2:0:0:0" -^ZZCOVERAGE("XLFDT","YMD",1)="2:0:0:0" -^ZZCOVERAGE("XLFDT","YMD",2)="2:0:0:0" -^ZZCOVERAGE("XLFDT","YMD",3)="2:0:0:0" -^ZZCOVERAGE("XLFDT","YMD",4)="2:0:0:0" -^ZZCOVERAGE("XLFDT","YMD",5)="2:0:0:0" -^ZZCOVERAGE("XLFDT1","F1",1)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","FMT")="1:0:0:0" -^ZZCOVERAGE("XLFDT1","FMT",1)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","FMT",2)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","M")="1:0:0:0" -^ZZCOVERAGE("XLFDT1","M",0)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","TM",1)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","TM",2)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","TM",3)="1:0:0:0" -^ZZCOVERAGE("XLFDT1","TM",7)="1:0:0:0" -^ZZCOVERAGE("XPDRSUM","SUMB")="467:1808124:180014:1988138" -^ZZCOVERAGE("XPDRSUM","SUMB",0)="467:8000:0:8000" -^ZZCOVERAGE("XPDRSUM","SUMB",2)="467:0:0:0" -^ZZCOVERAGE("XPDRSUM","SUMB",3)="467:1796124:180014:1976138" -^ZZCOVERAGE("XPDRSUM","SUMB",3,"FOR_LOOP",1)=44620 -^ZZCOVERAGE("XPDRSUM","SUMB",3,"FOR_LOOP",2)=1566704 -^ZZCOVERAGE("XPDRSUM","SUMB",4)="467:0:0:0" -^ZZCOVERAGE("XTRUTL1","BUILD")="1:0:0:0" -^ZZCOVERAGE("XTRUTL1","BUILD",0)="1:0:0:0" -^ZZCOVERAGE("XTRUTL1","BUILD",1)="1:0:0:0" -^ZZCOVERAGE("XTRUTL1","BUILD",2)="1:0:0:0" -^ZZCOVERAGE("XTRUTL1","BUILD",3)="1:0:0:0" - - diff --git a/Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m b/Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m deleted file mode 100644 index b045221..0000000 --- a/Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m +++ /dev/null @@ -1,144 +0,0 @@ -XINDEX ;ISC/REL,GFT,GRK,RWF - INDEX & CROSS-REFERENCE ;08/04/08 13:19 - ;;7.3;TOOLKIT;**20,27,48,61,66,68,110,121,128**;Apr 25, 1995;Build 1 - ; Per VHA Directive 2004-038, this routine should not be modified. - G ^XINDX6 -SEP F I=1:1 S CH=$E(LIN,I) D QUOTE:CH=Q Q:" "[CH - S ARG=$E(LIN,1,I-1) S:CH=" " I=I+1 S LIN=$E(LIN,I,999) Q -QUOTE F I=I+1:1 S CH=$E(LIN,I) Q:CH=""!(CH=Q) - Q:CH]"" S ERR=6 G ^XINDX1 -ALIVE ;enter here from taskman - D SETUP^XINDX7 ;Get ready to process -A2 S RTN=$O(^UTILITY($J,RTN)) G ^XINDX5:RTN="" - S INDLC=(RTN?1"|"1.4L.NP) D LOAD:'INDLC - I $D(ZTQUEUED),$$S^%ZTLOAD S RTN="~",IND("QUIT")=1,ZTSTOP=1 G A2 - I 'INDDS,INDLC W !!?10,"Data Dictionaries",! S INDDS=1 - D BEG - G A2 - ; -LOAD S X=RTN,XCNP=0,DIF="^UTILITY("_$J_",1,RTN,0," X ^%ZOSF("TEST") Q:'$T X ^%ZOSF("LOAD") S ^UTILITY($J,1,RTN,0,0)=XCNP-1 - I $D(^UTILITY($J,1,RTN,0,0)) S ^UTILITY($J,1,RTN,"RSUM")="B"_$$SUMB^XPDRSUM($NA(^UTILITY($J,1,RTN,0))) - Q -BEG ; - S %=INDLC*5 W:$X+10+%>IOM ! W RTN,$J("",10+%-$L(RTN)) - S (IND("DO"),IND("SZT"),IND("SZC"),LABO)=0,LC=$G(^UTILITY($J,1,RTN,0,0)) - I LC="" W !,">>>Routine '",RTN,"' not found <<<",! Q - S TXT="",LAB=$P(^UTILITY($J,1,RTN,0,1,0)," ") I RTN'=$P(LAB,"(") D E^XINDX1(17) - I 'INDLC,LAB["(" D E^XINDX1(55) S LAB=$P(LAB,"(") - ;if M routine(not compiled template or DD) and has more than 2 lines, check lines 1 & 2 - I 'INDLC,LC>2 D - . N LABO S LABO=1 - . S LIN=$G(^UTILITY($J,1,RTN,0,1,0)),TXT=1 - . ;check 1st line (site/dev - ) patch 128 - . I $P(LIN,";",2,4)'?.E1"/".E.1"-".E D E^XINDX1(62) - . S LIN=$G(^UTILITY($J,1,RTN,0,2,0)),TXT=2 - . ;check 2nd line (;;nn.nn[TV]nn;package;.anything) - . I $P(LIN,";",3,99)'?1.2N1"."1.2N.1(1"T",1"V").2N1";"1A.AP1";".E D E^XINDX1(44) ;patch 121 - . I $L(INP(11)) X INP(11) ;Version number check - . I $L(INP(12)) X INP(12) ;Patch number check -B5 F TXT=1:1:LC S LIN=^UTILITY($J,1,RTN,0,TXT,0),LN=$L(LIN),IND("SZT")=IND("SZT")+LN+2 D LN,ST ;Process Line - S LAB="",LABO=0,TXT=0,^UTILITY($J,1,RTN,0)=IND("SZT")_"^"_LC_"^"_IND("SZC") - I IND("SZT")>INP("MAX"),'INDLC S ERR=35,ERR(1)=IND("SZT") D ^XINDX1 - I IND("SZT")-IND("SZC")>INP("CMAX"),'INDLC S ERR=58,ERR(1)=IND("SZT")-IND("SZC") D ^XINDX1 - D POSTRTN - Q - ;Proccess one line, LN = Length, LIN = Line. -LN K V S (ARG,GRB,IND("COM"),IND("DOL"),IND("F"))="",X=$P(LIN," ") - I '$L(X) S LABO=LABO+1 G CD - S (IND("COM"),LAB)=$P(X,"("),ARG=$P($P(X,"(",2),")"),LABO=0,IND("PP")=X?1.8E1"(".E1")" - D:$L(ARG) NE^XINDX3 ;Process formal parameters as New list. - I 'INDLC,'$$VT^XINDX2(LAB) D E^XINDX1($S(LAB=$$CASE^XINDX52(LAB):37,1:55)) ;Check for bad labels - I $D(^UTILITY($J,1,RTN,"T",LAB)) D E^XINDX1(15) G CD ;DUP label - S ^UTILITY($J,1,RTN,"T",LAB)="" -CD I LN>245 D:'(LN=246&($E(RTN,1,3)="|dd")) E^XINDX1(19) ;patch 119 - D:LIN'?1.ANP E^XINDX1(18) - S LIN=$P(LIN," ",2,999),IND("LCC")=1 - I LIN="" D E^XINDX1(42) Q ;Blank line ;p110 - S I=0 ;Watch the scope of I, counts dots - I " ."[$E(LIN) D S X=$L($E(LIN,1,I),".")-1,LIN=$E(LIN,I,999) - . F I=1:1:245 Q:". "'[$E(LIN,I) - . Q - ;check dots against Do level IND("DO"), IND("DOL")=dot level - D:'I&$G(IND("DO1")) E^XINDX1(51) S IND("DO1")=0 S:'I IND("DO")=0 - I I D:X>IND("DO") E^XINDX1(51) S (IND("DO"),IND("DOL"))=X - ;Count Comment lines, skip ;; lines - I $E(LIN)=";",$E(LIN,2)'=";" S IND("SZC")=IND("SZC")+$L(LIN) ;p110 - ;Process commands on line. -EE I LIN="" D ^XINDX2 Q - S COM=$E(LIN),GK="",ARG="" - I COM=";" S LIN="" G EE ;p110 - I COM=" " S ERR=$S(LIN?1." ":13,1:0),LIN=$S(ERR:"",1:$E(LIN,2,999)) D:ERR ^XINDX1 G EE - D SEP - S CM=$P(ARG,":",1),POST=$P(ARG,":",2,999),IND("COM")=IND("COM")_$C(9)_COM,ERR=48 - D:ARG[":"&(POST']"") ^XINDX1 S:POST]"" GRB=GRB_$C(9)_POST,IND("COM")=IND("COM")_":" - ;SAC now allows lowercase commands - I CM?.E1L.E S CM=$$CASE^XINDX52(CM),COM=$E(CM) ;I IND("LCC") S IND("LCC")=0 D E^XINDX1(47) - I CM="" D E^XINDX1(21) G EE ;Missing command - S CX=$G(IND("CMD",CM)) I CX="" D G:CX="" EE - . I $E(CM)="Z" S CX="^Z" Q ;Proccess Z commands - . D E^XINDX1(1) S LIN="" Q - S CX=$P(CX,"^",2,9) - D SEP I '$L(LIN),CH=" " D E^XINDX1(13) ;trailing space - I ARG="","CGJMORSUWX"[COM S ERR=49 G ^XINDX1 - I CX>0 D E^XINDX1(CX) S CX="" - D:$L(CX) @CX S:ARG'="" GRB=GRB_$C(9)_ARG G EE -B S ERR=25 G ^XINDX1 -C S ERR=29 G ^XINDX1 -D G DG1^XINDX4 -E Q:ARG="" S ERR=7 G ^XINDX1 -F G:ARG]"" FR^XINDX4 S IND("F")=1 Q -G G DG^XINDX4 -H Q:ARG'="" S ERR=32 G ^XINDX1 -J S ERR=36,ARG="" G ^XINDX1 -K S ERR=$S(ARG?1"(".E:22,ARG?." ":23,1:0) D:ERR ^XINDX1 - G KL^XINDX3 -L G LO^XINDX4 -M G S^XINDX3 -N G NE^XINDX3 -O S ERR=34 D ^XINDX1,O^XINDX3 Q -Q Q:ARG="" G Q^XINDX4 -R S RDTIME=0 G RD^XINDX3 -S G S^XINDX3 -TR Q ;What to process. p110 -U S ARG=$P(ARG,":") Q -V S ARG="",ERR=20 G ^XINDX1 -W G WR^XINDX4 -X G XE^XINDX4 -Z S ERR=2 D ^XINDX1 G ZC^XINDX4 - ; - ;Save off items from line. -ST S R=LAB_$S(LABO:"+"_LABO,1:"") - ;Local variable, Global, Marked Items, Naked global, Internal ref, eXternal ref., Tag ref. - S LOC="" F S LOC=$O(V(LOC)),S="" Q:LOC="" F S S=$O(V(LOC,S)) Q:S="" D SET - S ^UTILITY($J,1,RTN,"COM",TXT)=IND("COM") - Q - ; -SET I V(LOC,S)]"" F %="!","~" I V(LOC,S)[%,$G(^UTILITY($J,1,RTN,LOC,S))'[% S ^(S)=$G(^(S))_% - S %=0 -SE2 S ARG=$G(^UTILITY($J,1,RTN,LOC,S,%)) I $L(ARG)>230 S %=%+1 G SE2 - S ^UTILITY($J,1,RTN,LOC,S,%)=ARG_R_V(LOC,S)_"," - Q - ; -POSTRTN ;Do more overall checking - N V,E,T,T1,T2 - S T="" ;Check for missing Labels - F S T=$O(^UTILITY($J,1,RTN,"I",T)),T2=T Q:T="" S T1=$G(^(T,0)) D - . Q:$E(T2,1,2)="@(" - . S:$E(T2,1,2)="$$" T2=$E(T2,3,99) - . I T2]"",'$D(^UTILITY($J,1,RTN,"T",$P(T2,"+",1))) D - . . F I=1:1:$L(T1,",")-1 S LAB=$P(T1,",",I),LABO=+$P(LAB,"+",2),LAB=$P(LAB,"+"),E=14,E(1)=T D E^XINDX1(.E) - . . Q - . Q - S LAB="",LABO=0 ;Check for valid label names - I 'INDLC F S LAB=$O(^UTILITY($J,1,RTN,"T",LAB)) Q:LAB="" D - . I '$$VA^XINDX2(LAB) D E^XINDX1(55) Q - . D:'$$VT^XINDX2(LAB) E^XINDX1(37) - . Q - S LAB="",LABO=0 ;Check for valid variable names. - F S LAB=$O(^UTILITY($J,1,RTN,"L",LAB)) Q:LAB="" D - . D VLNF^XINDX3($P(LAB,"(")) - . Q - Q - ; -QUICK ;Quick, Just get a routine an print the results - D QUICK^XINDX6() - Q diff --git a/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m b/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m new file mode 100644 index 0000000..ee70682 --- /dev/null +++ b/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m @@ -0,0 +1,43 @@ +ZZCOVTST;OSEHRA/JPS -- Test routine for Coverage Parsing;4/28/2014 + ; (tab) This is series of comments + ; (tab) it should all be not executable + ; (spaces) one of these sets might be a problem + ; (spaces) we will have to see. +EN ; This entry point shouldn't be found without fixing + N D + S D=1 ;An executable line + D T1^ZZCOVTST + I '$$T5 W "RETURNED FROM t5",! + Q + ; This line not executable + D T6^ZZCOVTST + ; +T1 ; This line should always be found + N D + S D=2 + W !,D,!,"This is the second entry point",! + D T2^ZZCOVTST(D) + Q + ; +T2(EQ) ; This is debatable and only called with ENT^ROU notation + N D + S D=3 + W !,D,!,EQ,"This is the third entry point",! + D T3^ZZCOVTST + Q + ; +T3 N D S D=4 W D,!,"Fourth Entry point",! Q + ; +T4 N D S D=5 W "Shouldn't be executed" + W "Lots to not do" + Q +T5(EQ) ;this entry point is called with a $$ notation + W "THIS IS THE $$ NOTATION!",! + Q 0 +T6 ; An entry point to show comments inside of "DO" blocks + D + . W "This is executable code",! + . ;This is a comment inside the do block, not executable + . S ZZBLAH="blah" + W "Ending T6",! + ; diff --git a/Tests/MumpsCoverage/ZZCOVTST.cmcov b/Tests/MumpsCoverage/ZZCOVTST.cmcov new file mode 100644 index 0000000..7a5df61 --- /dev/null +++ b/Tests/MumpsCoverage/ZZCOVTST.cmcov @@ -0,0 +1,45 @@ +Routine,Line,RtnLine,Code
+ZZCOVTST,1,1,"ZZCOVTST;OSEHRA/JPS -- Test routine for Coverage Parsing;4/28/2014"
+,2,0," ; (tab) This is series of comments"
+,3,0," ; (tab) it should all be not executable"
+,4,0," ; (spaces) one of these sets might be a problem"
+,5,0," ; (spaces) we will have to see."
+,6,0,"EN ; This entry point shouldn't be found without fixing"
+,7,1," N D"
+,8,1," S D=1 ;An executable line"
+,9,1," D T1^ZZCOVTST"
+,10,1," I '$$T5 W ""RETURNED FROM t5"",!"
+,11,1," D T6^ZZCOVTST"
+,12,1," Q"
+,13,0," ; This line not executable"
+,14,0," ;"
+,15,0,"T1 ; This line should always be found"
+,16,1," N D"
+,17,1," S D=2"
+,18,1," W !,D,!,""This is the second entry point"",!"
+,19,1," D T2^ZZCOVTST(D)"
+,20,1," Q"
+,21,0," ;"
+,22,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation"
+,23,1," N D"
+,24,1," S D=3"
+,25,1," W !,D,!,EQ,""This is the third entry point"",!"
+,26,1," D T3^ZZCOVTST"
+,27,1," Q"
+,28,0," ;"
+,29,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q"
+,30,0," ;"
+,31,0,"T4 N D S D=5 W ""Shouldn't be executed"""
+,32,0," W ""Lots to not do"""
+,33,0," Q"
+,34,1,"T5(EQ) ;this entry point is called with a $$ notation"
+,35,1," W ""THIS IS THE $$ NOTATION!"",!"
+,36,1," Q 0"
+,37,0,"T6 ; An entry point to show comments inside of ""DO"" blocks"
+,38,1," D"
+,39,1," . W ""This is executable code"",!"
+,40,0," . ; This is a comment inside the do block, not executable"
+,41,1," . S ZZBLAH=""blah"""
+,42,1," W ""Ending T6"",!"
+,43,0," ;"
+Totals for ZZCOVTST,,25,
\ No newline at end of file diff --git a/Tests/MumpsCoverage/ZZCOVTST.mcov b/Tests/MumpsCoverage/ZZCOVTST.mcov new file mode 100644 index 0000000..b2608d9 --- /dev/null +++ b/Tests/MumpsCoverage/ZZCOVTST.mcov @@ -0,0 +1,38 @@ +%GO Global Output Utility +GT.M 15-AUG-2014 10:14:32 ZWR +^ZZCOVERAGE("*CHILDREN")="212000:68000:280000" +^ZZCOVERAGE("*RUN")="56000:136000:192000" +^ZZCOVERAGE("ZZCOVTST","EN")="1:4000:4000:8000:8627798" +^ZZCOVERAGE("ZZCOVTST","EN",1)="1:0:0:0:27" +^ZZCOVERAGE("ZZCOVTST","EN",2)="1:0:0:0:23" +^ZZCOVERAGE("ZZCOVTST","EN",3)="1:0:0:0:70" +^ZZCOVERAGE("ZZCOVTST","EN",4)="1:0:0:0:74" +^ZZCOVERAGE("ZZCOVTST","EN",5)="1:0:0:0:66" +^ZZCOVERAGE("ZZCOVTST","EN",6)="1:0:0:0:40" +^ZZCOVERAGE("ZZCOVTST","T1")="1:0:0:0:208" +^ZZCOVERAGE("ZZCOVTST","T1",1)="1:0:0:0:23" +^ZZCOVERAGE("ZZCOVTST","T1",2)="1:0:0:0:24" +^ZZCOVERAGE("ZZCOVTST","T1",3)="1:0:0:0:26" +^ZZCOVERAGE("ZZCOVTST","T1",4)="1:0:0:0:73" +^ZZCOVERAGE("ZZCOVTST","T1",5)="1:0:0:0:40" +^ZZCOVERAGE("ZZCOVTST","T2")="1:0:0:0:1783" +^ZZCOVERAGE("ZZCOVTST","T2",0)="1:0:0:0:25" +^ZZCOVERAGE("ZZCOVTST","T2",1)="1:0:0:0:524" +^ZZCOVERAGE("ZZCOVTST","T2",2)="1:0:0:0:40" +^ZZCOVERAGE("ZZCOVTST","T2",3)="1:0:0:0:95" +^ZZCOVERAGE("ZZCOVTST","T2",4)="1:0:0:0:607" +^ZZCOVERAGE("ZZCOVTST","T2",5)="1:0:0:0:470" +^ZZCOVERAGE("ZZCOVTST","T3")="1:0:0:0:254" +^ZZCOVERAGE("ZZCOVTST","T3",0)="1:0:0:0:76" +^ZZCOVERAGE("ZZCOVTST","T5")="1:0:0:0:153" +^ZZCOVERAGE("ZZCOVTST","T5",0)="1:0:0:0:40" +^ZZCOVERAGE("ZZCOVTST","T5",1)="1:0:0:0:41" +^ZZCOVERAGE("ZZCOVTST","T5",2)="1:0:0:0:41" +^ZZCOVERAGE("ZZCOVTST","T6")="1:0:0:0:227" +^ZZCOVERAGE("ZZCOVTST","T6",1)="1:0:0:0:41" +^ZZCOVERAGE("ZZCOVTST","T6",2)="1:0:0:0:42" +^ZZCOVERAGE("ZZCOVTST","T6",4)="1:0:0:0:41" +^ZZCOVERAGE("ZZCOVTST","T6",5)="1:0:0:0:34" +^ZZCOVERAGE("ZZCOVTST","T6",6)="1:0:0:0:38" + + diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt index 55778ea..c24c5ed 100644 --- a/Tests/ObjectLibrary/A/CMakeLists.txt +++ b/Tests/ObjectLibrary/A/CMakeLists.txt @@ -1,18 +1,26 @@ project(ObjectLibraryA C) # Add -fPIC so objects can be used in shared libraries. -# TODO: Need property for this. -if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM) - set(CMAKE_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${CMAKE_C_FLAGS}") -endif() +set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_definitions(-DA_DEF) add_custom_command( OUTPUT a1.c - DEPENDS a1.c.in + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/a1.c.in COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/a1.c.in ${CMAKE_CURRENT_BINARY_DIR}/a1.c ) -add_library(A OBJECT a1.c a2.c) +# Remove the custom command output to be sure it runs in an +# incremental test. Skip this on VS 6 because it sometimes +# re-runs CMake after the custom command runs. +if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6") + file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/a.cmake) +endif() +add_custom_command( + OUTPUT a.cmake + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/a.cmake + ) + +add_library(A OBJECT a1.c a2.c a.cmake) target_include_directories(A PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/ObjectLibrary/B/CMakeLists.txt b/Tests/ObjectLibrary/B/CMakeLists.txt index a567f96..2158084 100644 --- a/Tests/ObjectLibrary/B/CMakeLists.txt +++ b/Tests/ObjectLibrary/B/CMakeLists.txt @@ -5,10 +5,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") endif() # Add -fPIC so objects can be used in shared libraries. -# TODO: Need property for this. -if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM) - set(CMAKE_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${CMAKE_C_FLAGS}") -endif() +set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_library(B OBJECT b1.c b2.c) target_include_directories(B PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt index 0aeefaa..e9f553e 100644 --- a/Tests/ObjectLibrary/CMakeLists.txt +++ b/Tests/ObjectLibrary/CMakeLists.txt @@ -12,6 +12,7 @@ add_library(Cshared SHARED c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:Bexport>) add_executable(UseCshared main.c) set_property(TARGET UseCshared PROPERTY COMPILE_DEFINITIONS SHARED_C) target_link_libraries(UseCshared Cshared) +add_custom_command(TARGET UseCshared POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/A/a.cmake) add_executable(UseCinternal main.c c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>) @@ -59,4 +60,10 @@ add_executable(UseABinternal ${dummy} $<TARGET_OBJECTS:ABmain> $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B> ) +# Test target-level dependencies of executable without sources. +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/UseABinternalDep.cmake) +add_custom_target(UseABinternalDep COMMAND ${CMAKE_COMMAND} -E touch UseABinternalDep.cmake) +add_custom_command(TARGET UseABinternal POST_BUILD COMMAND ${CMAKE_COMMAND} -P UseABinternalDep.cmake) +add_dependencies(UseABinternal UseABinternalDep) + add_subdirectory(ExportLanguages) diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index 28e46b1..90af600 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -6,6 +6,13 @@ if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel") endif() +# Intel 11.1 does not support /Fd but Intel 14.0 does. +# TODO: Did a version in between these add it? +if(CMAKE_C_COMPILER_ID STREQUAL Intel AND + CMAKE_C_COMPILER_VERSION VERSION_LESS 14.0) + set(NO_COMPILE_PDB 1) +endif() + set(my_targets "") add_library(mylibA SHARED mylibA.c) @@ -17,12 +24,12 @@ list(APPEND my_targets mylibA) add_library(mylibB STATIC mylibB.c) set_target_properties(mylibB PROPERTIES - PDB_NAME "mylibB_Special" - PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB" + COMPILE_PDB_NAME "mylibB_Special" + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB" ) -# TODO: The only .pdb available for a static library is that generated -# by the compiler /Fd option which is not the same as the linker /pdb. -# list(APPEND my_targets mylibB) +if(NOT NO_COMPILE_PDB) + list(APPEND my_targets mylibB) +endif() add_library(mylibC SHARED mylibC.c) set_target_properties(mylibC PROPERTIES @@ -32,10 +39,11 @@ list(APPEND my_targets mylibC) add_library(mylibD STATIC mylibD.c) set_target_properties(mylibD PROPERTIES - PDB_NAME "mylibD_Special" + COMPILE_PDB_NAME "mylibD_Special" ) -# TODO: See comment for mylibB. -# list(APPEND my_targets mylibD) +if(NOT NO_COMPILE_PDB) + list(APPEND my_targets mylibD) +endif() add_executable(myexe myexe.c) set_target_properties(myexe PROPERTIES @@ -66,6 +74,12 @@ set(pdbs "") foreach(t ${my_targets}) get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME) get_property(pdb_dir TARGET ${t} PROPERTY PDB_OUTPUT_DIRECTORY) + if(NOT pdb_name) + get_property(pdb_name TARGET ${t} PROPERTY COMPILE_PDB_NAME) + endif() + if(NOT pdb_dir) + get_property(pdb_dir TARGET ${t} PROPERTY COMPILE_PDB_OUTPUT_DIRECTORY) + endif() if(NOT pdb_dir) set(pdb_dir ${CMAKE_CURRENT_BINARY_DIR}) endif() diff --git a/Tests/PerConfig/perconfig.cmake b/Tests/PerConfig/perconfig.cmake index 6a710ca..5286307 100644 --- a/Tests/PerConfig/perconfig.cmake +++ b/Tests/PerConfig/perconfig.cmake @@ -29,8 +29,8 @@ endif() # Verify that the implementation files are named correctly. foreach(lib pcStatic pcShared) - file(STRINGS "${${lib}_file}" info LIMIT_COUNT 1 REGEX "INFO:[^[]*\\[") - if(NOT "${info}" MATCHES ".*INFO:symbol\\[${lib}\\].*") + file(STRINGS "${${lib}_file}" info LIMIT_COUNT 1 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") + if(NOT "${info}" MATCHES "INFO:symbol\\[${lib}\\]") message(SEND_ERROR "No INFO:symbol[${lib}] found in:\n ${${lib}_file}") endif() endforeach() diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index c6ed15d..ecdece8 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -24,6 +24,16 @@ include_directories( ${Plugin_SOURCE_DIR}/include ) +# We need proper C++98 support from the compiler +set(CMAKE_CXX_STANDARD 98) + +# Those versions of the HP compiler that need a flag to get proper C++98 +# template support also need a flag to use the newer C++ library. +if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () + # Create an executable that exports an API for use by plugins. add_executable(example_exe src/example_exe.cxx) set_target_properties(example_exe PROPERTIES diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index d44cb9c..cdfdcc1 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -34,15 +34,6 @@ endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") - set(PP_VS100 1) -endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") - set(PP_VS110 1) -endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 12") - set(PP_VS120 1) -endif() # Some tests below check the PP_* variables set above. They are meant # to test the case that the build tool is at fault. Other tests below diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt index 285d596..11fca45 100644 --- a/Tests/Properties/CMakeLists.txt +++ b/Tests/Properties/CMakeLists.txt @@ -143,3 +143,5 @@ set_property(CACHE SOME_ENTRY PROPERTY VALUE "${expect_VALUE}") set_property(CACHE SOME_ENTRY PROPERTY ADVANCED "${expect_ADVANCED}") set_property(CACHE SOME_ENTRY PROPERTY STRINGS "${expect_STRINGS}") check_cache_props() + +add_subdirectory(SubDir2) diff --git a/Tests/Properties/SubDir2/CMakeLists.txt b/Tests/Properties/SubDir2/CMakeLists.txt new file mode 100644 index 0000000..377dc83 --- /dev/null +++ b/Tests/Properties/SubDir2/CMakeLists.txt @@ -0,0 +1,5 @@ + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx" + PROPERTIES COMPILE_DEFINITIONS SUBDIR_TEST) + +add_executable(subdirtest "${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx") diff --git a/Tests/Properties/subdirtest.cxx b/Tests/Properties/subdirtest.cxx new file mode 100644 index 0000000..02d8f3d --- /dev/null +++ b/Tests/Properties/subdirtest.cxx @@ -0,0 +1,9 @@ + +#ifndef SUBDIR_TEST +#error Expected SUBDIR_TEST +#endif + +int main(int, char**) +{ + return 0; +} diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt index af9fc3f..ae0a02b 100644 --- a/Tests/Qt4Targets/CMakeLists.txt +++ b/Tests/Qt4Targets/CMakeLists.txt @@ -36,3 +36,45 @@ add_executable(Qt4WrapMacroTest WIN32 main_wrap_test.cpp ${moc_file}) set_property(TARGET Qt4WrapMacroTest PROPERTY AUTOMOC OFF) target_include_directories(Qt4WrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface") target_link_libraries(Qt4WrapMacroTest Qt4::QtGui) + +macro(test_incremental def) + set(timeformat "%Y%j%H%M%S") + try_compile(RESULT + "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}" + "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" + IncrementalMoc + CMAKE_FLAGS -D${def}=0 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output + ) + file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}/moc_foo.cpp" tsvar_before "${timeformat}") + if (NOT tsvar_before) + message(SEND_ERROR + "Unable to read timestamp from moc file from first build with -D${def}!\n" + "try_compile output:\n${output}" + ) + endif() + + execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2) # Ensure that the timestamp will change. + + try_compile(RESULT + "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}" + "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" + IncrementalMoc + CMAKE_FLAGS -D${def}=1 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output + ) + file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}/moc_foo.cpp" tsvar_after "${timeformat}") + if (NOT tsvar_after) + message(SEND_ERROR + "Unable to read timestamp from moc file from second build!\n" + "try_compile output:\n${output}" + ) + endif() + + if (NOT tsvar_after GREATER tsvar_before) + message(SEND_ERROR "Rebuild did not re-create moc file with -D${def}. Before: ${tsvar_before}. After: ${tsvar_after}") + endif() +endmacro() + +test_incremental(ADD_TARGET_DEF) +test_incremental(ADD_DIR_DEF) diff --git a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt new file mode 100644 index 0000000..65e2b64 --- /dev/null +++ b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt @@ -0,0 +1,21 @@ + +cmake_minimum_required(VERSION 2.8.12) +project(IncrementalMoc) + +find_package(Qt4 REQUIRED) + +if (ADD_TARGET_DEF) + set(target_args TARGET testlib) +endif() + +if (ADD_DIR_DEF) + add_definitions(-DNEW_DEF) +endif() + +qt4_generate_moc(foo.h moc_foo.cpp ${target_args}) + +add_library(testlib foo.cpp moc_foo.cpp) +target_link_libraries(testlib Qt4::QtCore) +if (ADD_TARGET_DEF) + target_compile_definitions(testlib PRIVATE NEW_DEF) +endif() diff --git a/Tests/Qt4Targets/IncrementalMoc/foo.cpp b/Tests/Qt4Targets/IncrementalMoc/foo.cpp new file mode 100644 index 0000000..e924f7e --- /dev/null +++ b/Tests/Qt4Targets/IncrementalMoc/foo.cpp @@ -0,0 +1,8 @@ + +#include "foo.h" + +Foo::Foo() + : QObject(0) +{ + +} diff --git a/Tests/Qt4Targets/IncrementalMoc/foo.h b/Tests/Qt4Targets/IncrementalMoc/foo.h new file mode 100644 index 0000000..38d899f --- /dev/null +++ b/Tests/Qt4Targets/IncrementalMoc/foo.h @@ -0,0 +1,9 @@ + +#include <QObject> + +class Foo : QObject +{ + Q_OBJECT +public: + Foo(); +}; diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index f1a272a..3fd00b8 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -67,10 +67,16 @@ add_custom_command( DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" ) +message("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") +if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_TYPES) + set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>) + add_definitions(-DTEST_DEBUG_CLASS) +endif() + add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp multiplewidgets.cpp xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> - test.qrc second_resource.qrc resourcetester.cpp generated.cpp + test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs} ) set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") diff --git a/Tests/QtAutogen/debug_class.cpp b/Tests/QtAutogen/debug_class.cpp new file mode 100644 index 0000000..58e72e4 --- /dev/null +++ b/Tests/QtAutogen/debug_class.cpp @@ -0,0 +1,9 @@ + +#include "debug_class.h" +#include "ui_debug_class.h" + +DebugClass::DebugClass(QWidget *parent) + : QWidget(parent), ui(new Ui::DebugClass) +{ + ui->setupUi(this); +} diff --git a/Tests/QtAutogen/debug_class.h b/Tests/QtAutogen/debug_class.h new file mode 100644 index 0000000..71bc104 --- /dev/null +++ b/Tests/QtAutogen/debug_class.h @@ -0,0 +1,20 @@ + +#include <QWidget> + +namespace Ui +{ +class DebugClass; +} + +class DebugClass : public QWidget +{ + Q_OBJECT +public: + explicit DebugClass(QWidget *parent = 0); + +signals: + void someSignal(); + +private: + Ui::DebugClass *ui; +}; diff --git a/Tests/QtAutogen/debug_class.ui b/Tests/QtAutogen/debug_class.ui new file mode 100644 index 0000000..dc2e1ac --- /dev/null +++ b/Tests/QtAutogen/debug_class.ui @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DebugClass</class> + <widget class="QWidget" name="DebugClass"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>DebugClass</string> + </property> + <widget class="QCheckBox" name="checkBox"> + <property name="geometry"> + <rect> + <x>50</x> + <y>20</y> + <width>82</width> + <height>21</height> + </rect> + </property> + <property name="text"> + <string>CheckBox</string> + </property> + </widget> + <widget class="QPushButton" name="pushButton"> + <property name="geometry"> + <rect> + <x>40</x> + <y>70</y> + <width>94</width> + <height>24</height> + </rect> + </property> + <property name="text"> + <string>PushButton</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/debug_resource.qrc b/Tests/QtAutogen/debug_resource.qrc new file mode 100644 index 0000000..db98b9b --- /dev/null +++ b/Tests/QtAutogen/debug_resource.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>debug_class.ui</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/main.cpp index c8a036e..eb59665 100644 --- a/Tests/QtAutogen/main.cpp +++ b/Tests/QtAutogen/main.cpp @@ -51,6 +51,11 @@ #include "yaf.h" #include "libC.h" #include "resourcetester.h" +#ifdef TEST_DEBUG_CLASS +#include "debug_class.h" +#include <iostream> +#endif + int main(int argv, char **args) { @@ -81,5 +86,9 @@ int main(int argv, char **args) QTimer::singleShot(0, &rt, SLOT(doTest())); +#ifdef TEST_DEBUG_CLASS + std::cout << DebugClass::staticMetaObject.className() << std::endl; +#endif + return app.exec(); } diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/resourcetester.cpp index 0c64d80..043ec75 100644 --- a/Tests/QtAutogen/resourcetester.cpp +++ b/Tests/QtAutogen/resourcetester.cpp @@ -18,6 +18,10 @@ void ResourceTester::doTest() qApp->exit(EXIT_FAILURE); if (!QFile::exists(":/main.cpp")) qApp->exit(EXIT_FAILURE); +#ifdef TEST_DEBUG_CLASS + if (!QFile::exists(":/debug_class.ui")) + qApp->exit(EXIT_FAILURE); +#endif QTimer::singleShot(0, qApp, SLOT(quit())); } diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt index 07982bd..05b0217 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0026-CONFIG-LOCATION-NEW.cmake:7 \(get_target_property\): - Policy CMP0026 is not set: Disallow use of the LOCATION target property. - Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - The LOCATION property may not be read from target "somelib". Use the target name directly with add_custom_command, or use the generator expression \$<TARGET_FILE>, as appropriate. diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt index 0e90f96..fec9dfb 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0026-LOCATION-CONFIG-NEW.cmake:7 \(get_target_property\): - Policy CMP0026 is not set: Disallow use of the LOCATION target property. - Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - The LOCATION property may not be read from target "somelib". Use the target name directly with add_custom_command, or use the generator expression \$<TARGET_FILE>, as appropriate. diff --git a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt index 2a05a4d..fa02512 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0026-NEW.cmake:7 \(get_target_property\): - Policy CMP0026 is not set: Disallow use of the LOCATION target property. - Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - The LOCATION property may not be read from target "somelib". Use the target name directly with add_custom_command, or use the generator expression \$<TARGET_FILE>, as appropriate. diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt new file mode 100644 index 0000000..17a7db0 --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt @@ -0,0 +1 @@ +add_library(otherlib ../empty.cpp) diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt index 9b88194..d122c4a 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt @@ -10,3 +10,16 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:5 \(get_target_property\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\): + Policy CMP0026 is not set: Disallow use of the LOCATION target property. + Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The LOCATION property should not be read from target "otherlib". Use the + target name directly with add_custom_command, or use the generator + expression \$<TARGET_FILE>, as appropriate. + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake index 89c5a8a..bfc9203 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake @@ -3,3 +3,6 @@ enable_language(CXX) add_library(somelib empty.cpp) get_target_property(_loc somelib LOCATION) + +add_subdirectory(CMP0026-WARN-Dir) +get_target_property(_loc otherlib LOCATION) diff --git a/Tests/RunCMake/set/PARENT_SCOPE-result.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt index 573541a..573541a 100644 --- a/Tests/RunCMake/set/PARENT_SCOPE-result.txt +++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt new file mode 100644 index 0000000..87d198d --- /dev/null +++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at ObjlibNotDefined.cmake:[0-9]+ \(get_target_property\): + Policy CMP0026 is not set: Disallow use of the LOCATION target property. + Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The LOCATION property should not be read from target "objlibuser". Use the + target name directly with add_custom_command, or use the generator + expression \$<TARGET_FILE>, as appropriate. + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake b/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake new file mode 100644 index 0000000..194760c --- /dev/null +++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake @@ -0,0 +1,13 @@ + +enable_language(CXX) + +add_executable(objlibuser + empty.cpp + $<TARGET_OBJECTS:bar> +) + +get_target_property(_location objlibuser LOCATION) + +add_library(bar OBJECT + empty.cpp +) diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake index 1824cc6..7c2582f 100644 --- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake @@ -9,3 +9,4 @@ run_cmake(CMP0026-CONFIG-LOCATION-WARN) run_cmake(CMP0026-LOCATION-CONFIG-NEW) run_cmake(CMP0026-LOCATION-CONFIG-OLD) run_cmake(CMP0026-LOCATION-CONFIG-WARN) +run_cmake(ObjlibNotDefined) diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt index 9d2c35b..ec2315f 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0037-NEW-colon.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "lib:colon" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -11,11 +6,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-colon.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "exe:colon" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -23,11 +13,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-colon.cmake:6 \(add_custom_target\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "custom:colon" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt index 13835af..5789e38 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt @@ -1,20 +1,10 @@ CMake Error at CMP0037-NEW-reserved.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "all" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-reserved.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "clean" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -22,11 +12,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-reserved.cmake:6 \(add_custom_target\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "help" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt index 2525bcd..e14cec0 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0037-NEW-space.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "lib with spaces" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -11,11 +6,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-space.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "exe with spaces" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -23,11 +13,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-space.cmake:6 \(add_custom_target\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "custom with spaces" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. diff --git a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt index 821c4f8..3d9d225 100644 --- a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0039-NEW.cmake:7 \(target_link_libraries\): - Policy CMP0039 is not set: Utility targets may not have link dependencies. - Run "cmake --help-policy CMP0039" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - Utility target "utility" must not be used as the target of a target_link_libraries call. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt index 03a0217..3f82d8c 100644 --- a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0040-NEW-missing-target.cmake:3 \(add_custom_command\): - Policy CMP0040 is not set: The target in the TARGET signature of - add_custom_command\(\) must exist. Run "cmake --help-policy CMP0040" for - policy details. Use the cmake_policy command to set the policy and - suppress this warning. -+ The target name "foobar" is unknown in this context. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt index 0c23c43..381647f 100644 --- a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt +++ b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0046-NEW-missing-dependency.cmake:4 \(add_dependencies\): - Policy CMP0046 is not set: Error on non-existent dependency in - add_dependencies. Run "cmake --help-policy CMP0046" for policy details. - Use the cmake_policy command to set the policy and suppress this warning. -+ The dependency target "bar" of target "foo" does not exist. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt b/Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt new file mode 100644 index 0000000..e5578ba --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt @@ -0,0 +1 @@ +^Sources: "empty.cpp;\$<TARGET_OBJECTS:objects>"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-NEW.cmake b/Tests/RunCMake/CMP0051/CMP0051-NEW.cmake new file mode 100644 index 0000000..f304bf1 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-NEW.cmake @@ -0,0 +1,10 @@ + +cmake_policy(SET CMP0051 NEW) + +add_library(objects OBJECT empty.cpp) + +add_library(empty empty.cpp $<TARGET_OBJECTS:objects>) + +get_target_property(srcs empty SOURCES) + +message("Sources: \"${srcs}\"") diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt new file mode 100644 index 0000000..cc17f33 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt @@ -0,0 +1 @@ +^Sources: "empty.cpp"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD.cmake b/Tests/RunCMake/CMP0051/CMP0051-OLD.cmake new file mode 100644 index 0000000..0243e94 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD.cmake @@ -0,0 +1,10 @@ + +cmake_policy(SET CMP0051 OLD) + +add_library(objects OBJECT empty.cpp) + +add_library(empty empty.cpp $<TARGET_OBJECTS:objects>) + +get_target_property(srcs empty SOURCES) + +message("Sources: \"${srcs}\"") diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-Dir/CMakeLists.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-Dir/CMakeLists.txt new file mode 100644 index 0000000..77cbad5 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-Dir/CMakeLists.txt @@ -0,0 +1 @@ +add_library(empty2 ../empty.cpp $<TARGET_OBJECTS:objects>) diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt new file mode 100644 index 0000000..ae2e468 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt @@ -0,0 +1,31 @@ +CMake Warning \(dev\) at CMP0051-WARN.cmake:6 \(get_target_property\): + Policy CMP0051 is not set: List TARGET_OBJECTS in SOURCES target property. + Run "cmake --help-policy CMP0051" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + Target "empty" contains \$<TARGET_OBJECTS> generator expression in its + sources list. This content was not previously part of the SOURCES property + when that property was read at configure time. Code reading that property + needs to be adapted to ignore the generator expression using the + string\(GENEX_STRIP\) command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +Sources: "empty.cpp" +* +CMake Warning \(dev\) at CMP0051-WARN.cmake:12 \(get_target_property\): + Policy CMP0051 is not set: List TARGET_OBJECTS in SOURCES target property. + Run "cmake --help-policy CMP0051" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + Target "empty2" contains \$<TARGET_OBJECTS> generator expression in its + sources list. This content was not previously part of the SOURCES property + when that property was read at configure time. Code reading that property + needs to be adapted to ignore the generator expression using the + string\(GENEX_STRIP\) command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +Sources: "../empty.cpp"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN.cmake b/Tests/RunCMake/CMP0051/CMP0051-WARN.cmake new file mode 100644 index 0000000..744598f --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN.cmake @@ -0,0 +1,14 @@ + +add_library(objects OBJECT empty.cpp) + +add_library(empty empty.cpp $<TARGET_OBJECTS:objects>) + +get_target_property(srcs empty SOURCES) + +message("Sources: \"${srcs}\"") + +add_subdirectory(CMP0051-WARN-Dir) + +get_target_property(srcs empty2 SOURCES) + +message("Sources: \"${srcs}\"") diff --git a/Tests/RunCMake/CMP0051/CMakeLists.txt b/Tests/RunCMake/CMP0051/CMakeLists.txt new file mode 100644 index 0000000..3482e6b --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0051/RunCMakeTest.cmake b/Tests/RunCMake/CMP0051/RunCMakeTest.cmake new file mode 100644 index 0000000..621192d --- /dev/null +++ b/Tests/RunCMake/CMP0051/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0051-OLD) +run_cmake(CMP0051-NEW) +run_cmake(CMP0051-WARN) diff --git a/Tests/RunCMake/CMP0051/empty.cpp b/Tests/RunCMake/CMP0051/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0051/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMP0053/CMP0053-NEW-stderr.txt b/Tests/RunCMake/CMP0053/CMP0053-NEW-stderr.txt new file mode 100644 index 0000000..836b0ff --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMP0053-NEW-stderr.txt @@ -0,0 +1,2 @@ +^called +--><--$ diff --git a/Tests/RunCMake/CMP0053/CMP0053-NEW.cmake b/Tests/RunCMake/CMP0053/CMP0053-NEW.cmake new file mode 100644 index 0000000..6ffedc6 --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMP0053-NEW.cmake @@ -0,0 +1,8 @@ +cmake_policy(SET CMP0053 NEW) + +function (watch_callback) + message("called") +endfunction () + +variable_watch(test watch_callback) +message("-->${test}<--") diff --git a/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt b/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt new file mode 100644 index 0000000..836b0ff --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt @@ -0,0 +1,2 @@ +^called +--><--$ diff --git a/Tests/RunCMake/CMP0053/CMP0053-OLD.cmake b/Tests/RunCMake/CMP0053/CMP0053-OLD.cmake new file mode 100644 index 0000000..41f5347 --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMP0053-OLD.cmake @@ -0,0 +1,8 @@ +cmake_policy(SET CMP0053 OLD) + +function (watch_callback) + message("called") +endfunction () + +variable_watch(test watch_callback) +message("-->${test}<--") diff --git a/Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt b/Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt new file mode 100644 index 0000000..836b0ff --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt @@ -0,0 +1,2 @@ +^called +--><--$ diff --git a/Tests/RunCMake/CMP0053/CMP0053-WARN.cmake b/Tests/RunCMake/CMP0053/CMP0053-WARN.cmake new file mode 100644 index 0000000..b010d13 --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMP0053-WARN.cmake @@ -0,0 +1,6 @@ +function (watch_callback) + message("called") +endfunction () + +variable_watch(test watch_callback) +message("-->${test}<--") diff --git a/Tests/RunCMake/CMP0053/CMakeLists.txt b/Tests/RunCMake/CMP0053/CMakeLists.txt new file mode 100644 index 0000000..3482e6b --- /dev/null +++ b/Tests/RunCMake/CMP0053/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0053/RunCMakeTest.cmake b/Tests/RunCMake/CMP0053/RunCMakeTest.cmake new file mode 100644 index 0000000..6521ac0 --- /dev/null +++ b/Tests/RunCMake/CMP0053/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0053-OLD) +run_cmake(CMP0053-NEW) +run_cmake(CMP0053-WARN) diff --git a/Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-NEW-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake b/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake new file mode 100644 index 0000000..23a9124 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-NEW.cmake @@ -0,0 +1,47 @@ +cmake_policy(SET CMP0054 NEW) + +set(FOO "BAR") +set(BAZ "ZZZ") +set(MYTRUE ON) +set(MYNUMBER 3) +set(MYVERSION 3.0) + +function(assert_unquoted PREFIX FIRST) + string(REPLACE ";" " " ARGN_SP "${ARGN}") + if(${PREFIX} ${FIRST} ${ARGN}) + message(FATAL_ERROR "Assertion failed [${PREFIX} ${FIRST} ${ARGN_SP}]") + endif() +endfunction() + +function(assert_quoted PREFIX FIRST) + string(REPLACE ";" " " ARGN_SP "${ARGN}") + if(${PREFIX} "${FIRST}" ${ARGN}) + message(FATAL_ERROR "Assertion failed [${PREFIX} \"${FIRST}\" ${ARGN_SP}]") + endif() +endfunction() + +function(assert FIRST) + assert_unquoted(NOT ${FIRST} ${ARGN}) + assert_quoted("" ${FIRST} ${ARGN}) +endfunction() + +assert(MYTRUE) + +assert(FOO MATCHES "^BAR$") + +assert(MYNUMBER LESS 4) +assert(MYNUMBER GREATER 2) +assert(MYNUMBER EQUAL 3) + +assert(FOO STRLESS CCC) +assert(BAZ STRGREATER CCC) +assert(FOO STREQUAL BAR) + +assert_unquoted(NOT MYVERSION VERSION_LESS 3.1) +assert_unquoted("" MYVERSION VERSION_LESS 2.9) + +assert_quoted(NOT MYVERSION VERSION_LESS 2.9) +assert_quoted(NOT MYVERSION VERSION_LESS 3.1) + +assert(MYVERSION VERSION_GREATER 2.9) +assert(MYVERSION VERSION_EQUAL 3.0) diff --git a/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-OLD.cmake b/Tests/RunCMake/CMP0054/CMP0054-OLD.cmake new file mode 100644 index 0000000..0c4cede --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-OLD.cmake @@ -0,0 +1,47 @@ +cmake_policy(SET CMP0054 OLD) + +set(FOO "BAR") +set(BAZ "ZZZ") +set(MYTRUE ON) +set(MYNUMBER 3) +set(MYVERSION 3.0) + +function(assert_unquoted PREFIX FIRST) + string(REPLACE ";" " " ARGN_SP "${ARGN}") + if(${PREFIX} ${FIRST} ${ARGN}) + message(FATAL_ERROR "Assertion failed [${PREFIX} ${FIRST} ${ARGN_SP}]") + endif() +endfunction() + +function(assert_quoted PREFIX FIRST) + string(REPLACE ";" " " ARGN_SP "${ARGN}") + if(${PREFIX} "${FIRST}" ${ARGN}) + message(FATAL_ERROR "Assertion failed [${PREFIX} \"${FIRST}\" ${ARGN_SP}]") + endif() +endfunction() + +function(assert FIRST) + assert_unquoted(NOT ${FIRST} ${ARGN}) + assert_quoted(NOT ${FIRST} ${ARGN}) +endfunction() + +assert(MYTRUE) + +assert(FOO MATCHES "^BAR$") + +assert(MYNUMBER LESS 4) +assert(MYNUMBER GREATER 2) +assert(MYNUMBER EQUAL 3) + +assert(FOO STRLESS CCC) +assert(BAZ STRGREATER CCC) +assert(FOO STREQUAL BAR) + +assert_unquoted(NOT MYVERSION VERSION_LESS 3.1) +assert_unquoted("" MYVERSION VERSION_LESS 2.9) + +assert_quoted("" MYVERSION VERSION_LESS 2.9) +assert_quoted(NOT MYVERSION VERSION_LESS 3.1) + +assert(MYVERSION VERSION_GREATER 2.9) +assert(MYVERSION VERSION_EQUAL 3.0) diff --git a/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt new file mode 100644 index 0000000..3d875ae --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt @@ -0,0 +1,11 @@ +CMake Warning \(dev\) at CMP0054-WARN.cmake:3 \(if\): + Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or + keywords when unquoted. Run "cmake --help-policy CMP0054" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + Quoted variables like "FOO" will no longer be dereferenced when the policy + is set to NEW. Since the policy is not set the OLD behavior will be used. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake b/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake new file mode 100644 index 0000000..37855fc --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake @@ -0,0 +1,5 @@ +set(FOO "BAR") + +if(NOT "FOO" STREQUAL "BAR") + message(FATAL_ERROR "The given literals should match") +endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt new file mode 100644 index 0000000..485db52 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings-stderr.txt @@ -0,0 +1,24 @@ +CMake Warning \(dev\) at CMP0054-duplicate-warnings.cmake:4 \(if\): + Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or + keywords when unquoted. Run "cmake --help-policy CMP0054" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + Quoted variables like "FOO" will no longer be dereferenced when the policy + is set to NEW. Since the policy is not set the OLD behavior will be used. +Call Stack \(most recent call first\): + CMP0054-duplicate-warnings.cmake:8 \(generate_warning\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMP0054-duplicate-warnings.cmake:11 \(if\): + Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or + keywords when unquoted. Run "cmake --help-policy CMP0054" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + Quoted variables like "FOO" will no longer be dereferenced when the policy + is set to NEW. Since the policy is not set the OLD behavior will be used. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake b/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake new file mode 100644 index 0000000..04fbe14 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-duplicate-warnings.cmake @@ -0,0 +1,12 @@ +set(FOO "BAR") + +function(generate_warning) + if("FOO" STREQUAL "BAR") + endif() +endfunction() + +generate_warning() +generate_warning() + +if("FOO" STREQUAL "BAR") +endif() diff --git a/Tests/RunCMake/ExternalData/MissingData-result.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ExternalData/MissingData-result.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-result.txt diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt new file mode 100644 index 0000000..f444684 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at CMP0054-keywords-NEW.cmake:23 \(if\): + if given arguments: + + "NOT" "1" + + Unknown arguments specified +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake new file mode 100644 index 0000000..b957658 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-NEW.cmake @@ -0,0 +1,25 @@ +cmake_policy(SET CMP0054 NEW) + +function(assert KEYWORD) + if("${KEYWORD}" STREQUAL "${KEYWORD}") + else() + message(FATAL_ERROR + "Assertion failed [\"${KEYWORD}\" STREQUAL \"${KEYWORD}\"]") + endif() +endfunction() + +assert("NOT") +assert("COMMAND") +assert("POLICY") +assert("TARGET") +assert("EXISTS") +assert("IS_DIRECTORY") +assert("IS_SYMLINK") +assert("IS_ABSOLUTE") +assert("DEFINED") +assert("(") +assert(")") + +if("NOT" 1) + message(FATAL_ERROR "[\"NOT\" 1] evaluated true") +endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake new file mode 100644 index 0000000..a2a7f51 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0054 OLD) + +if(NOT 1) + message(FATAL_ERROR "[NOT 1] evaluated true") +endif() + +if("NOT" 1) + message(FATAL_ERROR "[\"NOT\" 1] evaluated true") +endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt new file mode 100644 index 0000000..b1ebd49 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at CMP0054-keywords-WARN.cmake:1 \(if\): + Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or + keywords when unquoted. Run "cmake --help-policy CMP0054" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + Quoted keywords like "NOT" will no longer be interpreted as keywords when + the policy is set to NEW. Since the policy is not set the OLD behavior + will be used. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake new file mode 100644 index 0000000..ee0a623 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake @@ -0,0 +1,3 @@ +if("NOT" 1) + message(FATAL_ERROR "[\"NOT\" 1] evaluated true") +endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake new file mode 100644 index 0000000..b6b243c --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope.cmake @@ -0,0 +1,53 @@ +set(FOO BAR) + +cmake_policy(SET CMP0054 NEW) + +function(function_defined_new_called_old) + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() +endfunction() + +macro(macro_defined_new_called_old) + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() +endmacro() + +cmake_policy(SET CMP0054 OLD) + +function_defined_new_called_old() +macro_defined_new_called_old() + +function(function_defined_old_called_new) + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() +endfunction() + +macro(macro_defined_old_called_new) + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() +endmacro() + +cmake_policy(SET CMP0054 NEW) + +function_defined_old_called_new() +macro_defined_old_called_new() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake new file mode 100644 index 0000000..87c968a --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope.cmake @@ -0,0 +1,49 @@ +set(FOO BAR) + +cmake_policy(SET CMP0054 NEW) + +foreach(loop_var arg1 arg2) + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() + + cmake_policy(SET CMP0054 OLD) + + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() + + cmake_policy(SET CMP0054 NEW) +endforeach() + +cmake_policy(SET CMP0054 OLD) + +foreach(loop_var arg1 arg2) + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() + + cmake_policy(SET CMP0054 NEW) + + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() + + cmake_policy(SET CMP0054 OLD) +endforeach() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake new file mode 100644 index 0000000..dd7434d --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if.cmake @@ -0,0 +1,41 @@ +set(FOO BAR) + +cmake_policy(SET CMP0054 NEW) + +if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() + + cmake_policy(SET CMP0054 OLD) + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() +endif() + +if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") +endif() + +cmake_policy(SET CMP0054 OLD) + +if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() + + cmake_policy(SET CMP0054 NEW) + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() +endif() + +if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") +endif() diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt new file mode 100644 index 0000000..f5a8fbe --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt @@ -0,0 +1 @@ +$^ diff --git a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake new file mode 100644 index 0000000..2b22778 --- /dev/null +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope.cmake @@ -0,0 +1,65 @@ +set(FOO BAR) + +set(LOOP_VAR "") + +cmake_policy(SET CMP0054 NEW) + +while(NOT LOOP_VAR STREQUAL "xx") + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() + + cmake_policy(SET CMP0054 OLD) + + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() + + cmake_policy(SET CMP0054 NEW) + + set(LOOP_VAR "${LOOP_VAR}x") +endwhile() + +while("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") +endwhile() + +set(LOOP_VAR "") + +cmake_policy(SET CMP0054 OLD) + +while(NOT LOOP_VAR STREQUAL "xx") + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") + endif() + + cmake_policy(SET CMP0054 NEW) + + if(NOT FOO STREQUAL BAR) + message(FATAL_ERROR "The variable should match the string") + endif() + + if("FOO" STREQUAL BAR) + message(FATAL_ERROR "The strings should not match") + endif() + + cmake_policy(SET CMP0054 OLD) + + set(LOOP_VAR "${LOOP_VAR}x") +endwhile() + +if(NOT "FOO" STREQUAL BAR) + message(FATAL_ERROR "The quoted variable should match the string") +endif() diff --git a/Tests/RunCMake/CMP0054/CMakeLists.txt b/Tests/RunCMake/CMP0054/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/CMP0054/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/CMP0054/RunCMakeTest.cmake b/Tests/RunCMake/CMP0054/RunCMakeTest.cmake new file mode 100644 index 0000000..2f2fb76 --- /dev/null +++ b/Tests/RunCMake/CMP0054/RunCMakeTest.cmake @@ -0,0 +1,13 @@ +include(RunCMake) + +run_cmake(CMP0054-OLD) +run_cmake(CMP0054-NEW) +run_cmake(CMP0054-WARN) +run_cmake(CMP0054-keywords-NEW) +run_cmake(CMP0054-keywords-OLD) +run_cmake(CMP0054-keywords-WARN) +run_cmake(CMP0054-duplicate-warnings) +run_cmake(CMP0054-policy-command-scope) +run_cmake(CMP0054-policy-foreach-scope) +run_cmake(CMP0054-policy-while-scope) +run_cmake(CMP0054-policy-nested-if) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 9bb097b..549aed8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -3,8 +3,9 @@ macro(add_RunCMake_test test) add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} - -DRunCMake_GENERATOR=${CMAKE_TEST_GENERATOR} - -DRunCMake_GENERATOR_TOOLSET=${CMAKE_TEST_GENERATOR_TOOLSET} + -DRunCMake_GENERATOR=${CMAKE_GENERATOR} + -DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} + -DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test} ${${test}_ARGS} @@ -16,6 +17,17 @@ 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")) + set(GeneratorExpression_ARGS -DLINKER_SUPPORTS_PDB=1) +endif() + add_RunCMake_test(CMP0019) add_RunCMake_test(CMP0022) add_RunCMake_test(CMP0026) @@ -34,20 +46,30 @@ add_RunCMake_test(CMP0045) add_RunCMake_test(CMP0046) add_RunCMake_test(CMP0049) add_RunCMake_test(CMP0050) +add_RunCMake_test(CMP0051) +add_RunCMake_test(CMP0053) +add_RunCMake_test(CMP0054) add_RunCMake_test(CTest) -if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") +if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) endif() add_RunCMake_test(CompilerNotFound) add_RunCMake_test(Configure) add_RunCMake_test(DisallowedCommands) add_RunCMake_test(ExternalData) +add_RunCMake_test(FeatureSummary) add_RunCMake_test(FPHSA) add_RunCMake_test(GeneratorExpression) +add_RunCMake_test(GeneratorPlatform) add_RunCMake_test(GeneratorToolset) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) +add_RunCMake_test(TargetObjects) +add_RunCMake_test(TargetSources) +add_RunCMake_test(find_dependency) +add_RunCMake_test(CompileFeatures) +add_RunCMake_test(WriteCompilerDetectionHeader) if(NOT WIN32) add_RunCMake_test(PositionIndependentCode) set(SKIP_VISIBILITY 0) @@ -77,6 +99,7 @@ add_RunCMake_test(add_dependencies) add_RunCMake_test(build_command) add_RunCMake_test(export) add_RunCMake_test(cmake_minimum_required) +add_RunCMake_test(file) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) add_RunCMake_test(if) @@ -94,6 +117,7 @@ add_RunCMake_test(TargetPolicies) add_RunCMake_test(alias_targets) add_RunCMake_test(interface_library) add_RunCMake_test(no_install_prefix) +add_RunCMake_test(configure_file) find_package(Qt4 QUIET) find_package(Qt5Core QUIET) @@ -105,15 +129,27 @@ if (QT4_FOUND) add_RunCMake_test(ObsoleteQtMacros) endif() -if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]") +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + add_RunCMake_test(FindPkgConfig) +endif() + +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio [^6]") add_RunCMake_test(include_external_msproject) add_RunCMake_test(SolutionGlobalSections) endif() +if(XCODE_VERSION AND NOT "${XCODE_VERSION}" VERSION_LESS 3) + add_RunCMake_test(XcodeProject) +endif() + add_RunCMake_test(File_Generate) add_RunCMake_test(ExportWithoutLanguage) add_RunCMake_test(target_link_libraries) + +add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) add_RunCMake_test(CommandLine) add_RunCMake_test(install) +add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/CPackInstallProperties/Append-check.cmake b/Tests/RunCMake/CPackInstallProperties/Append-check.cmake new file mode 100644 index 0000000..017b30d --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/Append-check.cmake @@ -0,0 +1,3 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +test_property("append.txt" CPACK_TEST_PROP "value1;value2;value3") diff --git a/Tests/RunCMake/CPackInstallProperties/Append.cmake b/Tests/RunCMake/CPackInstallProperties/Append.cmake new file mode 100644 index 0000000..cecc45f --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/Append.cmake @@ -0,0 +1,2 @@ +set_property(INSTALL append.txt PROPERTY CPACK_TEST_PROP value1) +set_property(INSTALL append.txt PROPERTY CPACK_TEST_PROP value2 value3 APPEND) diff --git a/Tests/RunCMake/CPackInstallProperties/CMakeLists.txt b/Tests/RunCMake/CPackInstallProperties/CMakeLists.txt new file mode 100644 index 0000000..89ff7c4 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.0) + +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) + +include(CPack) diff --git a/Tests/RunCMake/CPackInstallProperties/FilenameGenex-check.cmake b/Tests/RunCMake/CPackInstallProperties/FilenameGenex-check.cmake new file mode 100644 index 0000000..8c9e967 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/FilenameGenex-check.cmake @@ -0,0 +1,3 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +test_property(${EXPECTED_MYTEST_NAME} CPACK_TEST_PROP2 PROP_VALUE2) diff --git a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake new file mode 100644 index 0000000..1a373b9 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake @@ -0,0 +1,7 @@ +add_executable(mytest test.cpp) + +file(GENERATE OUTPUT runtest_info.cmake CONTENT [[ +set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>") +]]) + +set_property(INSTALL $<TARGET_FILE_NAME:mytest> PROPERTY CPACK_TEST_PROP2 PROP_VALUE2) diff --git a/Tests/RunCMake/CPackInstallProperties/MultipleValues-check.cmake b/Tests/RunCMake/CPackInstallProperties/MultipleValues-check.cmake new file mode 100644 index 0000000..91278ba --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/MultipleValues-check.cmake @@ -0,0 +1,3 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +test_property("multiple_values.txt" CPACK_TEST_PROP "value1;value2;value3") diff --git a/Tests/RunCMake/CPackInstallProperties/MultipleValues.cmake b/Tests/RunCMake/CPackInstallProperties/MultipleValues.cmake new file mode 100644 index 0000000..26db52a --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/MultipleValues.cmake @@ -0,0 +1 @@ +set_property(INSTALL multiple_values.txt PROPERTY CPACK_TEST_PROP value1 value2 value3) diff --git a/Tests/RunCMake/CPackInstallProperties/PerConfigValue-check.cmake b/Tests/RunCMake/CPackInstallProperties/PerConfigValue-check.cmake new file mode 100644 index 0000000..2966d88 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/PerConfigValue-check.cmake @@ -0,0 +1,13 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +file(GLOB INFO_FILES ${RunCMake_TEST_BINARY_DIR}/runtest_info_*.cmake) + +if(NOT INFO_FILES) + message(FATAL_ERROR "missing expected info files") +endif() + +foreach(INFO_FILE IN LISTS INFO_FILES) + include(${INFO_FILE}) + include(${RunCMake_TEST_BINARY_DIR}/CPackProperties.cmake) + test_property("config.cpp" FOO ${EXPECTED_MYTEST_NAME}) +endforeach() diff --git a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake new file mode 100644 index 0000000..77fe8ed --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake @@ -0,0 +1,14 @@ +add_executable(mytest test.cpp) + +foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES) + string(TOUPPER ${CONFIG} UPPER_CONFIG) + set_property(TARGET mytest PROPERTY + OUTPUT_NAME_${UPPER_CONFIG} bar_${CONFIG}) +endforeach() + +file(GENERATE OUTPUT runtest_info_$<CONFIG>.cmake CONTENT [[ +set(CPACK_BUILD_CONFIG "$<CONFIG>") +set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>") +]]) + +set_property(INSTALL config.cpp PROPERTY FOO $<TARGET_FILE_NAME:mytest>) diff --git a/Tests/RunCMake/CPackInstallProperties/Replace-check.cmake b/Tests/RunCMake/CPackInstallProperties/Replace-check.cmake new file mode 100644 index 0000000..6e492e7 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/Replace-check.cmake @@ -0,0 +1,3 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +test_property("replace.txt" CPACK_TEST_PROP "value2") diff --git a/Tests/RunCMake/CPackInstallProperties/Replace.cmake b/Tests/RunCMake/CPackInstallProperties/Replace.cmake new file mode 100644 index 0000000..104d5a4 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/Replace.cmake @@ -0,0 +1,2 @@ +set_property(INSTALL replace.txt PROPERTY CPACK_TEST_PROP value1) +set_property(INSTALL replace.txt PROPERTY CPACK_TEST_PROP value2) diff --git a/Tests/RunCMake/CPackInstallProperties/RunCMakeTest.cmake b/Tests/RunCMake/CPackInstallProperties/RunCMakeTest.cmake new file mode 100644 index 0000000..d244ac5 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +run_cmake(Simple) +run_cmake(FilenameGenex) +run_cmake(ValueGenex) +run_cmake(MultipleValues) +run_cmake(Append) +run_cmake(Replace) +run_cmake(PerConfigValue) diff --git a/Tests/RunCMake/CPackInstallProperties/Simple-check.cmake b/Tests/RunCMake/CPackInstallProperties/Simple-check.cmake new file mode 100644 index 0000000..6a7ee2a --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/Simple-check.cmake @@ -0,0 +1,3 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +test_property("foo/test.cpp" CPACK_TEST_PROP PROP_VALUE) diff --git a/Tests/RunCMake/CPackInstallProperties/Simple.cmake b/Tests/RunCMake/CPackInstallProperties/Simple.cmake new file mode 100644 index 0000000..2eb8755 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/Simple.cmake @@ -0,0 +1 @@ +set_property(INSTALL foo/test.cpp PROPERTY CPACK_TEST_PROP PROP_VALUE) diff --git a/Tests/RunCMake/CPackInstallProperties/ValueGenex-check.cmake b/Tests/RunCMake/CPackInstallProperties/ValueGenex-check.cmake new file mode 100644 index 0000000..cdfbcda --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/ValueGenex-check.cmake @@ -0,0 +1,3 @@ +include(${RunCMake_SOURCE_DIR}/check.cmake) + +test_property("bar/test.cpp" CPACK_TEST_PROP ${EXPECTED_MYTEST_NAME}) diff --git a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake new file mode 100644 index 0000000..2e1d465 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake @@ -0,0 +1,7 @@ +add_executable(mytest test.cpp) + +file(GENERATE OUTPUT runtest_info.cmake CONTENT [[ +set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>") +]]) + +set_property(INSTALL bar/test.cpp PROPERTY CPACK_TEST_PROP $<TARGET_FILE_NAME:mytest>) diff --git a/Tests/RunCMake/CPackInstallProperties/check.cmake b/Tests/RunCMake/CPackInstallProperties/check.cmake new file mode 100644 index 0000000..65aa467 --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/check.cmake @@ -0,0 +1,12 @@ +function(test_property FILE NAME EXPECTED_VALUE) + get_property(ACTUAL_VALUE INSTALL "${FILE}" PROPERTY "${NAME}") + + if(NOT "${ACTUAL_VALUE}" STREQUAL "${EXPECTED_VALUE}") + message(FATAL_ERROR "${NAME}@${FILE}: property mismatch expected [${EXPECTED_VALUE}] actual [${ACTUAL_VALUE}] (Config:${CPACK_BUILD_CONFIG})") + endif() +endfunction() + +set(CPACK_BUILD_CONFIG Debug) +include(${RunCMake_TEST_BINARY_DIR}/CPackProperties.cmake) + +include(${RunCMake_TEST_BINARY_DIR}/runtest_info.cmake OPTIONAL) diff --git a/Tests/RunCMake/CPackInstallProperties/test.cpp b/Tests/RunCMake/CPackInstallProperties/test.cpp new file mode 100644 index 0000000..237c8ce --- /dev/null +++ b/Tests/RunCMake/CPackInstallProperties/test.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/Tests/RunCMake/CheckModules/CheckTypeSizeOkNoC.cmake b/Tests/RunCMake/CheckModules/CheckTypeSizeOkNoC.cmake new file mode 100644 index 0000000..b2dcd7f --- /dev/null +++ b/Tests/RunCMake/CheckModules/CheckTypeSizeOkNoC.cmake @@ -0,0 +1,4 @@ +enable_language(CXX) +include(CheckTypeSize) +check_type_size(int SIZEOF_INT LANGUAGE CXX) +check_type_size(int SIZEOF_INT BUILTIN_TYPES_ONLY LANGUAGE CXX) diff --git a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake index fda7ebf..5b4e57e 100644 --- a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake @@ -12,3 +12,5 @@ run_cmake(CheckTypeSizeUnknownLanguage) run_cmake(CheckTypeSizeMissingLanguage) run_cmake(CheckTypeSizeUnknownArgument) run_cmake(CheckTypeSizeMixedArgs) + +run_cmake(CheckTypeSizeOkNoC) diff --git a/Tests/RunCMake/ExternalData/Directory3-result.txt b/Tests/RunCMake/CommandLine/E_env-bad-arg1-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ExternalData/Directory3-result.txt +++ b/Tests/RunCMake/CommandLine/E_env-bad-arg1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_env-bad-arg1-stderr.txt b/Tests/RunCMake/CommandLine/E_env-bad-arg1-stderr.txt new file mode 100644 index 0000000..2143ba4 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-bad-arg1-stderr.txt @@ -0,0 +1 @@ +^cmake -E env: unknown option '-bad-arg1'$ diff --git a/Tests/RunCMake/CommandLine/E_env-no-command0-result.txt b/Tests/RunCMake/CommandLine/E_env-no-command0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-no-command0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_env-no-command0-stderr.txt b/Tests/RunCMake/CommandLine/E_env-no-command0-stderr.txt new file mode 100644 index 0000000..d2efa53 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-no-command0-stderr.txt @@ -0,0 +1 @@ +^cmake -E env: no command given$ diff --git a/Tests/RunCMake/CommandLine/E_env-no-command1-result.txt b/Tests/RunCMake/CommandLine/E_env-no-command1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-no-command1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_env-no-command1-stderr.txt b/Tests/RunCMake/CommandLine/E_env-no-command1-stderr.txt new file mode 100644 index 0000000..d2efa53 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-no-command1-stderr.txt @@ -0,0 +1 @@ +^cmake -E env: no command given$ diff --git a/Tests/RunCMake/CommandLine/E_env-set-stdout.txt b/Tests/RunCMake/CommandLine/E_env-set-stdout.txt new file mode 100644 index 0000000..feff117 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-set-stdout.txt @@ -0,0 +1 @@ +^-- TEST_ENV is correctly set in environment: 1$ diff --git a/Tests/RunCMake/CommandLine/E_env-set.cmake b/Tests/RunCMake/CommandLine/E_env-set.cmake new file mode 100644 index 0000000..c2639b6 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-set.cmake @@ -0,0 +1,5 @@ +if(DEFINED ENV{TEST_ENV}) + message(STATUS "TEST_ENV is correctly set in environment: $ENV{TEST_ENV}") +else() + message(FATAL_ERROR "TEST_ENV is incorrectly not set in environment") +endif() diff --git a/Tests/RunCMake/CommandLine/E_env-unset-stdout.txt b/Tests/RunCMake/CommandLine/E_env-unset-stdout.txt new file mode 100644 index 0000000..a1d5c01 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-unset-stdout.txt @@ -0,0 +1 @@ +^-- TEST_ENV is correctly not set in environment$ diff --git a/Tests/RunCMake/CommandLine/E_env-unset.cmake b/Tests/RunCMake/CommandLine/E_env-unset.cmake new file mode 100644 index 0000000..04976fb --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_env-unset.cmake @@ -0,0 +1,5 @@ +if(DEFINED ENV{TEST_ENV}) + message(FATAL_ERROR "TEST_ENV is incorrectly set in environment") +else() + message(STATUS "TEST_ENV is correctly not set in environment") +endif() diff --git a/Tests/RunCMake/CommandLine/P_directory-result.txt b/Tests/RunCMake/CommandLine/P_directory-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_directory-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/P_directory-stderr.txt b/Tests/RunCMake/CommandLine/P_directory-stderr.txt new file mode 100644 index 0000000..b8319a1 --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_directory-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index ada4cab..5622a5b 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,12 @@ include(RunCMake) +run_cmake_command(build-no-cache + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) +run_cmake_command(build-no-generator + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-no-generator) +run_cmake_command(build-bad-generator + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator) + if(UNIX) run_cmake_command(E_create_symlink-missing-dir ${CMAKE_COMMAND} -E create_symlink T missing-dir/L @@ -24,7 +31,15 @@ if(UNIX) ) endif() +run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env) +run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1) +run_cmake_command(E_env-bad-arg1 ${CMAKE_COMMAND} -E env -bad-arg1) +run_cmake_command(E_env-set ${CMAKE_COMMAND} -E env TEST_ENV=1 ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_env-set.cmake) +run_cmake_command(E_env-unset ${CMAKE_COMMAND} -E env TEST_ENV=1 ${CMAKE_COMMAND} -E env --unset=TEST_ENV ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_env-unset.cmake) + run_cmake_command(E_sleep-no-args ${CMAKE_COMMAND} -E sleep) run_cmake_command(E_sleep-bad-arg1 ${CMAKE_COMMAND} -E sleep x) run_cmake_command(E_sleep-bad-arg2 ${CMAKE_COMMAND} -E sleep 1 -1) run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1) + +run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}) diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-result.txt b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt new file mode 100644 index 0000000..1103407 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt @@ -0,0 +1 @@ +^Error: could create CMAKE_GENERATOR "Bad Generator"$ diff --git a/Tests/RunCMake/CommandLine/build-no-cache-result.txt b/Tests/RunCMake/CommandLine/build-no-cache-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-cache-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt new file mode 100644 index 0000000..40dd3c0 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt @@ -0,0 +1 @@ +^Error: could not load cache$ diff --git a/Tests/RunCMake/CommandLine/build-no-generator-result.txt b/Tests/RunCMake/CommandLine/build-no-generator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-generator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt new file mode 100644 index 0000000..40ad030 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt @@ -0,0 +1 @@ +^Error: could not find CMAKE_GENERATOR in Cache$ diff --git a/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt new file mode 100644 index 0000000..e34af44 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt @@ -0,0 +1 @@ +CMAKE_GENERATOR:INTERNAL=Bad Generator diff --git a/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt diff --git a/Tests/RunCMake/CompileFeatures/CMakeLists.txt b/Tests/RunCMake/CompileFeatures/CMakeLists.txt new file mode 100644 index 0000000..3482e6b --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle-result.txt b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle-stderr.txt b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle-stderr.txt new file mode 100644 index 0000000..a584d7d --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle-stderr.txt @@ -0,0 +1,7 @@ +CMake Error in CMakeLists.txt: + The COMPILE_FEATURES property of target "empty1" was evaluated when + computing the link implementation, and the "CXX_STANDARD" was "98" for that + computation. Computing the COMPILE_FEATURES based on the link + implementation resulted in a higher "CXX_STANDARD" "11". This is not + permitted. The COMPILE_FEATURES may not both depend on and be depended on + by the link implementation. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake new file mode 100644 index 0000000..9d56bc0 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -0,0 +1,15 @@ + +add_library(empty1 empty.cpp) + +add_library(empty2 INTERFACE) +add_library(empty3 INTERFACE) +target_compile_features(empty3 INTERFACE cxx_constexpr) + +target_link_libraries(empty1 + # When starting, $<COMPILE_FEATURES:cxx_final> is '0', so 'freeze' the + # CXX_STANDARD at 98 during computation. + $<$<COMPILE_FEATURES:cxx_final>:empty2> + # This would add cxx_constexpr, but that would require CXX_STANDARD = 11, + # which is not allowed after freeze. Report an error. + empty3 +) diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved-result.txt b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved-stderr.txt b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake new file mode 100644 index 0000000..0df548b --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake @@ -0,0 +1,14 @@ + +add_library(empty1 empty.cpp) + +add_library(empty2 INTERFACE) +add_library(empty3 INTERFACE) +target_compile_features(empty3 INTERFACE cxx_constexpr) + +target_link_libraries(empty1 + $<$<COMPILE_FEATURES:cxx_final>:empty2> + empty3 +) +# This, or populating the COMPILE_FEATURES property with a feature in the +# same standard as cxx_final, solves the cycle above. +set_property(TARGET empty1 PROPERTY CXX_STANDARD 11) diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures-result.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures-stderr.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures-stderr.txt new file mode 100644 index 0000000..fd18c88 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NoSupportedCFeatures.cmake:[0-9]+ \(target_compile_features\): + target_compile_features no known features for C compiler + + "[^"]*" + + version *[.0-9]+\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures.cmake b/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures.cmake new file mode 100644 index 0000000..3624d4b --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCFeatures.cmake @@ -0,0 +1,5 @@ + +enable_language(C) + +add_library(no_features empty.c) +target_compile_features(no_features PRIVATE c_static_assert) diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex-result.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex-stderr.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex-stderr.txt new file mode 100644 index 0000000..df647e8 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + No known features for C compiler + + "[^"]*" + + version *[.0-9]+\. diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex.cmake b/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex.cmake new file mode 100644 index 0000000..b6053aa --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCFeaturesGenex.cmake @@ -0,0 +1,5 @@ + +enable_language(C) + +add_library(no_features empty.c) +target_compile_features(no_features PRIVATE $<1:c_static_assert>) diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-result.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt new file mode 100644 index 0000000..fc882cb --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NoSupportedCxxFeatures.cmake:3 \(target_compile_features\): + target_compile_features no known features for CXX compiler + + "[^"]*" + + version *[.0-9]+\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake new file mode 100644 index 0000000..5121948 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake @@ -0,0 +1,3 @@ + +add_library(no_features empty.cpp) +target_compile_features(no_features PRIVATE cxx_constexpr) diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-result.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-stderr.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-stderr.txt new file mode 100644 index 0000000..66d0d41 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + No known features for CXX compiler + + "[^"]*" + + version *[.0-9]+\. diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex.cmake b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex.cmake new file mode 100644 index 0000000..490f187 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex.cmake @@ -0,0 +1,3 @@ + +add_library(no_features empty.cpp) +target_compile_features(no_features PRIVATE $<1:cxx_constexpr>) diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1-result.txt b/Tests/RunCMake/CompileFeatures/NonValidTarget1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1-stderr.txt b/Tests/RunCMake/CompileFeatures/NonValidTarget1-stderr.txt new file mode 100644 index 0000000..7f3b43b --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget1.cmake:[0-9]+ \(add_custom_command\): + Error evaluating generator expression: + + \$<COMPILE_FEATURES:cxx_final> + + \$<COMPILE_FEATURE> may only be used with binary targets. It may not be + used with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake new file mode 100644 index 0000000..c6707c1 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -0,0 +1,17 @@ + +set(genexvar $<COMPILE_FEATURES:cxx_final>) + +if (HAVE_FINAL) + set(expected_result 1) +else() + set(expected_result 0) +endif() + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${HAVE_FINAL}.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp") +if (HAVE_FINAL) + target_compile_features(empty PRIVATE cxx_final) +endif() diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget2-result.txt b/Tests/RunCMake/CompileFeatures/NonValidTarget2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget2-stderr.txt b/Tests/RunCMake/CompileFeatures/NonValidTarget2-stderr.txt new file mode 100644 index 0000000..635150c --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget2-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget2.cmake:4 \(add_custom_target\): + Error evaluating generator expression: + + \$<COMPILE_FEATURES:cxx_final> + + \$<COMPILE_FEATURE> may only be used with binary targets. It may not be + used with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake new file mode 100644 index 0000000..eb84692 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake @@ -0,0 +1,8 @@ + +set(genexvar $<COMPILE_FEATURES:cxx_final>) + +add_custom_target(copy_target + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.txt" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp") diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature-stderr.txt new file mode 100644 index 0000000..ff60e50 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature-stderr.txt @@ -0,0 +1,2 @@ +CMake Error in CMakeLists.txt: + Specified unknown feature "not_a_feature" for target "somelib". diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature.cmake new file mode 100644 index 0000000..35246c8 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature.cmake @@ -0,0 +1,3 @@ + +add_library(somelib STATIC empty.cpp) +set_property(TARGET somelib PROPERTY COMPILE_FEATURES "not_a_feature") diff --git a/Tests/RunCMake/CompileFeatures/NotAFeatureGenex-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeatureGenex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeatureGenex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeatureGenex-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeatureGenex-stderr.txt new file mode 100644 index 0000000..ff60e50 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeatureGenex-stderr.txt @@ -0,0 +1,2 @@ +CMake Error in CMakeLists.txt: + Specified unknown feature "not_a_feature" for target "somelib". diff --git a/Tests/RunCMake/CompileFeatures/NotAFeatureGenex.cmake b/Tests/RunCMake/CompileFeatures/NotAFeatureGenex.cmake new file mode 100644 index 0000000..ad2bd37 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeatureGenex.cmake @@ -0,0 +1,3 @@ + +add_library(somelib STATIC empty.cpp) +set_property(TARGET somelib PROPERTY COMPILE_FEATURES "$<1:not_a_feature>") diff --git a/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive-stderr.txt new file mode 100644 index 0000000..ff60e50 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive-stderr.txt @@ -0,0 +1,2 @@ +CMake Error in CMakeLists.txt: + Specified unknown feature "not_a_feature" for target "somelib". diff --git a/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive.cmake b/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive.cmake new file mode 100644 index 0000000..7311aec --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeatureTransitive.cmake @@ -0,0 +1,6 @@ + +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_COMPILE_FEATURES "not_a_feature") + +add_library(somelib STATIC empty.cpp) +target_link_libraries(somelib iface) diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug-stderr.txt new file mode 100644 index 0000000..60a8e51 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug-stderr.txt @@ -0,0 +1,11 @@ +CMake Debug Log at NotAFeature_OriginDebug.cmake:4 \(set_property\): + Used compile features for target somelib: + + \* not_a_feature + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error in CMakeLists.txt: + Specified unknown feature "not_a_feature" for target "somelib". diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug.cmake new file mode 100644 index 0000000..350c2ea --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug.cmake @@ -0,0 +1,4 @@ + +set(CMAKE_DEBUG_TARGET_PROPERTIES COMPILE_FEATURES) +add_library(somelib STATIC empty.cpp) +set_property(TARGET somelib PROPERTY COMPILE_FEATURES "not_a_feature") diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex-stderr.txt new file mode 100644 index 0000000..08e20a8 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex-stderr.txt @@ -0,0 +1,11 @@ +CMake Debug Log at NotAFeature_OriginDebugGenex.cmake:4 \(set_property\): + Used compile features for target somelib: + + \* not_a_feature + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error in CMakeLists.txt: + Specified unknown feature "not_a_feature" for target "somelib". diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex.cmake new file mode 100644 index 0000000..2122981 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugGenex.cmake @@ -0,0 +1,4 @@ + +set(CMAKE_DEBUG_TARGET_PROPERTIES COMPILE_FEATURES) +add_library(somelib STATIC empty.cpp) +set_property(TARGET somelib PROPERTY COMPILE_FEATURES "$<1:not_a_feature>") diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive-stderr.txt new file mode 100644 index 0000000..23c3305 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive-stderr.txt @@ -0,0 +1,11 @@ +CMake Debug Log at NotAFeature_OriginDebugTransitive.cmake:6 \(target_link_libraries\): + Used compile features for target somelib: + + \* not_a_feature + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error in CMakeLists.txt: + Specified unknown feature "not_a_feature" for target "somelib". diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive.cmake new file mode 100644 index 0000000..05d0073 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugTransitive.cmake @@ -0,0 +1,6 @@ + +set(CMAKE_DEBUG_TARGET_PROPERTIES COMPILE_FEATURES) +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_COMPILE_FEATURES "not_a_feature") +add_library(somelib STATIC empty.cpp) +target_link_libraries(somelib iface) diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt new file mode 100644 index 0000000..d819d15 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at NotAFeature_OriginDebug_target_compile_features.cmake:4 \(target_compile_features\): + target_compile_features specified unknown feature "not_a_feature" for + target "somelib". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake new file mode 100644 index 0000000..467d9a1 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake @@ -0,0 +1,4 @@ + +set(CMAKE_DEBUG_TARGET_PROPERTIES COMPILE_FEATURES) +add_library(somelib STATIC empty.cpp) +target_compile_features(somelib PRIVATE not_a_feature) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11-stderr.txt new file mode 100644 index 0000000..0fc9112 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX11" , but CMake does not + know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake new file mode 100644 index 0000000..f60504f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake @@ -0,0 +1,5 @@ + +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 11) +set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE) +set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Ext-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Ext-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext-stderr.txt new file mode 100644 index 0000000..5c68a1c --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX11" \(with compiler + extensions\), but CMake does not know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake new file mode 100644 index 0000000..10b251a --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake @@ -0,0 +1,4 @@ + +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 11) +set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-stderr.txt new file mode 100644 index 0000000..5c68a1c --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX11" \(with compiler + extensions\), but CMake does not know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake new file mode 100644 index 0000000..29703db --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake @@ -0,0 +1,4 @@ + +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 11) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Variable-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Variable-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable-stderr.txt new file mode 100644 index 0000000..0fc9112 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX11" , but CMake does not + know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake new file mode 100644 index 0000000..c480997 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake @@ -0,0 +1,5 @@ + +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 11) +set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98-stderr.txt new file mode 100644 index 0000000..47c8688 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX98" , but CMake does not + know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake new file mode 100644 index 0000000..fd9fb60 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake @@ -0,0 +1,5 @@ + +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 98) +set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE) +set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Ext-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Ext-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext-stderr.txt new file mode 100644 index 0000000..b4fdf8a --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX98" \(with compiler + extensions\), but CMake does not know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake new file mode 100644 index 0000000..4ea595e --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake @@ -0,0 +1,4 @@ + +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 98) +set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-stderr.txt new file mode 100644 index 0000000..b4fdf8a --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX98" \(with compiler + extensions\), but CMake does not know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake new file mode 100644 index 0000000..0e3ef8d --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake @@ -0,0 +1,4 @@ + +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 98) diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Variable-result.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Variable-stderr.txt b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable-stderr.txt new file mode 100644 index 0000000..47c8688 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Target "foo" requires the language dialect "CXX98" , but CMake does not + know the compile flags to use to enable it. diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake new file mode 100644 index 0000000..7562264 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake @@ -0,0 +1,5 @@ + +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +add_library(foo empty.cpp) +set_property(TARGET foo PROPERTY CXX_STANDARD 98) +set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake new file mode 100644 index 0000000..1892a5c --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -0,0 +1,54 @@ +include(RunCMake) + +run_cmake(NotAFeature) +run_cmake(NotAFeatureGenex) +run_cmake(NotAFeatureTransitive) +run_cmake(NotAFeature_OriginDebug) +run_cmake(NotAFeature_OriginDebugGenex) +run_cmake(NotAFeature_OriginDebugTransitive) +run_cmake(NotAFeature_OriginDebug_target_compile_features) + +run_cmake(generate_feature_list) +file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/c_features.txt" + C_FEATURES +) +file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_features.txt" + CXX_FEATURES +) + +if (NOT C_FEATURES) + run_cmake(NoSupportedCFeatures) + run_cmake(NoSupportedCFeaturesGenex) +endif() + +if (NOT CXX_FEATURES) + run_cmake(NoSupportedCxxFeatures) + run_cmake(NoSupportedCxxFeaturesGenex) +else() + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + + if (";${CXX_FEATURES};" MATCHES ";cxx_final;") + set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") + endif() + run_cmake(NonValidTarget1) + run_cmake(NonValidTarget2) + unset(RunCMake_TEST_OPTIONS) +endif() + +foreach(standard 98 11) + file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" + CXX${standard}_FLAG + ) + if (CXX${standard}_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}) + run_cmake(RequireCXX${standard}Variable) + endif() + if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}Ext) + run_cmake(RequireCXX${standard}ExtVariable) + endif() +endforeach() diff --git a/Tests/RunCMake/CompileFeatures/empty.c b/Tests/RunCMake/CompileFeatures/empty.c new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/empty.c @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CompileFeatures/empty.cpp b/Tests/RunCMake/CompileFeatures/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake new file mode 100644 index 0000000..09e17b1 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake @@ -0,0 +1,29 @@ + +enable_language(C) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/c_features.txt" + "${CMAKE_C_COMPILE_FEATURES}" +) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_features.txt" + "${CMAKE_CXX_COMPILE_FEATURES}" +) + +foreach(standard 98 11) + set(CXX${standard}_FLAG NOTFOUND) + if (DEFINED CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION) + set(CXX${standard}_FLAG ${CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION}) + endif() + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx${standard}_flag.txt" + "${CXX${standard}_FLAG}" + ) + set(CXX${standard}EXT_FLAG NOTFOUND) + if (DEFINED CMAKE_CXX${standard}_EXTENSION_COMPILE_OPTION) + set(CXX${standard}EXT_FLAG ${CMAKE_CXX${standard}_EXTENSION_COMPILE_OPTION}) + endif() + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx${standard}ext_flag.txt" + "${CXX${standard}EXT_FLAG}" + ) +endforeach() diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt b/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt b/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt new file mode 100644 index 0000000..7ce7daf --- /dev/null +++ b/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at CustomTargetAfterError.cmake:1 \(message\): + Error before add_custom_target +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at CustomTargetAfterError.cmake:3 \(message\): + Error after add_custom_target +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError.cmake b/Tests/RunCMake/Configure/CustomTargetAfterError.cmake new file mode 100644 index 0000000..3e26455 --- /dev/null +++ b/Tests/RunCMake/Configure/CustomTargetAfterError.cmake @@ -0,0 +1,3 @@ +message(SEND_ERROR "Error before add_custom_target") +add_custom_target(foo COMMAND echo) +message(SEND_ERROR "Error after add_custom_target") diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt index bb87f4c..92fe233 100644 --- a/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt +++ b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt @@ -1,4 +1,4 @@ -- Detecting C compiler ABI info --- Detecting C compiler ABI info - failed +-- Detecting C compiler ABI info - failed.* -- Configuring done -- Generating done diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake index 5ef0384..58e1a2a 100644 --- a/Tests/RunCMake/Configure/RunCMakeTest.cmake +++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(CustomTargetAfterError) run_cmake(ErrorLogs) run_cmake(FailCopyFileABI) diff --git a/Tests/RunCMake/ExternalData/Directory1-stderr.txt b/Tests/RunCMake/ExternalData/Directory1-stderr.txt index 85c250f..2bc3c60 100644 --- a/Tests/RunCMake/ExternalData/Directory1-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory1-stderr.txt @@ -7,7 +7,7 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Directory1 - that does not exist as a file \(with or without an extension\)! + that is directory instead of a file! Call Stack \(most recent call first\): .* Directory1.cmake:3 \(ExternalData_Add_Test\) diff --git a/Tests/RunCMake/ExternalData/Directory3-stderr.txt b/Tests/RunCMake/ExternalData/Directory3-stderr.txt index 56a341e..ceed2a0 100644 --- a/Tests/RunCMake/ExternalData/Directory3-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory3-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): +CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Data file referenced by argument DATA{Directory3/\*} @@ -12,3 +12,4 @@ Call Stack \(most recent call first\): .* Directory3.cmake:3 \(ExternalData_Add_Test\) CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingData-stderr.txt b/Tests/RunCMake/ExternalData/MissingData-stderr.txt index e794f95..39ed2f1 100644 --- a/Tests/RunCMake/ExternalData/MissingData-stderr.txt +++ b/Tests/RunCMake/ExternalData/MissingData-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): +CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Data file referenced by argument DATA{MissingData.txt} @@ -10,5 +10,6 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that does not exist as a file \(with or without an extension\)! Call Stack \(most recent call first\): .* - MissingData.cmake:2 \(ExternalData_Add_Test\) + MissingData.cmake:4 \(ExternalData_Expand_Arguments\) CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingData-stdout.txt b/Tests/RunCMake/ExternalData/MissingData-stdout.txt new file mode 100644 index 0000000..addd40e --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingData-stdout.txt @@ -0,0 +1 @@ +-- Missing data reference correctly transformed! diff --git a/Tests/RunCMake/ExternalData/MissingData.cmake b/Tests/RunCMake/ExternalData/MissingData.cmake index b3c8a5c..f5fefd5 100644 --- a/Tests/RunCMake/ExternalData/MissingData.cmake +++ b/Tests/RunCMake/ExternalData/MissingData.cmake @@ -1,5 +1,10 @@ include(ExternalData) -ExternalData_Add_Test(Data - NAME Test - COMMAND ${CMAKE_COMMAND} -E echo DATA{MissingData.txt} - ) + +set(output "${CMAKE_SOURCE_DIR}/MissingData.txt") +ExternalData_Expand_Arguments(Data args DATA{MissingData.txt}) +if("x${args}" STREQUAL "x${output}") + message(STATUS "Missing data reference correctly transformed!") +else() + message(FATAL_ERROR "Missing data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt new file mode 100644 index 0000000..315af5e --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt @@ -0,0 +1,15 @@ +CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): + Data file referenced by argument + + DATA{MissingData.txt,Data.txt} + + corresponds to source tree path + + MissingData.txt + + that does not exist as a file \(with or without an extension\)! +Call Stack \(most recent call first\): + .* + MissingDataWithAssociated.cmake:4 \(ExternalData_Expand_Arguments\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stdout.txt b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stdout.txt new file mode 100644 index 0000000..addd40e --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stdout.txt @@ -0,0 +1 @@ +-- Missing data reference correctly transformed! diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated.cmake b/Tests/RunCMake/ExternalData/MissingDataWithAssociated.cmake new file mode 100644 index 0000000..a4c4638 --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated.cmake @@ -0,0 +1,10 @@ +include(ExternalData) + +set(output "${CMAKE_BINARY_DIR}/MissingData.txt") +ExternalData_Expand_Arguments(Data args DATA{MissingData.txt,Data.txt}) +if("x${args}" STREQUAL "x${output}") + message(STATUS "Missing data reference correctly transformed!") +else() + message(FATAL_ERROR "Missing data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake index 93ff08f..04e3d59 100644 --- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake(LinkContentMD5) run_cmake(LinkContentSHA1) run_cmake(LinkDirectory1) run_cmake(MissingData) +run_cmake(MissingDataWithAssociated) run_cmake(NoLinkInSource) run_cmake(NoURLTemplates) run_cmake(NormalData1) diff --git a/Tests/RunCMake/FeatureSummary/CMakeLists.txt b/Tests/RunCMake/FeatureSummary/CMakeLists.txt new file mode 100644 index 0000000..72abfc8 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.11) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt new file mode 100644 index 0000000..9a3f023 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt @@ -0,0 +1,7 @@ +-- The following features have been enabled: + + \* Foo , Foo\. + +-- The following features have been disabled: + + \* Bar , Bar\. diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake new file mode 100644 index 0000000..ec5ebcb --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake @@ -0,0 +1,9 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt new file mode 100644 index 0000000..4d8f25f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt @@ -0,0 +1,7 @@ +-- The following features have been disabled: + + \* Bar , Bar\. + +-- The following features have been enabled: + + \* Foo , Foo\. diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake new file mode 100644 index 0000000..d04ba88 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake @@ -0,0 +1,9 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT DISABLED_FEATURES ENABLED_FEATURES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt new file mode 100644 index 0000000..18d9ebd --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + The WHAT argument of FEATURE_SUMMARY\(\) contains ALL, which cannot be + combined with other values\. +Call Stack \(most recent call first\): + FeatureSummaryWhatListAll\.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake new file mode 100644 index 0000000..1877ea5 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake @@ -0,0 +1,9 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT ENABLED_FEATURES ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt new file mode 100644 index 0000000..3ad3750 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + The WHAT argument of FEATURE_SUMMARY\(\) contains FOO, which is not a valid + value\. +Call Stack \(most recent call first\): + FeatureSummaryWhatListUnknown\.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake new file mode 100644 index 0000000..46088d4 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake @@ -0,0 +1,9 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT ENABLED_FEATURES FOO) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt new file mode 100644 index 0000000..240632d --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt @@ -0,0 +1 @@ + \* Foo , Foo\. diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake new file mode 100644 index 0000000..593dfb6 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake @@ -0,0 +1,9 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT ENABLED_FEATURES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt new file mode 100644 index 0000000..c78853c --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + The WHAT argument of FEATURE_SUMMARY\(\) contains FOO, which is not a valid + value\. +Call Stack \(most recent call first\): + FeatureSummaryWhatSingleUnknown\.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake new file mode 100644 index 0000000..c2d6d2e --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake @@ -0,0 +1,9 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT FOO) diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake new file mode 100644 index 0000000..1417338 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(FeatureSummaryWhatAll) +run_cmake(FeatureSummaryWhatSingle) +run_cmake(FeatureSummaryWhatSingleUnknown) +run_cmake(FeatureSummaryWhatList) +run_cmake(FeatureSummaryWhatListUnknown) +run_cmake(FeatureSummaryWhatListAll) diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt index 12cd3c7..bc0cf5d 100644 --- a/Tests/RunCMake/File_Generate/CMakeLists.txt +++ b/Tests/RunCMake/File_Generate/CMakeLists.txt @@ -1,3 +1,6 @@ cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) +if(NOT TEST_FILE) + set(TEST_FILE ${RunCMake_TEST}.cmake) +endif() +include(${TEST_FILE}) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt index 9fe39cc..e823b25 100644 --- a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt +++ b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt @@ -1,4 +1,4 @@ CMake Error at EmptyCondition1.cmake:2 \(file\): file Incorrect arguments to GENERATE subcommand. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt index 73d5f25..b042946 100644 --- a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt +++ b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt @@ -1,4 +1,4 @@ CMake Error at EmptyCondition2.cmake:2 \(file\): file CONDITION of sub-command GENERATE must not be empty if specified. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index f07431c..dee0692 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -1,10 +1,37 @@ include(RunCMake) run_cmake(CommandConflict) -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio" OR "${RunCMake_GENERATOR}" MATCHES "XCode" ) - run_cmake(OutputConflict) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio|Xcode" AND NOT XCODE_BELOW_2) + run_cmake(OutputConflict) endif() run_cmake(EmptyCondition1) run_cmake(EmptyCondition2) run_cmake(BadCondition) run_cmake(DebugEvaluate) + +set(timeformat "%Y%j%H%M%S") + +file(REMOVE "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt") +set(RunCMake_TEST_OPTIONS "-DTEST_FILE=WriteIfDifferent.cmake") +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/WriteIfDifferent-build") +run_cmake(WriteIfDifferent-prepare) +unset(RunCMake_TEST_OPTIONS) +unset(RunCMake_TEST_BINARY_DIR) +file(TIMESTAMP "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt" timestamp ${timeformat}) +if(NOT timestamp) + message(SEND_ERROR "Could not get timestamp for \"${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt\"") +endif() + +execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) + +set(RunCMake_TEST_NO_CLEAN ON) +run_cmake(WriteIfDifferent) +file(TIMESTAMP "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt" timestamp_after ${timeformat}) +if(NOT timestamp_after) + message(SEND_ERROR "Could not get timestamp for \"${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt\"") +endif() +unset(RunCMake_TEST_NO_CLEAN) + +if (NOT timestamp_after STREQUAL timestamp) + message(SEND_ERROR "WriteIfDifferent changed output file.") +endif() diff --git a/Tests/RunCMake/File_Generate/WriteIfDifferent-result.txt b/Tests/RunCMake/File_Generate/WriteIfDifferent-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/File_Generate/WriteIfDifferent-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/File_Generate/WriteIfDifferent-stderr.txt b/Tests/RunCMake/File_Generate/WriteIfDifferent-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/File_Generate/WriteIfDifferent-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake new file mode 100644 index 0000000..d1d832a --- /dev/null +++ b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake @@ -0,0 +1,5 @@ + +file(GENERATE + OUTPUT output_file.txt + CONTENT "123" +) diff --git a/Tests/RunCMake/FindPkgConfig/CMakeLists.txt b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt new file mode 100644 index 0000000..72abfc8 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.11) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake new file mode 100644 index 0000000..89ce4c6 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake @@ -0,0 +1,41 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH FALSE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + +if(WIN32) + set(expected_path "C:\\baz") +else() + set(expected_path "/baz") +endif() + + +pkg_check_modules(FOO "${expected_path}") + +if(NOT FOO_FOUND) + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() + + + +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) + +pkg_check_modules(BAR "${expected_path}" NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) + +if(NOT BAR_FOUND) + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake new file mode 100644 index 0000000..c903279 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake @@ -0,0 +1,51 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + + +if(NOT DEFINED CMAKE_SYSTEM_NAME + OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" + AND NOT CMAKE_CROSSCOMPILING)) + if(EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$") + # Cannot create directories for all the existing architectures... + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() + else() + # not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property + get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + if(uselib64) + 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") + endif() + endif() +else() + if(WIN32) + set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-foo\\lib\\pkgconfig;${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar\\lib\\pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() +endif() + + +pkg_check_modules(FOO "${expected_path}") + +if(NOT FOO_FOUND) + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() 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 new file mode 100644 index 0000000..a52bcbf --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake @@ -0,0 +1,51 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + + +if(NOT DEFINED CMAKE_SYSTEM_NAME + OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" + AND NOT CMAKE_CROSSCOMPILING)) + if(EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$") + # Cannot create directories for all the existing architectures... + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + endif() + else() + # not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property + get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + if(uselib64) + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + endif() + endif() +else() + if(WIN32) + set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-foo\\lib\\pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig") + endif() +endif() + + +pkg_check_modules(FOO "${expected_path}" NO_CMAKE_ENVIRONMENT_PATH) + +if(NOT FOO_FOUND) + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake new file mode 100644 index 0000000..2fabe5b --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake @@ -0,0 +1,51 @@ +# Needed for CMAKE_SYSTEM_NAME, CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS +enable_language(C) + +# Prepare environment and variables +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo") +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem") + set(ENV{PKG_CONFIG_PATH} "C:\\baz") +else() + set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh") + set(ENV{CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem") + set(ENV{PKG_CONFIG_PATH} "/baz") +endif() + + +find_package(PkgConfig) + + +if(NOT DEFINED CMAKE_SYSTEM_NAME + OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" + AND NOT CMAKE_CROSSCOMPILING)) + if(EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$") + # Cannot create directories for all the existing architectures... + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() + else() + # not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property + get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + if(uselib64) + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() + endif() +else() + if(WIN32) + set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar\\lib\\pkgconfig") + else() + set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig") + endif() +endif() + + +pkg_check_modules(FOO "${expected_path}" NO_CMAKE_PATH) + +if(NOT FOO_FOUND) + message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake new file mode 100644 index 0000000..bca93bb --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake @@ -0,0 +1,6 @@ +include(RunCMake) + +run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH) +run_cmake(FindPkgConfig_PKGCONFIG_PATH) +run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH) +run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH) diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat new file mode 100755 index 0000000..f2f86b0 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat @@ -0,0 +1,18 @@ +@ECHO OFF +IF "%1"=="" ( + EXIT /B 255 +) +IF "%1"=="--version" ( + ECHO 0.0-cmake-dummy + EXIT /B 0 +) + +IF "%1"=="--exists" ( + SHIFT + ECHO Expected: %* + ECHO Found: %PKG_CONFIG_PATH% + IF NOT "%*"=="%PKG_CONFIG_PATH%" ( + EXIT /B 1 + ) +) +EXIT /B 0 diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh new file mode 100755 index 0000000..852e841 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# This is a replacement for pkg-config that compares the string passed +# 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 + echo "Expected: $@" + echo "Found: ${PKG_CONFIG_PATH}" + [ "$@" = "${PKG_CONFIG_PATH}" ] || exit 1 + ;; + *) + exit 255 + ;; +esac diff --git a/Tests/RunCMake/FindPkgConfig/pc-bar/lib/i386-linux-gnu/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-bar/lib/i386-linux-gnu/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-bar/lib/i386-linux-gnu/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-bar/lib/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-bar/lib/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-bar/lib/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-bar/lib/x86_64-linux-gnu/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-bar/lib/x86_64-linux-gnu/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-bar/lib/x86_64-linux-gnu/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-bar/lib64/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-bar/lib64/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-bar/lib64/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-foo/lib/i386-linux-gnu/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-foo/lib/i386-linux-gnu/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-foo/lib/i386-linux-gnu/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-foo/lib/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-foo/lib/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-foo/lib/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-foo/lib/x86_64-linux-gnu/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-foo/lib/x86_64-linux-gnu/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-foo/lib/x86_64-linux-gnu/pkgconfig/.placeholder diff --git a/Tests/RunCMake/FindPkgConfig/pc-foo/lib64/pkgconfig/.placeholder b/Tests/RunCMake/FindPkgConfig/pc-foo/lib64/pkgconfig/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-foo/lib64/pkgconfig/.placeholder diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt new file mode 100644 index 0000000..831edad --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NonValidCompiler-TARGET_PDB_FILE.cmake:6 \(file\): + Error evaluating generator expression: + + \$<TARGET_PDB_FILE:empty> + + TARGET_PDB_FILE is not supported by the target linker. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake new file mode 100644 index 0000000..84a2b2e --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.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_PDB_FILE:empty>]" +) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt new file mode 100644 index 0000000..dd7a183 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget-CXX_COMPILER_ID.cmake:4 \(add_custom_command\): + Error evaluating generator expression: + + \$<CXX_COMPILER_ID> + + \$<CXX_COMPILER_ID> may only be used with binary targets. It may not be + used with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake new file mode 100644 index 0000000..7dd38da --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<CXX_COMPILER_ID>.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp") diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt new file mode 100644 index 0000000..d4a064a --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget-CXX_COMPILER_VERSION.cmake:4 \(add_custom_command\): + Error evaluating generator expression: + + \$<CXX_COMPILER_VERSION> + + \$<CXX_COMPILER_VERSION> may only be used with binary targets. It may not + be used with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake new file mode 100644 index 0000000..1afb2b5 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<CXX_COMPILER_VERSION>.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp") diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt new file mode 100644 index 0000000..b8e53ed --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget-C_COMPILER_ID.cmake:4 \(add_custom_command\): + Error evaluating generator expression: + + \$<C_COMPILER_ID> + + \$<C_COMPILER_ID> may only be used with binary targets. It may not be used + with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake new file mode 100644 index 0000000..2d92ee3 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_ID>.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp") diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt new file mode 100644 index 0000000..551efe9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget-C_COMPILER_VERSION.cmake:4 \(add_custom_command\): + Error evaluating generator expression: + + \$<C_COMPILER_VERSION> + + \$<C_COMPILER_VERSION> may only be used with binary targets. It may not be + used with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake new file mode 100644 index 0000000..9b8a531 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_VERSION>.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp") diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt new file mode 100644 index 0000000..e5f21e2 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NonValidTarget-TARGET_PDB_FILE.cmake:6 \(file\): + Error evaluating generator expression: + + \$<TARGET_PDB_FILE:empty> + + TARGET_PDB_FILE is allowed only for targets with linker created artifacts. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake new file mode 100644 index 0000000..84a2b2e --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.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_PDB_FILE:empty>]" +) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt new file mode 100644 index 0000000..0e87538 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NonValidTarget-TARGET_POLICY.cmake:4 \(add_custom_command\): + Error evaluating generator expression: + + \$<TARGET_POLICY:CMP0004> + + \$<TARGET_POLICY:prop> may only be used with binary targets. It may not be + used with add_custom_command or add_custom_target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake new file mode 100644 index 0000000..10b37b5 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<TARGET_POLICY:CMP0004>.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp") diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt new file mode 100644 index 0000000..08ad3c2 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at NonValidTarget-TARGET_PROPERTY.cmake:4 \(add_custom_command\): + Error evaluating generator expression: + + \$<TARGET_PROPERTY:NotAProperty> + + \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not + be used with add_custom_command or add_custom_target. Specify the target + to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake new file mode 100644 index 0000000..64abc5f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<TARGET_PROPERTY:NotAProperty>.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp") diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index f3f99ed..6c32393 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -10,3 +10,16 @@ run_cmake(BadTargetName) run_cmake(BadTargetTypeObject) run_cmake(BadInstallPrefix) run_cmake(CMP0044-WARN) +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_PROPERTY) +run_cmake(NonValidTarget-TARGET_POLICY) + +if(LINKER_SUPPORTS_PDB) + run_cmake(NonValidTarget-TARGET_PDB_FILE) + run_cmake(ValidTarget-TARGET_PDB_FILE) +else() + run_cmake(NonValidCompiler-TARGET_PDB_FILE) +endif() diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake new file mode 100644 index 0000000..748d14f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake @@ -0,0 +1,17 @@ +file(STRINGS ${RunCMake_TEST_BINARY_DIR}/test.txt TEST_TXT) + +list(GET TEST_TXT 0 PDB_PATH) +list(GET TEST_TXT 1 PDB_NAME) +list(GET TEST_TXT 2 PDB_DIR) + +if(NOT PDB_PATH MATCHES "empty\\.pdb") + message(FATAL_ERROR "unexpected PDB_PATH [${PDB_PATH}]") +endif() + +if(NOT PDB_NAME STREQUAL "empty.pdb") + message(FATAL_ERROR "unexpected PDB_NAME [${PDB_NAME}]") +endif() + +if(PDB_DIR MATCHES "empty\\.pdb") + message(FATAL_ERROR "unexpected PDB_DIR [${PDB_DIR}]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake new file mode 100644 index 0000000..38e47f9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake @@ -0,0 +1,19 @@ + +enable_language(C) + +add_library(empty SHARED empty.c) + +if(CMAKE_CONFIGURATION_TYPES) + list(GET CMAKE_CONFIGURATION_TYPES 0 FIRST_CONFIG) + set(GENERATE_CONDITION CONDITION $<CONFIG:${FIRST_CONFIG}>) +endif() + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt" + CONTENT +[[$<TARGET_PDB_FILE:empty> +$<TARGET_PDB_FILE_NAME:empty> +$<TARGET_PDB_FILE_DIR:empty> +]] + ${GENERATE_CONDITION} +) diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform-result.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatform-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatform-stderr.txt new file mode 100644 index 0000000..e315714 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + .* + + does not support platform specification, but platform + + Bad Platform + + was specified.$ diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake b/Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake new file mode 100644 index 0000000..1c544b0 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake @@ -0,0 +1 @@ +set(CMAKE_GENERATOR_PLATFORM "Bad Platform") diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform.cmake b/Tests/RunCMake/GeneratorPlatform/BadPlatform.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-result.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-stderr.txt new file mode 100644 index 0000000..e315714 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + .* + + does not support platform specification, but platform + + Bad Platform + + was specified.$ diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain.cmake b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorPlatform/NoPlatform-result.txt b/Tests/RunCMake/GeneratorPlatform/NoPlatform-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/NoPlatform-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt b/Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt new file mode 100644 index 0000000..e1c0da4 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/NoPlatform-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoPlatform.cmake:2 \(message\): + CMAKE_GENERATOR_PLATFORM is empty as expected. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake b/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake new file mode 100644 index 0000000..1e0ca6d --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/NoPlatform.cmake @@ -0,0 +1,7 @@ +if("x${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x") + message(FATAL_ERROR "CMAKE_GENERATOR_PLATFORM is empty as expected.") +else() + message(FATAL_ERROR + "CMAKE_GENERATOR_PLATFORM is \"${CMAKE_GENERATOR_PLATFORM}\" " + "but should be empty!") +endif() diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake new file mode 100644 index 0000000..4d0a0a1 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake @@ -0,0 +1,28 @@ +include(RunCMake) + +set(RunCMake_GENERATOR_PLATFORM "") +run_cmake(NoPlatform) + +if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124])( 20[0-9][0-9])?$") + set(RunCMake_GENERATOR_PLATFORM "x64") + run_cmake(x64Platform) +else() + set(RunCMake_GENERATOR_PLATFORM "Bad Platform") + run_cmake(BadPlatform) +endif() + +set(RunCMake_GENERATOR_TOOLSET "") + +set(RunCMake_TEST_OPTIONS -A "Extra Platform") +run_cmake(TwoPlatforms) +unset(RunCMake_TEST_OPTIONS) + +if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124])( 20[0-9][0-9])?$") + set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestPlatform-toolchain.cmake) + run_cmake(TestPlatformToolchain) + unset(RunCMake_TEST_OPTIONS) +else() + set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/BadPlatform-toolchain.cmake) + run_cmake(BadPlatformToolchain) + unset(RunCMake_TEST_OPTIONS) +endif() diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake b/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake new file mode 100644 index 0000000..763478c --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake @@ -0,0 +1 @@ +set(CMAKE_GENERATOR_PLATFORM "Test Platform") diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-result.txt b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt new file mode 100644 index 0000000..b9bb3b2 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at TestPlatformToolchain.cmake:[0-9]+ \(message\): + CMAKE_GENERATOR_PLATFORM is "Test Platform" as expected. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at TestPlatformToolchain.cmake:[0-9]+ \(message\): + CMAKE_VS_PLATFORM_NAME is "Test Platform" as expected. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake new file mode 100644 index 0000000..c4430a5 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake @@ -0,0 +1,16 @@ +if("x${CMAKE_GENERATOR_PLATFORM}" STREQUAL "xTest Platform") + message(SEND_ERROR "CMAKE_GENERATOR_PLATFORM is \"Test Platform\" as expected.") +else() + message(FATAL_ERROR + "CMAKE_GENERATOR_PLATFORM is \"${CMAKE_GENERATOR_PLATFORM}\" " + "but should be \"Test Platform\"!") +endif() +if(CMAKE_GENERATOR MATCHES "Visual Studio") + if("x${CMAKE_VS_PLATFORM_NAME}" STREQUAL "xTest Platform") + message(SEND_ERROR "CMAKE_VS_PLATFORM_NAME is \"Test Platform\" as expected.") + else() + message(FATAL_ERROR + "CMAKE_VS_PLATFORM_NAME is \"${CMAKE_VS_PLATFORM_NAME}\" " + "but should be \"Test Platform\"!") + endif() +endif() diff --git a/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-result.txt b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt new file mode 100644 index 0000000..90e4eca --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt @@ -0,0 +1 @@ +CMake Error: Multiple -A options not allowed diff --git a/Tests/RunCMake/GeneratorPlatform/TwoPlatforms.cmake b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt b/Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt new file mode 100644 index 0000000..05a83ff --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/x64Platform-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_GENERATOR_PLATFORM is 'x64' as expected. +-- CMAKE_VS_PLATFORM_NAME is 'x64' as expected. diff --git a/Tests/RunCMake/GeneratorPlatform/x64Platform.cmake b/Tests/RunCMake/GeneratorPlatform/x64Platform.cmake new file mode 100644 index 0000000..a23bdc7 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/x64Platform.cmake @@ -0,0 +1,7 @@ +foreach(v CMAKE_GENERATOR_PLATFORM CMAKE_VS_PLATFORM_NAME) + if("x${${v}}" STREQUAL "xx64") + message(STATUS "${v} is 'x64' as expected.") + else() + message(FATAL_ERROR "${v} is '${${v}}' but should be 'x64'!") + endif() +endforeach() diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt index bf1f190..d0d526c 100644 --- a/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt +++ b/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt @@ -1,4 +1,4 @@ -CMake Error: +CMake Error at CMakeLists.txt:[0-9]+ \(project\): Generator .* diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake b/Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake new file mode 100644 index 0000000..7bbf327 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake @@ -0,0 +1 @@ +set(CMAKE_GENERATOR_TOOLSET "Bad Toolset") diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt new file mode 100644 index 0000000..d0d526c --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + .* + + does not support toolset specification, but toolset + + Bad Toolset + + was specified.$ diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.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 1ccc1ad..6220657 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -3,7 +3,7 @@ include(RunCMake) set(RunCMake_GENERATOR_TOOLSET "") run_cmake(NoToolset) -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012]|Xcode" AND NOT XCODE_BELOW_3) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[0124]|Xcode" AND NOT XCODE_BELOW_3) set(RunCMake_GENERATOR_TOOLSET "Test Toolset") run_cmake(TestToolset) else() @@ -12,6 +12,17 @@ else() endif() set(RunCMake_GENERATOR_TOOLSET "") + set(RunCMake_TEST_OPTIONS -T "Extra Toolset") run_cmake(TwoToolsets) unset(RunCMake_TEST_OPTIONS) + +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[0124]|Xcode" AND NOT XCODE_BELOW_3) + set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestToolset-toolchain.cmake) + run_cmake(TestToolsetToolchain) + unset(RunCMake_TEST_OPTIONS) +else() + set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/BadToolset-toolchain.cmake) + run_cmake(BadToolsetToolchain) + unset(RunCMake_TEST_OPTIONS) +endif() diff --git a/Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake b/Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake new file mode 100644 index 0000000..bee2ae4 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake @@ -0,0 +1 @@ +set(CMAKE_GENERATOR_TOOLSET "Test Toolset") diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt new file mode 100644 index 0000000..0623e90 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at TestToolsetToolchain.cmake:[0-9]+ \(message\): + CMAKE_GENERATOR_TOOLSET is "Test Toolset" as expected. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at TestToolsetToolchain.cmake:[0-9]+ \(message\): + CMAKE_(VS|XCODE)_PLATFORM_TOOLSET is "Test Toolset" as expected. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake new file mode 100644 index 0000000..7c1c415 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake @@ -0,0 +1,25 @@ +if("x${CMAKE_GENERATOR_TOOLSET}" STREQUAL "xTest Toolset") + message(SEND_ERROR "CMAKE_GENERATOR_TOOLSET is \"Test Toolset\" as expected.") +else() + message(FATAL_ERROR + "CMAKE_GENERATOR_TOOLSET is \"${CMAKE_GENERATOR_TOOLSET}\" " + "but should be \"Test Toolset\"!") +endif() +if(CMAKE_GENERATOR MATCHES "Visual Studio") + if("x${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "xTest Toolset") + message(SEND_ERROR "CMAKE_VS_PLATFORM_TOOLSET is \"Test Toolset\" as expected.") + else() + message(FATAL_ERROR + "CMAKE_VS_PLATFORM_TOOLSET is \"${CMAKE_VS_PLATFORM_TOOLSET}\" " + "but should be \"Test Toolset\"!") + endif() +endif() +if(CMAKE_GENERATOR MATCHES "Xcode") + if("x${CMAKE_XCODE_PLATFORM_TOOLSET}" STREQUAL "xTest Toolset") + message(SEND_ERROR "CMAKE_XCODE_PLATFORM_TOOLSET is \"Test Toolset\" as expected.") + else() + message(FATAL_ERROR + "CMAKE_XCODE_PLATFORM_TOOLSET is \"${CMAKE_XCODE_PLATFORM_TOOLSET}\" " + "but should be \"Test Toolset\"!") + endif() +endif() diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt index a5d5d50..3a7f480 100644 --- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt +++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt @@ -1,7 +1,9 @@ -CMake Error: +CMake Error at LINK_LANGUAGE-genex.cmake:[0-9]+ \(target_link_libraries\): Error evaluating generator expression: \$<TARGET_PROPERTY:LINKER_LANGUAGE> LINKER_LANGUAGE target property can not be used while evaluating link - libraries + libraries for a static library +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt index 2d7a3c9..d8bc238 100644 --- a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt @@ -1,7 +1,9 @@ -CMake Error: +CMake Error at link-libraries-TARGET_FILE-genex.cmake:[0-9]+ \(target_link_libraries\): Error evaluating generator expression: \$<TARGET_FILE:foo> Expressions which require the linker language may not be used while evaluating link libraries +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/BadObjSource1-stderr.txt b/Tests/RunCMake/ObjectLibrary/BadObjSource1-stderr.txt index b31225b..a09552b 100644 --- a/Tests/RunCMake/ObjectLibrary/BadObjSource1-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/BadObjSource1-stderr.txt @@ -3,6 +3,7 @@ CMake Error at BadObjSource1.cmake:1 \(add_library\): bad.def - but may contain only headers and sources that compile. + but may contain only sources that compile, header files, and other files + that would not affect linking of a normal library. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/BadObjSource2-stderr.txt b/Tests/RunCMake/ObjectLibrary/BadObjSource2-stderr.txt index 906cf0b..b91ffd0 100644 --- a/Tests/RunCMake/ObjectLibrary/BadObjSource2-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/BadObjSource2-stderr.txt @@ -3,6 +3,7 @@ CMake Error at BadObjSource2.cmake:1 \(add_library\): bad.obj - but may contain only headers and sources that compile. + but may contain only sources that compile, header files, and other files + that would not affect linking of a normal library. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/BadSourceExpression1-stderr.txt b/Tests/RunCMake/ObjectLibrary/BadSourceExpression1-stderr.txt index a1cac36..859dc3f 100644 --- a/Tests/RunCMake/ObjectLibrary/BadSourceExpression1-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/BadSourceExpression1-stderr.txt @@ -1,6 +1,8 @@ CMake Error at BadSourceExpression1.cmake:1 \(add_library\): - Unrecognized generator expression: + Error evaluating generator expression: \$<BAD_EXPRESSION> + + Expression did not evaluate to a known generator expression Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/BadSourceExpression2-stderr.txt b/Tests/RunCMake/ObjectLibrary/BadSourceExpression2-stderr.txt index f1fcbe8..7060c61 100644 --- a/Tests/RunCMake/ObjectLibrary/BadSourceExpression2-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/BadSourceExpression2-stderr.txt @@ -1,4 +1,8 @@ CMake Error at BadSourceExpression2.cmake:1 \(add_library\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:DoesNotExist> + Objects of target "DoesNotExist" referenced but no such target exists. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/BadSourceExpression3-stderr.txt b/Tests/RunCMake/ObjectLibrary/BadSourceExpression3-stderr.txt index ad14a35..838b3d8 100644 --- a/Tests/RunCMake/ObjectLibrary/BadSourceExpression3-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/BadSourceExpression3-stderr.txt @@ -1,4 +1,8 @@ CMake Error at BadSourceExpression3.cmake:2 \(add_library\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NotObjLib> + Objects of target "NotObjLib" referenced but is not an OBJECT library. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 1d1c523..56d69c8 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -25,7 +25,9 @@ function(run_cmake test) unset(expect_std${o}) endif() endforeach() - set(RunCMake_TEST_SOURCE_DIR "${top_src}") + if (NOT RunCMake_TEST_SOURCE_DIR) + set(RunCMake_TEST_SOURCE_DIR "${top_src}") + endif() if(NOT RunCMake_TEST_BINARY_DIR) set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build") endif() @@ -51,8 +53,10 @@ function(run_cmake test) execute_process( COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}" -G "${RunCMake_GENERATOR}" + -A "${RunCMake_GENERATOR_PLATFORM}" -T "${RunCMake_GENERATOR_TOOLSET}" -DRunCMake_TEST=${test} + --no-warn-unused-cli ${RunCMake_TEST_OPTIONS} WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" OUTPUT_VARIABLE actual_stdout diff --git a/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt new file mode 100644 index 0000000..5dcd4d7 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt @@ -0,0 +1 @@ +-->wrong<-- diff --git a/Tests/RunCMake/Syntax/AtWithVariable.cmake b/Tests/RunCMake/Syntax/AtWithVariable.cmake new file mode 100644 index 0000000..2bbf61d --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariable.cmake @@ -0,0 +1,9 @@ +set(right "wrong") +set(var "\${right}") +# Expanded here. +set(ref "@var@") + +# 'right' is dereferenced because 'var' was dereferenced when +# assigning to 'ref' above. +string(CONFIGURE "${ref}" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/AtWithVariableAtOnly-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariableAtOnly-stderr.txt new file mode 100644 index 0000000..cbd1be4 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableAtOnly-stderr.txt @@ -0,0 +1 @@ +-->\${right}<-- diff --git a/Tests/RunCMake/Syntax/AtWithVariableAtOnly.cmake b/Tests/RunCMake/Syntax/AtWithVariableAtOnly.cmake new file mode 100644 index 0000000..e06484c --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableAtOnly.cmake @@ -0,0 +1,8 @@ +set(right "wrong") +set(var "\${right}") +# Expanded here. +set(ref "@var@") + +# No dereference done at all. +string(CONFIGURE "${ref}" output @ONLY) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/AtWithVariableAtOnlyFile-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariableAtOnlyFile-stderr.txt new file mode 100644 index 0000000..90bffb6 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableAtOnlyFile-stderr.txt @@ -0,0 +1,5 @@ +-->==>\${right}<== +==><== +==>\${var}<== +==>\${empty}<== +<-- diff --git a/Tests/RunCMake/Syntax/AtWithVariableAtOnlyFile.cmake b/Tests/RunCMake/Syntax/AtWithVariableAtOnlyFile.cmake new file mode 100644 index 0000000..bdd7bcd --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableAtOnlyFile.cmake @@ -0,0 +1,9 @@ +set(right "wrong") +set(var "\${right}") + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/atfile.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/atfile.txt" + @ONLY) +file(READ "${CMAKE_CURRENT_BINARY_DIR}/atfile.txt" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansion-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansion-stderr.txt new file mode 100644 index 0000000..cbd1be4 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansion-stderr.txt @@ -0,0 +1 @@ +-->\${right}<-- diff --git a/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansion.cmake b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansion.cmake new file mode 100644 index 0000000..840c7f0 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansion.cmake @@ -0,0 +1,8 @@ +# Literal since 'var' is not defined. +set(ref "@var@") +set(right "wrong") +set(var "\${right}") + +# 'var' is dereferenced here. +string(CONFIGURE "${ref}" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansionAtOnly-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansionAtOnly-stderr.txt new file mode 100644 index 0000000..cbd1be4 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansionAtOnly-stderr.txt @@ -0,0 +1 @@ +-->\${right}<-- diff --git a/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansionAtOnly.cmake b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansionAtOnly.cmake new file mode 100644 index 0000000..b657506 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableEmptyExpansionAtOnly.cmake @@ -0,0 +1,8 @@ +# Literal since 'var' is not defined. +set(ref "@var@") +set(right "wrong") +set(var "\${right}") + +# 'var' is dereferenced, but now 'right' +string(CONFIGURE "${ref}" output @ONLY) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/AtWithVariableFile-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariableFile-stderr.txt new file mode 100644 index 0000000..43f029f --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableFile-stderr.txt @@ -0,0 +1,5 @@ +-->==>\${right}<== +==><== +==>\${right}<== +==><== +<-- diff --git a/Tests/RunCMake/Syntax/AtWithVariableFile.cmake b/Tests/RunCMake/Syntax/AtWithVariableFile.cmake new file mode 100644 index 0000000..c709099 --- /dev/null +++ b/Tests/RunCMake/Syntax/AtWithVariableFile.cmake @@ -0,0 +1,8 @@ +set(right "wrong") +set(var "\${right}") + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/atfile.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/atfile.txt") +file(READ "${CMAKE_CURRENT_BINARY_DIR}/atfile.txt" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt new file mode 100644 index 0000000..e3e5332 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt @@ -0,0 +1 @@ +^-->\${right}<--$ diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake b/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake new file mode 100644 index 0000000..40dbe46 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0053 NEW) + +set(right "wrong") +set(var "\${right}") +# Not expanded here with the new policy. +set(ref "@var@") + +string(CONFIGURE "${ref}" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt new file mode 100644 index 0000000..acfa30a --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt @@ -0,0 +1 @@ +^-->wrong<--$ diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake new file mode 100644 index 0000000..666f107 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0053 OLD) + +set(right "wrong") +set(var "\${right}") +# Expanded here with the old policy. +set(ref "@var@") + +string(CONFIGURE "${ref}" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt new file mode 100644 index 0000000..ec37021 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt @@ -0,0 +1,27 @@ +^CMake Warning \(dev\) at CMP0053-At-WARN-newlines.cmake:4 \(set\): + Policy CMP0053 is not set: Simplify variable reference and escape sequence + evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + For input: + + ' + @var@ + ' + + the old evaluation rules produce: + + ' + \${right} + ' + + but the new evaluation rules produce: + + ' + @var@ + ' + + Using the old result for compatibility since the policy is not set. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake new file mode 100644 index 0000000..c493505 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake @@ -0,0 +1,6 @@ +set(right "wrong") +set(var "\${right}") +# Expanded here with the old policy. +set(ref " +@var@ +") diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt new file mode 100644 index 0000000..697b7b3 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt @@ -0,0 +1,21 @@ +^CMake Warning \(dev\) at CMP0053-At-WARN.cmake:4 \(set\): + Policy CMP0053 is not set: Simplify variable reference and escape sequence + evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + For input: + + '@var@' + + the old evaluation rules produce: + + '\${right}' + + but the new evaluation rules produce: + + '@var@' + + Using the old result for compatibility since the policy is not set. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake new file mode 100644 index 0000000..19c7f53 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake @@ -0,0 +1,4 @@ +set(right "wrong") +set(var "\${right}") +# Expanded here with the old policy. +set(ref "@var@") diff --git a/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt new file mode 100644 index 0000000..09c7e7c --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt @@ -0,0 +1,56 @@ +^CMake Warning \(dev\) at CMP0053-NUL.cmake:1 \(set\): + Policy CMP0053 is not set: Simplify variable reference and escape sequence + evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + For input: + + '\\0' + + the old evaluation rules produce: + + '' + + but the new evaluation rules produce an error: + + Syntax error in cmake code at + .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:1 + when parsing string + \\0 + Invalid character escape '\\0'. + + Using the old result for compatibility since the policy is not set. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMP0053-NUL.cmake:2 \(set\): + Policy CMP0053 is not set: Simplify variable reference and escape sequence + evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + For input: + + '\\0' + + the old evaluation rules produce: + + '' + + but the new evaluation rules produce an error: + + Syntax error in cmake code at + .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2 + when parsing string + \\0 + Invalid character escape '\\0'. + + Using the old result for compatibility since the policy is not set. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +--><-- +--><-- +--><-- +--><--$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NUL.cmake b/Tests/RunCMake/Syntax/CMP0053-NUL.cmake new file mode 100644 index 0000000..9ae0906 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NUL.cmake @@ -0,0 +1,6 @@ +set(qnul "\0") +set(nul \0) +message(-->${nul}<--) +message(-->${qnul}<--) +message("-->${nul}<--") +message("-->${qnul}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt new file mode 100644 index 0000000..9575778 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0053-NameWithCarriageReturn.cmake:2 \(message\): + message called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake new file mode 100644 index 0000000..b8a403d --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message(${var\rwith\rcarriagereturn}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake new file mode 100644 index 0000000..bb0d93f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message("${var\rwith\rcarriagereturn}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt new file mode 100644 index 0000000..df67d37 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0053-NameWithEscapedSpaces.cmake:2 \(message\): + message called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake new file mode 100644 index 0000000..805b2ca --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message(${var\ with\ escaped\ space}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake new file mode 100644 index 0000000..58d8e8f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message("${var\ with\ escaped\ space}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt new file mode 100644 index 0000000..059044f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0053-NameWithEscapedTabs.cmake:2 \(message\): + message called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake new file mode 100644 index 0000000..214ab5d --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message(${var\ with\ escaped\ tab}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake new file mode 100644 index 0000000..aa5123f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message("${var\ with\ escaped\ tab}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt new file mode 100644 index 0000000..41f86e6 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0053-NameWithNewline.cmake:2 \(message\): + message called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake new file mode 100644 index 0000000..45b532e --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message(${var\nwith\nnewline}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake new file mode 100644 index 0000000..6fe568d --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message("${var\nwith\nnewline}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt new file mode 100644 index 0000000..95e8684 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at CMP0053-NameWithSpaces.cmake:2 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake:2 + + when parsing string + + \${var + + There is an unterminated variable reference. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake new file mode 100644 index 0000000..dae7d25 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message(${var with space}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt new file mode 100644 index 0000000..c4f3cfe --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at CMP0053-NameWithSpacesQuoted.cmake:2 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake:2 + + when parsing string + + \${var with space} + + Invalid character \(' '\) in a variable name: 'var' +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake new file mode 100644 index 0000000..e252cff --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message("${var with space}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt new file mode 100644 index 0000000..b1678b3 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at CMP0053-NameWithTabs.cmake:2 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake:2 + + when parsing string + + \${var + + There is an unterminated variable reference. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake new file mode 100644 index 0000000..45e3045 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message(${var with tab}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt new file mode 100644 index 0000000..78adb5e --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at CMP0053-NameWithTabsQuoted.cmake:2 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake:2 + + when parsing string + + \${var with tab} + + Invalid character \(' '\) in a variable name: 'var' +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake new file mode 100644 index 0000000..498675f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0053 NEW) +message("${var with tab}") diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt new file mode 100644 index 0000000..7020c7e --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt @@ -0,0 +1 @@ +-->value<-- diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake b/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake new file mode 100644 index 0000000..b5cdf0f --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0053 NEW) +set("ENV{e(x)}" value) +message(-->$ENV{e\(x\)}<--) diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt new file mode 100644 index 0000000..7020c7e --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt @@ -0,0 +1 @@ +-->value<-- diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake new file mode 100644 index 0000000..5559d4b --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0053 NEW) +set("ENV{e(x)}" value) +message("-->$ENV{e\(x\)}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt new file mode 100644 index 0000000..c706939 --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt @@ -0,0 +1,28 @@ +^CMake Warning \(dev\) at CMP0053-WARN.cmake:2 \(message\): + Policy CMP0053 is not set: Simplify variable reference and escape sequence + evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + For input: + + '\\' + + the old evaluation rules produce: + + '\\' + + but the new evaluation rules produce an error: + + Syntax error in cmake code at + .*/Tests/RunCMake/Syntax/CMP0053-WARN.cmake:2 + when parsing string + \\ + Invalid character escape '\\' \(at end of input\). + + Using the old result for compatibility since the policy is not set. +Call Stack \(most recent call first\): + CMP0053-WARN.cmake:5 \(escape\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +\\$ diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake new file mode 100644 index 0000000..6e8b07b --- /dev/null +++ b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake @@ -0,0 +1,5 @@ +macro (escape str) + message("${str}") +endmacro () + +escape("\\") diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt index 618473a..4b3de84 100644 --- a/Tests/RunCMake/Syntax/CMakeLists.txt +++ b/Tests/RunCMake/Syntax/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Syntax/Escape2-result.txt b/Tests/RunCMake/Syntax/Escape2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/Escape2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/Escape2-stderr.txt b/Tests/RunCMake/Syntax/Escape2-stderr.txt new file mode 100644 index 0000000..cc3bdf0 --- /dev/null +++ b/Tests/RunCMake/Syntax/Escape2-stderr.txt @@ -0,0 +1,13 @@ +CMake Error at Escape2.cmake:4 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/Escape2.cmake:4 + + when parsing string + + \\ + + Invalid character escape '\\' \(at end of input\). +Call Stack \(most recent call first\): + Escape2.cmake:7 \(escape\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/Escape2.cmake b/Tests/RunCMake/Syntax/Escape2.cmake new file mode 100644 index 0000000..078a822 --- /dev/null +++ b/Tests/RunCMake/Syntax/Escape2.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0053 NEW) + +macro (escape str) + message("${str}") +endmacro () + +escape("\\") diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-result.txt b/Tests/RunCMake/Syntax/EscapeChar-char-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeChar-char-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in new file mode 100644 index 0000000..d1d908c --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in @@ -0,0 +1,12 @@ +CMake Error at EscapeChar-@char@-@testnum@.cmake:3 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/EscapeChar-@char@-@testnum@.cmake:3 + + when parsing string + + -->\\@char@<-- + + Invalid character escape '\\@char@'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in new file mode 100644 index 0000000..6f265e5 --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0053 NEW) + +message("-->\@char@<--") diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt b/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt new file mode 100644 index 0000000..e658de7 --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt @@ -0,0 +1,12 @@ +^-->semicolon<-- +-->dollar<-- +-->brace<-- +-->bracket<-- +-->newline<-- +-->octothorpe<-- +-->splat<-- +-->caret<-- +-->paren<-- +-->dquote<-- +-->top-levelsemicolon<-- +-->top-level;escaped;semicolon<--$ diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake new file mode 100644 index 0000000..e9c568d --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake @@ -0,0 +1,26 @@ +cmake_policy(SET CMP0053 NEW) + +set("semicolon;in;name" semicolon) +set("dollar$in$name" dollar) +set("brace{in}name" brace) +set("bracket[in]name" bracket) +set("newline\nin\nname" newline) +set("octothorpe\#in\#name" octothorpe) +set("splat\@in\@name" splat) +set("caret\^in\^name" caret) +set("paren\(in\)name" paren) +set("dquote\"in\"name" dquote) + +message("-->${semicolon\;in\;name}<--") +message("-->${dollar\$in\$name}<--") +message("-->${brace\{in\}name}<--") +message("-->${bracket\[in\]name}<--") +message("-->${newline\nin\nname}<--") +message("-->${octothorpe\#in\#name}<--") +message("-->${splat\@in\@name}<--") +message("-->${caret\^in\^name}<--") +message("-->${paren\(in\)name}<--") +message("-->${dquote\"in\"name}<--") + +message(-->top-level;semicolon<--) +message(-->top-level\;escaped\;semicolon<--) diff --git a/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake new file mode 100644 index 0000000..eef01a0 --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake @@ -0,0 +1,42 @@ +set(disallowed_chars + a b c d e f g h i j l m o p q s u v w x y z + A B C D E F G H I J L M N O P Q R S T U V W X Y Z + 0 1 2 3 4 5 6 6 7 8 9) +set(testnum 0) + +configure_file( + "${RunCMake_SOURCE_DIR}/CMakeLists.txt" + "${RunCMake_BINARY_DIR}/CMakeLists.txt" + COPYONLY) + +foreach (char IN LISTS disallowed_chars) + configure_file( + "${RunCMake_SOURCE_DIR}/EscapeChar-char.cmake.in" + "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}.cmake" + @ONLY) + configure_file( + "${RunCMake_SOURCE_DIR}/EscapeChar-char-stderr.txt.in" + "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-stderr.txt" + @ONLY) + configure_file( + "${RunCMake_SOURCE_DIR}/EscapeChar-char-result.txt" + "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-result.txt" + COPYONLY) + + math(EXPR testnum "${testnum} + 1") +endforeach () + +function (run_tests) + set(GENERATED_RUNCMAKE_TESTS TRUE) + # Find the tests in the binary directory. + set(RunCMake_SOURCE_DIR "${RunCMake_BINARY_DIR}") + + set(testnum 0) + foreach (char IN LISTS disallowed_chars) + run_cmake("EscapeChar-${char}-${testnum}") + + math(EXPR testnum "${testnum} + 1") + endforeach () +endfunction () + +run_tests() diff --git a/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt b/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt new file mode 100644 index 0000000..077272d --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt @@ -0,0 +1 @@ +-->"<-- diff --git a/Tests/RunCMake/Syntax/EscapeQuotes.cmake b/Tests/RunCMake/Syntax/EscapeQuotes.cmake new file mode 100644 index 0000000..46d2b6f --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapeQuotes.cmake @@ -0,0 +1,9 @@ +set(var "\"") +set(ref "@var@") +set(rref "\${var}") + +string(CONFIGURE "${ref}" output ESCAPE_QUOTES) +message("-->${output}<--") + +string(CONFIGURE "${rref}" output ESCAPE_QUOTES) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/EscapedAt-stderr.txt b/Tests/RunCMake/Syntax/EscapedAt-stderr.txt new file mode 100644 index 0000000..a51c0d3 --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapedAt-stderr.txt @@ -0,0 +1 @@ +-->\\n<-- diff --git a/Tests/RunCMake/Syntax/EscapedAt.cmake b/Tests/RunCMake/Syntax/EscapedAt.cmake new file mode 100644 index 0000000..1ced620 --- /dev/null +++ b/Tests/RunCMake/Syntax/EscapedAt.cmake @@ -0,0 +1,5 @@ +set(var "n") +set(ref "\\@var@") + +string(CONFIGURE "${ref}" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/ExpandInAt-stderr.txt b/Tests/RunCMake/Syntax/ExpandInAt-stderr.txt new file mode 100644 index 0000000..5da8b60 --- /dev/null +++ b/Tests/RunCMake/Syntax/ExpandInAt-stderr.txt @@ -0,0 +1 @@ +-->@foo@<-- diff --git a/Tests/RunCMake/Syntax/ExpandInAt.cmake b/Tests/RunCMake/Syntax/ExpandInAt.cmake new file mode 100644 index 0000000..98f0277 --- /dev/null +++ b/Tests/RunCMake/Syntax/ExpandInAt.cmake @@ -0,0 +1,6 @@ +set("\${varname}" bar) +set(var foo) +set(ref "@\${var}@") + +string(CONFIGURE "${ref}" output) +message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt new file mode 100644 index 0000000..7448b59 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithCarriageReturn.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake:1 + + when parsing string + + \${var\\rwith\\rcarriagereturn} + + syntax error, unexpected cal_SYMBOL, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake b/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake new file mode 100644 index 0000000..614f554 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake @@ -0,0 +1 @@ +message(${var\rwith\rcarriagereturn}) diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt new file mode 100644 index 0000000..f5e03ed --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithCarriageReturnQuoted.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake:1 + + when parsing string + + \${var\\rwith\\rcarriagereturn} + + syntax error, unexpected cal_SYMBOL, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake new file mode 100644 index 0000000..bac69e4 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake @@ -0,0 +1 @@ +message("${var\rwith\rcarriagereturn}") diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt new file mode 100644 index 0000000..fa16a8a --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithEscapedSpaces.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake:1 + + when parsing string + + \${var\\ with\\ escaped\\ space} + + syntax error, unexpected cal_SYMBOL, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake b/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake new file mode 100644 index 0000000..6cb8401 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake @@ -0,0 +1 @@ +message(${var\ with\ escaped\ space}) diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt new file mode 100644 index 0000000..07cbf24 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithEscapedSpacesQuoted.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake:1 + + when parsing string + + \${var\\ with\\ escaped\\ space} + + syntax error, unexpected cal_SYMBOL, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake new file mode 100644 index 0000000..2bd4bfd --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake @@ -0,0 +1 @@ +message("${var\ with\ escaped\ space}") diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt new file mode 100644 index 0000000..d7fc38a --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithEscapedTabs.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake:1 + + when parsing string + + \${var\\ with\\ escaped\\ tab} + + Invalid escape sequence \\.? +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake b/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake new file mode 100644 index 0000000..c6faa7a --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake @@ -0,0 +1 @@ +message(${var\ with\ escaped\ tab}) diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt new file mode 100644 index 0000000..915dbaa --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithEscapedTabsQuoted.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake:1 + + when parsing string + + \${var\\ with\\ escaped\\ tab} + + Invalid escape sequence \\.? +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake new file mode 100644 index 0000000..d9be763 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake @@ -0,0 +1 @@ +message("${var\ with\ escaped\ tab}") diff --git a/Tests/RunCMake/Syntax/NameWithNewline-result.txt b/Tests/RunCMake/Syntax/NameWithNewline-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithNewline-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt b/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt new file mode 100644 index 0000000..5cc111b --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithNewline.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithNewline.cmake:1 + + when parsing string + + \${var\\nwith\\nnewline} + + syntax error, unexpected cal_SYMBOL, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithNewline.cmake b/Tests/RunCMake/Syntax/NameWithNewline.cmake new file mode 100644 index 0000000..583bcb0 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithNewline.cmake @@ -0,0 +1 @@ +message(${var\nwith\nnewline}) diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt new file mode 100644 index 0000000..0067c2f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithNewlineQuoted.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake:1 + + when parsing string + + \${var\\nwith\\nnewline} + + syntax error, unexpected cal_SYMBOL, expecting } \(7\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake b/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake new file mode 100644 index 0000000..da6d2cf --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake @@ -0,0 +1 @@ +message("${var\nwith\nnewline}") diff --git a/Tests/RunCMake/Syntax/NameWithSpaces-result.txt b/Tests/RunCMake/Syntax/NameWithSpaces-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithSpaces-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt new file mode 100644 index 0000000..04bc226 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithSpaces.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithSpaces.cmake:1 + + when parsing string + + \${var + + syntax error, unexpected \$end, expecting } \(5\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithSpaces.cmake b/Tests/RunCMake/Syntax/NameWithSpaces.cmake new file mode 100644 index 0000000..01febe9 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithSpaces.cmake @@ -0,0 +1 @@ +message(${var with space}) diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt new file mode 100644 index 0000000..66cf9a2 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithSpacesQuoted.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake:1 + + when parsing string + + \${var with space} + + syntax error, unexpected cal_SYMBOL, expecting } \(17\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake b/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake new file mode 100644 index 0000000..3fba53f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake @@ -0,0 +1 @@ +message("${var with space}") diff --git a/Tests/RunCMake/Syntax/NameWithTabs-result.txt b/Tests/RunCMake/Syntax/NameWithTabs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithTabs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt new file mode 100644 index 0000000..e888096 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithTabs.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithTabs.cmake:1 + + when parsing string + + \${var + + syntax error, unexpected \$end, expecting } \(5\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithTabs.cmake b/Tests/RunCMake/Syntax/NameWithTabs.cmake new file mode 100644 index 0000000..c3b1bea --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithTabs.cmake @@ -0,0 +1 @@ +message(${var with tab}) diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt new file mode 100644 index 0000000..b020074 --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt @@ -0,0 +1,12 @@ +^CMake Error at NameWithTabsQuoted.cmake:1 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake:1 + + when parsing string + + \${var with tab} + + syntax error, unexpected cal_SYMBOL, expecting } \(15\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake b/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake new file mode 100644 index 0000000..8ddb85d --- /dev/null +++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake @@ -0,0 +1 @@ +message("${var with tab}") diff --git a/Tests/RunCMake/Syntax/ParenInENV-result.txt b/Tests/RunCMake/Syntax/ParenInENV-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInENV-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt new file mode 100644 index 0000000..7ecfe11 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2:21 + + Argument not separated from preceding token by whitespace. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at ParenInENV.cmake:2 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2 + + when parsing string + + -->\$ENV{e + + syntax error, unexpected \$end, expecting } \(9\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/ParenInENV.cmake b/Tests/RunCMake/Syntax/ParenInENV.cmake new file mode 100644 index 0000000..148f726 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInENV.cmake @@ -0,0 +1,2 @@ +set("ENV{e(x)}" value) +message(-->$ENV{e(x)}<--) diff --git a/Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt new file mode 100644 index 0000000..7020c7e --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt @@ -0,0 +1 @@ +-->value<-- diff --git a/Tests/RunCMake/Syntax/ParenInQuotedENV.cmake b/Tests/RunCMake/Syntax/ParenInQuotedENV.cmake new file mode 100644 index 0000000..6333717 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInQuotedENV.cmake @@ -0,0 +1,2 @@ +set("ENV{e(x)}" value) +message("-->$ENV{e(x)}<--") diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-result.txt b/Tests/RunCMake/Syntax/ParenInVarName0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInVarName0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt new file mode 100644 index 0000000..0a6b60f --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt @@ -0,0 +1,12 @@ +CMake Error at ParenInVarName0.cmake:4 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:4 + + when parsing string + + -->\${e\(x\)}<-- + + Invalid character \('\('\) in a variable name: 'e' +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/ParenInVarName0.cmake b/Tests/RunCMake/Syntax/ParenInVarName0.cmake new file mode 100644 index 0000000..f863d20 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInVarName0.cmake @@ -0,0 +1,4 @@ +cmake_policy(SET CMP0053 NEW) + +set("e(x)" value) +message("-->${e(x)}<--") diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-result.txt b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt new file mode 100644 index 0000000..81b1717 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt @@ -0,0 +1,12 @@ +CMake Error at ParenInVarName1.cmake:4 \(message\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/ParenInVarName1.cmake:4 + + when parsing string + + -->\${e\(x\)}<-- + + syntax error, unexpected cal_SYMBOL, expecting } \(10\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/ParenInVarName1.cmake b/Tests/RunCMake/Syntax/ParenInVarName1.cmake new file mode 100644 index 0000000..9fdc87b --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInVarName1.cmake @@ -0,0 +1,4 @@ +cmake_policy(SET CMP0053 OLD) + +set("{e(x)}" value) +message("-->${e(x)}<--") diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index 5f05cfc..cecd338 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -5,6 +5,14 @@ run_cmake(BOM-UTF-16-LE) run_cmake(BOM-UTF-16-BE) run_cmake(BOM-UTF-32-LE) run_cmake(BOM-UTF-32-BE) +run_cmake(CMP0053-At-OLD) +run_cmake(CMP0053-At-NEW) +run_cmake(CMP0053-At-WARN) +run_cmake(CMP0053-At-WARN-newlines) +run_cmake(CMP0053-WARN) +run_cmake(CMP0053-NUL) +run_cmake(CMP0053-ParenInENV) +run_cmake(CMP0053-ParenInQuotedENV) run_cmake(CommandSpaces) run_cmake(CommandTabs) run_cmake(CommandNewlines) @@ -25,6 +33,7 @@ run_cmake(StringNoSpace) run_cmake(OneLetter) run_cmake(Unquoted0) run_cmake(Unquoted1) +run_cmake(Unquoted2) run_cmake(Bracket0) run_cmake(Bracket1) run_cmake(Bracket2) @@ -43,12 +52,59 @@ run_cmake(BracketNoSpace3) run_cmake(BracketNoSpace4) run_cmake(BracketNoSpace5) run_cmake(Escape1) +run_cmake(Escape2) +run_cmake(EscapeCharsAllowed) +include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake") run_cmake(ParenNoSpace0) run_cmake(ParenNoSpace1) run_cmake(ParenNoSpace2) +run_cmake(ParenInVarName0) +run_cmake(ParenInVarName1) run_cmake(UnterminatedCall1) run_cmake(UnterminatedCall2) run_cmake(UnterminatedString) +run_cmake(UnterminatedBrace0) +run_cmake(UnterminatedBrace1) +run_cmake(UnterminatedBrace2) run_cmake(UnterminatedBracket0) run_cmake(UnterminatedBracket1) run_cmake(UnterminatedBracketComment) + +# Variable expansion tests +run_cmake(ExpandInAt) +run_cmake(EscapedAt) +run_cmake(EscapeQuotes) +run_cmake(AtWithVariable) +run_cmake(AtWithVariableEmptyExpansion) +run_cmake(AtWithVariableAtOnly) +run_cmake(AtWithVariableEmptyExpansionAtOnly) +run_cmake(AtWithVariableFile) +run_cmake(AtWithVariableAtOnlyFile) +run_cmake(ParenInENV) +run_cmake(ParenInQuotedENV) + +# Variable name tests +run_cmake(NameWithSpaces) +run_cmake(NameWithTabs) +run_cmake(NameWithNewline) +run_cmake(NameWithCarriageReturn) +run_cmake(NameWithEscapedSpaces) +run_cmake(NameWithEscapedTabs) +run_cmake(NameWithSpacesQuoted) +run_cmake(NameWithTabsQuoted) +run_cmake(NameWithNewlineQuoted) +run_cmake(NameWithCarriageReturnQuoted) +run_cmake(NameWithEscapedSpacesQuoted) +run_cmake(NameWithEscapedTabsQuoted) +run_cmake(CMP0053-NameWithSpaces) +run_cmake(CMP0053-NameWithTabs) +run_cmake(CMP0053-NameWithNewline) +run_cmake(CMP0053-NameWithCarriageReturn) +run_cmake(CMP0053-NameWithEscapedSpaces) +run_cmake(CMP0053-NameWithEscapedTabs) +run_cmake(CMP0053-NameWithSpacesQuoted) +run_cmake(CMP0053-NameWithTabsQuoted) +run_cmake(CMP0053-NameWithNewlineQuoted) +run_cmake(CMP0053-NameWithCarriageReturnQuoted) +run_cmake(CMP0053-NameWithEscapedSpacesQuoted) +run_cmake(CMP0053-NameWithEscapedTabsQuoted) diff --git a/Tests/RunCMake/Syntax/Unquoted1-stderr.txt b/Tests/RunCMake/Syntax/Unquoted1-stderr.txt index ff8194a..85a7a9d 100644 --- a/Tests/RunCMake/Syntax/Unquoted1-stderr.txt +++ b/Tests/RunCMake/Syntax/Unquoted1-stderr.txt @@ -1 +1 @@ -^\[\]\[=\]\[\$\$\(MV\)-DSTR=" \[="\[;\]$ +^\[\]\[=\]\[\$\$\(MV\)-DSTR=" \[="\[;\]\]\[$ diff --git a/Tests/RunCMake/Syntax/Unquoted1.cmake b/Tests/RunCMake/Syntax/Unquoted1.cmake index 0344fbd..515161f 100644 --- a/Tests/RunCMake/Syntax/Unquoted1.cmake +++ b/Tests/RunCMake/Syntax/Unquoted1.cmake @@ -1 +1 @@ -message([] [=] [$ $(MV) -DSTR=" [=" [;]) +message([] [=] [$ $(MV) -DSTR=" [=" [;] ] [) diff --git a/Tests/RunCMake/Syntax/Unquoted2-stderr.txt b/Tests/RunCMake/Syntax/Unquoted2-stderr.txt new file mode 100644 index 0000000..eb8883e --- /dev/null +++ b/Tests/RunCMake/Syntax/Unquoted2-stderr.txt @@ -0,0 +1 @@ +^\[\[UnquotedBracketArgument1\]\]$ diff --git a/Tests/RunCMake/Syntax/Unquoted2.cmake b/Tests/RunCMake/Syntax/Unquoted2.cmake new file mode 100644 index 0000000..d94057d --- /dev/null +++ b/Tests/RunCMake/Syntax/Unquoted2.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0053 NEW) + +message(\[[Unquoted Bracket Argument 1]]) diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt new file mode 100644 index 0000000..1e0ce49 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt @@ -0,0 +1,12 @@ +CMake Error at UnterminatedBrace0.cmake:2 \(set\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake:2 + + when parsing string + + \${ + + syntax error, unexpected \$end, expecting } \(2\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake new file mode 100644 index 0000000..0da1290 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 3.0) +set(var "${") diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt new file mode 100644 index 0000000..4e3c2b5 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt @@ -0,0 +1,13 @@ +CMake Warning \(dev\) at UnterminatedBrace1.cmake:3 \(set\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:3 + + when parsing string + + \${ + + syntax error, unexpected \$end, expecting } \(2\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake new file mode 100644 index 0000000..93fba34 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +cmake_policy(SET CMP0010 OLD) +set(var "${") diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt new file mode 100644 index 0000000..b332d34 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt @@ -0,0 +1,12 @@ +CMake Error at UnterminatedBrace2.cmake:4 \(set\): + Syntax error in cmake code at + + .*/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake:4 + + when parsing string + + \${ + + There is an unterminated variable reference. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake new file mode 100644 index 0000000..a650e5b --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.0) +cmake_policy(SET CMP0010 OLD) +cmake_policy(SET CMP0053 NEW) +set(var "${") diff --git a/Tests/RunCMake/Syntax/atfile.txt.in b/Tests/RunCMake/Syntax/atfile.txt.in new file mode 100644 index 0000000..3775919 --- /dev/null +++ b/Tests/RunCMake/Syntax/atfile.txt.in @@ -0,0 +1,4 @@ +==>@var@<== +==>@empty@<== +==>${var}<== +==>${empty}<== diff --git a/Tests/RunCMake/TargetObjects/BadContext-result.txt b/Tests/RunCMake/TargetObjects/BadContext-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetObjects/BadContext-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt new file mode 100644 index 0000000..b78189e --- /dev/null +++ b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt @@ -0,0 +1,27 @@ +(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/BadContext.cmake b/Tests/RunCMake/TargetObjects/BadContext.cmake new file mode 100644 index 0000000..5d7e33e --- /dev/null +++ b/Tests/RunCMake/TargetObjects/BadContext.cmake @@ -0,0 +1,7 @@ +add_library(iface INTERFACE) +target_sources(iface INTERFACE $<TARGET_OBJECTS:NoTarget>) + +file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:NoTarget>) +file(GENERATE OUTPUT test_output2 CONTENT $<TARGET_PROPERTY:iface,INTERFACE_SOURCES>) + +install(FILES $<TARGET_OBJECTS:NoTarget> DESTINATION objects) diff --git a/Tests/RunCMake/TargetObjects/CMakeLists.txt b/Tests/RunCMake/TargetObjects/CMakeLists.txt new file mode 100644 index 0000000..be9d403 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST}) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake new file mode 100644 index 0000000..85c76e2 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(BadContext) diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index f30c9a9..f4b744b 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -16,6 +16,7 @@ \* CMP0041 \* CMP0042 \* CMP0046 + \* CMP0052 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt new file mode 100644 index 0000000..7e002f5 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at LinkImplementationCycle1.cmake:5 \(target_link_libraries\): + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> + + \$<TARGET_PROPERTY:...> expression in link libraries evaluation depends on + target property which is transitive over the link libraries, creating a + recursion. +Call Stack \(most recent call first\): + CMakeLists.txt:8 \(include\) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1.cmake new file mode 100644 index 0000000..4b60214 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1.cmake @@ -0,0 +1,8 @@ + +add_library(empty1 empty.cpp) +add_library(empty2 empty.cpp) + +target_link_libraries(empty1 + LINK_PUBLIC + $<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2> +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt new file mode 100644 index 0000000..2f72de6 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at LinkImplementationCycle2.cmake:5 \(target_link_libraries\): + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES> + + \$<TARGET_PROPERTY:...> expression in link libraries evaluation depends on + target property which is transitive over the link libraries, creating a + recursion. +Call Stack \(most recent call first\): + CMakeLists.txt:8 \(include\) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2.cmake new file mode 100644 index 0000000..557eac1 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2.cmake @@ -0,0 +1,8 @@ + +add_library(empty1 empty.cpp) +add_library(empty2 empty.cpp) + +target_link_libraries(empty1 + LINK_PUBLIC + $<$<STREQUAL:$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES>,/foo/bar>:empty2> +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3.cmake new file mode 100644 index 0000000..0f921d4 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle3.cmake @@ -0,0 +1,10 @@ + +add_library(empty1 empty.cpp) +add_library(empty2 empty.cpp) + +# This is OK, because evaluating the INCLUDE_DIRECTORIES is not affected by +# the content of the INTERFACE_LINK_LIBRARIES. +target_link_libraries(empty1 + INTERFACE + $<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2> +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4-stderr.txt new file mode 100644 index 0000000..5cfeb0a --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES> + + \$<TARGET_PROPERTY:...> expression in link libraries evaluation depends on + target property which is transitive over the link libraries, creating a + recursion. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake new file mode 100644 index 0000000..ab6d0b2 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake @@ -0,0 +1,14 @@ + +add_library(empty1 empty.cpp) +add_library(empty2 empty.cpp) + +# The INTERFACE_INCLUDE_DIRECTORIES do not depend on the link interface. +# On its own, this is fine. It is only when used by empty3 that an error +# is appropriately issued. +target_link_libraries(empty1 + INTERFACE + $<$<STREQUAL:$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES>,/foo/bar>:empty2> +) + +add_library(empty3 empty.cpp) +target_link_libraries(empty3 empty1) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5-stderr.txt new file mode 100644 index 0000000..5cfeb0a --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES> + + \$<TARGET_PROPERTY:...> expression in link libraries evaluation depends on + target property which is transitive over the link libraries, creating a + recursion. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5.cmake new file mode 100644 index 0000000..dc180e3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle5.cmake @@ -0,0 +1,10 @@ + +add_library(empty1 INTERFACE IMPORTED) +add_library(empty2 INTERFACE IMPORTED) + +set_property(TARGET empty1 PROPERTY INTERFACE_LINK_LIBRARIES + $<$<STREQUAL:$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES>,/foo/bar>:empty2> +) + +add_library(empty3 empty.cpp) +target_link_libraries(empty3 empty1) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6-stderr.txt new file mode 100644 index 0000000..5cfeb0a --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES> + + \$<TARGET_PROPERTY:...> expression in link libraries evaluation depends on + target property which is transitive over the link libraries, creating a + recursion. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6.cmake new file mode 100644 index 0000000..91252d0 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle6.cmake @@ -0,0 +1,14 @@ + +add_library(empty1 SHARED empty.cpp) +add_library(empty2 SHARED empty.cpp) + +# The INTERFACE_INCLUDE_DIRECTORIES do not depend on the link interface. +# On its own, this is fine. It is only when used by empty3 that an error +# is appropriately issued. +target_link_libraries(empty1 + INTERFACE + $<$<STREQUAL:$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES>,/foo/bar>:empty2> +) + +add_library(empty3 SHARED empty.cpp) +target_link_libraries(empty3 empty1) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake index 0ee3238..645a57d 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake @@ -15,3 +15,9 @@ run_cmake(BadInvalidName5) run_cmake(BadInvalidName6) run_cmake(BadInvalidName7) run_cmake(BadInvalidName8) +run_cmake(LinkImplementationCycle1) +run_cmake(LinkImplementationCycle2) +run_cmake(LinkImplementationCycle3) +run_cmake(LinkImplementationCycle4) +run_cmake(LinkImplementationCycle5) +run_cmake(LinkImplementationCycle6) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp b/Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake b/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake new file mode 100644 index 0000000..464df36 --- /dev/null +++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake @@ -0,0 +1,13 @@ + +cmake_policy(SET CMP0026 OLD) + +add_library(objlib OBJECT + empty_1.cpp +) + +add_executable(my_exe + empty_2.cpp + $<TARGET_OBJECTS:objlib> +) + +get_target_property( loc my_exe LOCATION) diff --git a/Tests/RunCMake/TargetSources/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMakeLists.txt new file mode 100644 index 0000000..f452db1 --- /dev/null +++ b/Tests/RunCMake/TargetSources/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt b/Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt b/Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt new file mode 100644 index 0000000..1de5dd7 --- /dev/null +++ b/Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt @@ -0,0 +1,14 @@ +CMake Error in CMakeLists.txt: + Target "somelib" has source files which vary by configuration. This is not + supported by the "[^"]+" generator. + + Config "Debug": + + .*/Tests/RunCMake/TargetSources/empty_1.cpp + .*/Tests/RunCMake/TargetSources/empty_2.cpp + .*/Tests/RunCMake/TargetSources/CMakeLists.txt + + Config "Release": + + .*/Tests/RunCMake/TargetSources/empty_1.cpp + .*/Tests/RunCMake/TargetSources/CMakeLists.txt diff --git a/Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake b/Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake new file mode 100644 index 0000000..02af379 --- /dev/null +++ b/Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake @@ -0,0 +1,2 @@ + +add_library(somelib empty_1.cpp $<$<CONFIG:Debug>:empty_2.cpp>) diff --git a/Tests/RunCMake/TargetSources/OriginDebug-result.txt b/Tests/RunCMake/TargetSources/OriginDebug-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/TargetSources/OriginDebug-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt new file mode 100644 index 0000000..11bc96c --- /dev/null +++ b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt @@ -0,0 +1,31 @@ +CMake Debug Log at OriginDebug.cmake:13 \(add_library\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_2.cpp + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +.* +CMake Debug Log at OriginDebug.cmake:16 \(set_property\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_3.cpp + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +.* +CMake Debug Log at OriginDebug.cmake:20 \(target_sources\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_4.cpp + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +.* +CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_1.cpp + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetSources/OriginDebug.cmake b/Tests/RunCMake/TargetSources/OriginDebug.cmake new file mode 100644 index 0000000..5fe9ba7 --- /dev/null +++ b/Tests/RunCMake/TargetSources/OriginDebug.cmake @@ -0,0 +1,20 @@ + +cmake_minimum_required(VERSION 3.0) + +project(OriginDebug) + +set(CMAKE_DEBUG_TARGET_PROPERTIES SOURCES) + +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_SOURCES + empty_1.cpp +) + +add_library(OriginDebug empty_2.cpp) +target_link_libraries(OriginDebug iface) + +set_property(TARGET OriginDebug APPEND PROPERTY SOURCES + empty_3.cpp +) + +target_sources(OriginDebug PRIVATE empty_4.cpp) diff --git a/Tests/RunCMake/TargetSources/OriginDebugIDE-result.txt b/Tests/RunCMake/TargetSources/OriginDebugIDE-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/TargetSources/OriginDebugIDE-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/TargetSources/OriginDebugIDE-stderr.txt b/Tests/RunCMake/TargetSources/OriginDebugIDE-stderr.txt new file mode 100644 index 0000000..fad7073 --- /dev/null +++ b/Tests/RunCMake/TargetSources/OriginDebugIDE-stderr.txt @@ -0,0 +1,40 @@ +CMake Debug Log at OriginDebug.cmake:13 \(add_library\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_2.cpp + +Call Stack \(most recent call first\): + OriginDebugIDE.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) ++ +CMake Debug Log at OriginDebug.cmake:16 \(set_property\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_3.cpp + +Call Stack \(most recent call first\): + OriginDebugIDE.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) ++ +CMake Debug Log at OriginDebug.cmake:20 \(target_sources\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_4.cpp + +Call Stack \(most recent call first\): + OriginDebugIDE.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) ++ +CMake Debug Log: + Used sources for target OriginDebug: + + * .*CMakeLists.txt ++ +CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/TargetSources/empty_1.cpp + +Call Stack \(most recent call first\): + OriginDebugIDE.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetSources/OriginDebugIDE.cmake b/Tests/RunCMake/TargetSources/OriginDebugIDE.cmake new file mode 100644 index 0000000..a3cc3a8 --- /dev/null +++ b/Tests/RunCMake/TargetSources/OriginDebugIDE.cmake @@ -0,0 +1,4 @@ + +# Separate test for the IDEs, because they show the CMakeLists.txt file +# as a source file. +include(${CMAKE_CURRENT_LIST_DIR}/OriginDebug.cmake) diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake new file mode 100644 index 0000000..1d2eaec --- /dev/null +++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake @@ -0,0 +1,10 @@ +include(RunCMake) + +if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode" AND NOT XCODE_BELOW_2) + run_cmake(ConfigNotAllowed) + run_cmake(OriginDebugIDE) +else() + run_cmake(OriginDebug) +endif() + +run_cmake(CMP0026-LOCATION) diff --git a/Tests/RunCMake/TargetSources/empty_1.cpp b/Tests/RunCMake/TargetSources/empty_1.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/TargetSources/empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/TargetSources/empty_2.cpp b/Tests/RunCMake/TargetSources/empty_2.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/TargetSources/empty_2.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/TargetSources/empty_3.cpp b/Tests/RunCMake/TargetSources/empty_3.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/TargetSources/empty_3.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/TargetSources/empty_4.cpp b/Tests/RunCMake/TargetSources/empty_4.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/TargetSources/empty_4.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt new file mode 100644 index 0000000..872338d --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-stderr.txt new file mode 100644 index 0000000..cf8578e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + A prefix must be specified +Call Stack \(most recent call first\): + EmptyPrefix.cmake:[0-9]+ \(write_compiler_detection_header\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix.cmake new file mode 100644 index 0000000..eda6b18 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX "" + VERSION 3.1 + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-stderr.txt new file mode 100644 index 0000000..62c4ff1 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unparsed arguments: GarbageArg +Call Stack \(most recent call first\): + ExtraArgs.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs.cmake new file mode 100644 index 0000000..c2a21af --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX Pref + GarbageArg + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-stderr.txt new file mode 100644 index 0000000..3c0c076 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + write_compiler_detection_header: FILE parameter missing. +Call Stack \(most recent call first\): + FileTypo.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo.cmake new file mode 100644 index 0000000..c90eda2 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo.cmake @@ -0,0 +1,7 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE_TYPO "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX Pref +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-stderr.txt new file mode 100644 index 0000000..b4d7e08 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at InvalidArgs.cmake:4 \(write_compiler_detection_header\): + write_compiler_detection_header Function invoked with incorrect arguments + for function named: write_compiler_detection_header +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at InvalidArgs.cmake:6 \(write_compiler_detection_header\): + write_compiler_detection_header Function invoked with incorrect arguments + for function named: write_compiler_detection_header +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs.cmake new file mode 100644 index 0000000..cfebae1 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs.cmake @@ -0,0 +1,6 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header() + +write_compiler_detection_header(FILE) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-stderr.txt new file mode 100644 index 0000000..f34c9e1 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unsupported feature cxx_not_a_feature. +Call Stack \(most recent call first\): + InvalidCXXFeature.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature.cmake new file mode 100644 index 0000000..da870fa --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS GNU + FEATURES cxx_not_a_feature + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-stderr.txt new file mode 100644 index 0000000..f35f9f9 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unsupported compiler NOT_A_COMPILER. +Call Stack \(most recent call first\): + InvalidCompiler.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler.cmake new file mode 100644 index 0000000..ecd0957 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS NOT_A_COMPILER + FEATURES cxx_final + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-stderr.txt new file mode 100644 index 0000000..0445744 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unsupported feature not_a_feature. +Call Stack \(most recent call first\): + InvalidFeature.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature.cmake new file mode 100644 index 0000000..cd83968 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS GNU + FEATURES not_a_feature + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-stderr.txt new file mode 100644 index 0000000..ea1bf67 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + The prefix must be a valid C identifier. +Call Stack \(most recent call first\): + InvalidPrefix.cmake:[0-9]+ \(write_compiler_detection_header\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix.cmake new file mode 100644 index 0000000..6599f35 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX "0compile" + VERSION 3.1 + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-stderr.txt new file mode 100644 index 0000000..9451348 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Invalid arguments. write_compiler_detection_header requires at least one + compiler. +Call Stack \(most recent call first\): + NoCompiler.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler.cmake new file mode 100644 index 0000000..2dc14e9 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + # COMPILERS + FEATURES cxx_final + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-stderr.txt new file mode 100644 index 0000000..193f297 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Invalid arguments. write_compiler_detection_header requires at least one + feature. +Call Stack \(most recent call first\): + NoFeature.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature.cmake new file mode 100644 index 0000000..1fbc129 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS GNU + # FEATURES + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt new file mode 100644 index 0000000..8d4db34 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + VERSION compatibility for write_compiler_detection_header is set to 3.0, + which is too low. It must be set to at least 3.1.0. Either set the + VERSION parameter to the write_compiler_detection_header function, or + update your minimum required CMake version with the cmake_minimum_required + command. +Call Stack \(most recent call first\): + OldVersion.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion.cmake new file mode 100644 index 0000000..a6e3022 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX Pref + VERSION 3.0 + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-stderr.txt new file mode 100644 index 0000000..5fdcdb8 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + write_compiler_detection_header: PREFIX parameter missing. +Call Stack \(most recent call first\): + PrefixTypo.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo.cmake new file mode 100644 index 0000000..8b6774c --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo.cmake @@ -0,0 +1,7 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX_TYPO Pref +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake new file mode 100644 index 0000000..6dded44 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake @@ -0,0 +1,14 @@ +include(RunCMake) + +run_cmake(InvalidArgs) +run_cmake(NoCompiler) +run_cmake(NoFeature) +run_cmake(FileTypo) +run_cmake(PrefixTypo) +run_cmake(ExtraArgs) +run_cmake(OldVersion) +run_cmake(InvalidCompiler) +run_cmake(InvalidFeature) +run_cmake(InvalidCXXFeature) +run_cmake(EmptyPrefix) +run_cmake(InvalidPrefix) diff --git a/Tests/RunCMake/XcodeProject/CMakeLists.txt b/Tests/RunCMake/XcodeProject/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake new file mode 100644 index 0000000..8e4026b --- /dev/null +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(XcodeFileType) diff --git a/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake b/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake new file mode 100644 index 0000000..7882d7f --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake @@ -0,0 +1,10 @@ +set(expect-default "explicitFileType = sourcecode") +set(expect-explicit "explicitFileType = \"sourcecode.c.h\"") +set(expect-lastKnown "lastKnownFileType = \"sourcecode.c.h\"") +foreach(src default explicit lastKnown) + file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeFileType.xcodeproj/project.pbxproj actual-${src} + REGEX "PBXFileReference.*src-${src}") + if(NOT actual-${src} MATCHES "${expect-${src}}") + message(SEND_ERROR "src-${src} does not match '${expect-${src}}':\n ${actual-${src}}") + endif() +endforeach() diff --git a/Tests/RunCMake/XcodeProject/XcodeFileType.cmake b/Tests/RunCMake/XcodeProject/XcodeFileType.cmake new file mode 100644 index 0000000..7faa781 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeFileType.cmake @@ -0,0 +1,4 @@ +enable_language(C) +add_executable(main main.c src-default src-explicit src-lastKnown) +set_property(SOURCE src-explicit PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.c.h) +set_property(SOURCE src-lastKnown PROPERTY XCODE_LAST_KNOWN_FILE_TYPE sourcecode.c.h) diff --git a/Tests/RunCMake/XcodeProject/main.c b/Tests/RunCMake/XcodeProject/main.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/main.c diff --git a/Tests/RunCMake/XcodeProject/src-default b/Tests/RunCMake/XcodeProject/src-default new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/src-default diff --git a/Tests/RunCMake/XcodeProject/src-explicit b/Tests/RunCMake/XcodeProject/src-explicit new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/src-explicit diff --git a/Tests/RunCMake/XcodeProject/src-lastKnown b/Tests/RunCMake/XcodeProject/src-lastKnown new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/src-lastKnown diff --git a/Tests/RunCMake/configure_file/CMakeLists.txt b/Tests/RunCMake/configure_file/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/configure_file/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/configure_file/NO-BOM.cmake b/Tests/RunCMake/configure_file/NO-BOM.cmake new file mode 100644 index 0000000..003d526 --- /dev/null +++ b/Tests/RunCMake/configure_file/NO-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(NO-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/NO-BOM.txt) diff --git a/Tests/RunCMake/configure_file/NO-BOM.txt.in b/Tests/RunCMake/configure_file/NO-BOM.txt.in new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/Tests/RunCMake/configure_file/NO-BOM.txt.in @@ -0,0 +1 @@ +Hello World diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake new file mode 100644 index 0000000..c8bfa57 --- /dev/null +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(NO-BOM) +run_cmake(UTF8-BOM) +run_cmake(UTF16LE-BOM) +run_cmake(UTF16BE-BOM) +run_cmake(UTF32LE-BOM) +run_cmake(UTF32BE-BOM) diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF16BE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF16BE-BOM-stderr.txt new file mode 100644 index 0000000..5132c4d --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF16BE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM.cmake b/Tests/RunCMake/configure_file/UTF16BE-BOM.cmake new file mode 100644 index 0000000..c570742 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF16BE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF16BE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..70fd9cb --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16BE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF16LE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF16LE-BOM-stderr.txt new file mode 100644 index 0000000..8f997bc --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF16LE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM.cmake b/Tests/RunCMake/configure_file/UTF16LE-BOM.cmake new file mode 100644 index 0000000..05c9cd7 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF16LE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF16LE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..036f8c5 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF16LE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF32BE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF32BE-BOM-stderr.txt new file mode 100644 index 0000000..12811aa --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF32BE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM.cmake b/Tests/RunCMake/configure_file/UTF32BE-BOM.cmake new file mode 100644 index 0000000..0c6ea87 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF32BE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF32BE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..c87cfd5 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32BE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM-result.txt b/Tests/RunCMake/configure_file/UTF32LE-BOM-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM-stderr.txt b/Tests/RunCMake/configure_file/UTF32LE-BOM-stderr.txt new file mode 100644 index 0000000..fa9e01a --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at UTF32LE-BOM.cmake:2 \(configure_file\): + File starts with a Byte-Order-Mark that is not UTF-8: + + .*/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM.cmake b/Tests/RunCMake/configure_file/UTF32LE-BOM.cmake new file mode 100644 index 0000000..b6351b0 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF32LE-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF32LE-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in b/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in Binary files differnew file mode 100644 index 0000000..27c8183 --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF32LE-BOM.txt.in diff --git a/Tests/RunCMake/configure_file/UTF8-BOM.cmake b/Tests/RunCMake/configure_file/UTF8-BOM.cmake new file mode 100644 index 0000000..af2adae --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF8-BOM.cmake @@ -0,0 +1,2 @@ + +configure_file(UTF8-BOM.txt.in ${CMAKE_CURRENT_BINARY_DIR}/UTF8-BOM.txt) diff --git a/Tests/RunCMake/configure_file/UTF8-BOM.txt.in b/Tests/RunCMake/configure_file/UTF8-BOM.txt.in new file mode 100644 index 0000000..abc0aca --- /dev/null +++ b/Tests/RunCMake/configure_file/UTF8-BOM.txt.in @@ -0,0 +1 @@ +Hello World diff --git a/Tests/RunCMake/file/CMakeLists.txt b/Tests/RunCMake/file/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/file/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/file/FileOpenFailRead-result.txt b/Tests/RunCMake/file/FileOpenFailRead-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/FileOpenFailRead-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/FileOpenFailRead-stderr.txt b/Tests/RunCMake/file/FileOpenFailRead-stderr.txt new file mode 100644 index 0000000..23d4337 --- /dev/null +++ b/Tests/RunCMake/file/FileOpenFailRead-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at FileOpenFailRead.cmake:[0-9]+ \(file\): + file failed to open for reading \(.*\): + + .*/Tests/RunCMake/file/does_not_exist/file.txt +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/file/FileOpenFailRead.cmake b/Tests/RunCMake/file/FileOpenFailRead.cmake new file mode 100644 index 0000000..4d4c6dc --- /dev/null +++ b/Tests/RunCMake/file/FileOpenFailRead.cmake @@ -0,0 +1 @@ +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist/file.txt" content) diff --git a/Tests/RunCMake/file/INSTALL-DIRECTORY-stdout.txt b/Tests/RunCMake/file/INSTALL-DIRECTORY-stdout.txt new file mode 100644 index 0000000..561a6b1 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-DIRECTORY-stdout.txt @@ -0,0 +1,8 @@ +-- Before Installing +-- Installing: .*/Tests/RunCMake/file/INSTALL-DIRECTORY-build/dir +-- Installing: .*/Tests/RunCMake/file/INSTALL-DIRECTORY-build/dir/empty.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-DIRECTORY-build/dir +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-DIRECTORY-build/dir/empty.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-DIRECTORY-build/dir +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-DIRECTORY-build/dir/empty.txt +-- After Installing diff --git a/Tests/RunCMake/file/INSTALL-DIRECTORY.cmake b/Tests/RunCMake/file/INSTALL-DIRECTORY.cmake new file mode 100644 index 0000000..0bc1d18 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-DIRECTORY.cmake @@ -0,0 +1,10 @@ +set(src ${CMAKE_CURRENT_SOURCE_DIR}/dir) +set(dst ${CMAKE_CURRENT_BINARY_DIR}/dir) +file(REMOVE RECURSE ${dst}) +message(STATUS "Before Installing") +file(INSTALL FILES ${src}/ DESTINATION ${dst} TYPE DIRECTORY) +file(INSTALL FILES ${src}/ DESTINATION ${dst} TYPE DIRECTORY) +file(INSTALL FILES ${src}/ DESTINATION ${dst} TYPE DIRECTORY MESSAGE_NEVER) +file(INSTALL FILES ${src}/ DESTINATION ${dst} TYPE DIRECTORY MESSAGE_LAZY) +file(INSTALL FILES ${src}/ DESTINATION ${dst} TYPE DIRECTORY MESSAGE_ALWAYS) +message(STATUS "After Installing") diff --git a/Tests/RunCMake/file/INSTALL-MESSAGE-bad-result.txt b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt new file mode 100644 index 0000000..557b817 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt @@ -0,0 +1,32 @@ +CMake Error at INSTALL-MESSAGE-bad.cmake:1 \(file\): + file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are + mutually exclusive. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at INSTALL-MESSAGE-bad.cmake:2 \(file\): + file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are + mutually exclusive. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at INSTALL-MESSAGE-bad.cmake:3 \(file\): + file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are + mutually exclusive. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at INSTALL-MESSAGE-bad.cmake:4 \(file\): + file option MESSAGE_ALWAYS may not appear after PATTERN or REGEX. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at INSTALL-MESSAGE-bad.cmake:5 \(file\): + file option MESSAGE_LAZY may not appear after PATTERN or REGEX. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at INSTALL-MESSAGE-bad.cmake:6 \(file\): + file option MESSAGE_NEVER may not appear after PATTERN or REGEX. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/file/INSTALL-MESSAGE-bad.cmake b/Tests/RunCMake/file/INSTALL-MESSAGE-bad.cmake new file mode 100644 index 0000000..f878c69 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-MESSAGE-bad.cmake @@ -0,0 +1,6 @@ +file(INSTALL DESTINATION dir MESSAGE_ALWAYS MESSAGE_LAZY) +file(INSTALL DESTINATION dir MESSAGE_ALWAYS MESSAGE_NEVER) +file(INSTALL DESTINATION dir MESSAGE_LAZY MESSAGE_NEVER) +file(INSTALL DESTINATION dir PATTERN *.txt MESSAGE_ALWAYS) +file(INSTALL DESTINATION dir PATTERN *.txt MESSAGE_LAZY) +file(INSTALL DESTINATION dir PATTERN *.txt MESSAGE_NEVER) diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake new file mode 100644 index 0000000..bf14263 --- /dev/null +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(INSTALL-DIRECTORY) +run_cmake(INSTALL-MESSAGE-bad) +run_cmake(FileOpenFailRead) diff --git a/Tests/RunCMake/file/dir/empty.txt b/Tests/RunCMake/file/dir/empty.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/file/dir/empty.txt diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt new file mode 100644 index 0000000..04d09f2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/CMakeLists.txt @@ -0,0 +1,4 @@ +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-result.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt new file mode 100644 index 0000000..348f8bb --- /dev/null +++ b/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt @@ -0,0 +1,6 @@ +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 new file mode 100644 index 0000000..b05665b7 --- /dev/null +++ b/Tests/RunCMake/find_dependency/EXACT-no-version.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 EXACT) diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake b/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake new file mode 100644 index 0000000..7d55ef6 --- /dev/null +++ b/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake @@ -0,0 +1,2 @@ + +add_library(Pack1::Lib INTERFACE IMPORTED) diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake b/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake new file mode 100644 index 0000000..dfb7b6c --- /dev/null +++ b/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.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_dependency/RunCMakeTest.cmake b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake new file mode 100644 index 0000000..9403136 --- /dev/null +++ b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake @@ -0,0 +1,7 @@ +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) diff --git a/Tests/RunCMake/find_dependency/empty-arg-3-result.txt b/Tests/RunCMake/find_dependency/empty-arg-3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/empty-arg-3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt new file mode 100644 index 0000000..bf9b02b --- /dev/null +++ b/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..b08200a --- /dev/null +++ b/Tests/RunCMake/find_dependency/empty-arg-3.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.2 "") diff --git a/Tests/RunCMake/find_dependency/empty-version-result.txt b/Tests/RunCMake/find_dependency/empty-version-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/empty-version-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/empty-version-stderr.txt b/Tests/RunCMake/find_dependency/empty-version-stderr.txt new file mode 100644 index 0000000..b5e9f46 --- /dev/null +++ b/Tests/RunCMake/find_dependency/empty-version-stderr.txt @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..e6f17cd --- /dev/null +++ b/Tests/RunCMake/find_dependency/empty-version.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 "") diff --git a/Tests/RunCMake/find_dependency/extra-args-result.txt b/Tests/RunCMake/find_dependency/extra-args-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/extra-args-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/extra-args-stderr.txt b/Tests/RunCMake/find_dependency/extra-args-stderr.txt new file mode 100644 index 0000000..83a7f02 --- /dev/null +++ b/Tests/RunCMake/find_dependency/extra-args-stderr.txt @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..209645a --- /dev/null +++ b/Tests/RunCMake/find_dependency/extra-args.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.2 EXACT PATHS "${CMAKE_BINARY_DIR}") diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt b/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt new file mode 100644 index 0000000..fee8d5d --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt @@ -0,0 +1,5 @@ +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-3.cmake b/Tests/RunCMake/find_dependency/invalid-arg-3.cmake new file mode 100644 index 0000000..40ede07 --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-3.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.2 EXACTYPO) diff --git a/Tests/RunCMake/include/CMP0024-NEW-stderr.txt b/Tests/RunCMake/include/CMP0024-NEW-stderr.txt index 059d7e4..0fdb3ca 100644 --- a/Tests/RunCMake/include/CMP0024-NEW-stderr.txt +++ b/Tests/RunCMake/include/CMP0024-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at subdir2/CMakeLists.txt:2 \(include\): - Policy CMP0024 is not set: Disallow include export result. Run "cmake - --help-policy CMP0024" for policy details. Use the cmake_policy command to - set the policy and suppress this warning. - The file .*/Tests/RunCMake/include/CMP0024-NEW-build/subdir1/theTargets.cmake diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt new file mode 100644 index 0000000..f0adc9f --- /dev/null +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-stderr.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt new file mode 100644 index 0000000..054bff5 --- /dev/null +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0052 is not set: Reject source and build dirs in installed + INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + Directory: + + ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-WARN-build/foo" + + in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory + of the install directory: + + ".*Tests/RunCMake/include_directories/prefix" + + however it is also a subdirectory of the build tree: + + ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-WARN-build" + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake index 8754540..67ee7de 100644 --- a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake +++ b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake @@ -1,5 +1,5 @@ -project(BinaryDirectoryInInterface) +enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/foo") diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt index f452db1..5cd4825 100644 --- a/Tests/RunCMake/include_directories/CMakeLists.txt +++ b/Tests/RunCMake/include_directories/CMakeLists.txt @@ -1,3 +1,6 @@ -cmake_minimum_required(VERSION 2.8.4) -project(${RunCMake_TEST} CXX) -include(${RunCMake_TEST}.cmake) +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +if(NOT TEST_FILE) + set(TEST_FILE ${RunCMake_TEST}.cmake) +endif() +include(${TEST_FILE}) diff --git a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt index 71e6456..8dff90f 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt +++ b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt @@ -5,7 +5,7 @@ CMake Debug Log at DebugIncludes.cmake:8 \(include_directories\): \* .*/Tests/RunCMake/include_directories/two Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) + CMake Debug Log at DebugIncludes.cmake:13 \(set_property\): Used includes for target lll: @@ -13,7 +13,7 @@ CMake Debug Log at DebugIncludes.cmake:13 \(set_property\): \* .*/Tests/RunCMake/include_directories/three Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) + CMake Debug Log at DebugIncludes.cmake:18 \(include_directories\): Used includes for target lll: @@ -21,7 +21,7 @@ CMake Debug Log at DebugIncludes.cmake:18 \(include_directories\): \* .*/Tests/RunCMake/include_directories/four Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) + CMake Debug Log at DebugIncludes.cmake:33 \(set_property\): Used includes for target lll: @@ -33,7 +33,7 @@ CMake Debug Log at DebugIncludes.cmake:33 \(set_property\): Call Stack \(most recent call first\): DebugIncludes.cmake:44 \(some_macro\) DebugIncludes.cmake:47 \(some_function\) - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) + CMake Debug Log at DebugIncludes.cmake:30 \(target_link_libraries\): Used includes for target lll: @@ -41,7 +41,7 @@ CMake Debug Log at DebugIncludes.cmake:30 \(target_link_libraries\): \* .*/Tests/RunCMake/include_directories/eight Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) + CMake Debug Log at DebugIncludes.cmake:55 \(set_property\): Used includes for target lll: @@ -50,4 +50,4 @@ CMake Debug Log at DebugIncludes.cmake:55 \(set_property\): \* .*/Tests/RunCMake/include_directories/ten Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/include_directories/DebugIncludes.cmake b/Tests/RunCMake/include_directories/DebugIncludes.cmake index bbc9e46..10a4c50 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes.cmake +++ b/Tests/RunCMake/include_directories/DebugIncludes.cmake @@ -1,5 +1,5 @@ -project(DebugIncludes) +enable_language(CXX) set(CMAKE_DEBUG_TARGET_PROPERTIES INCLUDE_DIRECTORIES) diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake new file mode 100644 index 0000000..fab7717 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) +add_library(testTarget empty.cpp) +target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/dir") + +install(TARGETS testTarget EXPORT testTargets + DESTINATION lib +) + +install(EXPORT testTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_directories/ImportedTarget.cmake b/Tests/RunCMake/include_directories/ImportedTarget.cmake index e1a20b1..f752f98 100644 --- a/Tests/RunCMake/include_directories/ImportedTarget.cmake +++ b/Tests/RunCMake/include_directories/ImportedTarget.cmake @@ -1,5 +1,5 @@ -project(ImportedTarget) +enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") diff --git a/Tests/RunCMake/include_directories/InstallInBinDir-result.txt b/Tests/RunCMake/include_directories/InstallInBinDir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallInBinDir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt b/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt new file mode 100644 index 0000000..254fae1 --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/include_directories/InstallInBinDir-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt b/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt b/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt new file mode 100644 index 0000000..7be3044 --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/include_directories/copy/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt b/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface-stderr.txt b/Tests/RunCMake/include_directories/InstallPrefixInInterface-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallPrefixInInterface-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake b/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake new file mode 100644 index 0000000..8d777f5 --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake @@ -0,0 +1,11 @@ + +enable_language(CXX) + +add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") +target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/foo") + +install(TARGETS testTarget EXPORT testTargets + DESTINATION lib +) + +install(EXPORT testTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-stderr.txt b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-stderr.txt b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex.cmake b/Tests/RunCMake/include_directories/RelativePathInGenex.cmake index f72cf3a..070a381 100644 --- a/Tests/RunCMake/include_directories/RelativePathInGenex.cmake +++ b/Tests/RunCMake/include_directories/RelativePathInGenex.cmake @@ -1,5 +1,5 @@ -project(RelativePathInInterface) +enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>") diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface.cmake b/Tests/RunCMake/include_directories/RelativePathInInterface.cmake index f2ce54a..4c4727d 100644 --- a/Tests/RunCMake/include_directories/RelativePathInInterface.cmake +++ b/Tests/RunCMake/include_directories/RelativePathInInterface.cmake @@ -1,5 +1,5 @@ -project(RelativePathInInterface) +enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "foo") diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index c00b924..fa76f24 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -12,3 +12,139 @@ run_cmake(CMP0021) run_cmake(install_config) run_cmake(incomplete-genex) run_cmake(export-NOWARN) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/DirInInstallPrefix/prefix") +run_cmake(DirInInstallPrefix) + +configure_file( + "${RunCMake_SOURCE_DIR}/CMakeLists.txt" + "${RunCMake_BINARY_DIR}/copy/CMakeLists.txt" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/empty.cpp" + "${RunCMake_BINARY_DIR}/copy/empty.cpp" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/SourceDirectoryInInterface.cmake" + "${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface.cmake" + COPYONLY +) +set(RunCMake_TEST_OPTIONS + "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface/prefix" + "-DTEST_FILE=${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface.cmake" + ) +set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/copy") +run_cmake(InstallInSrcDir) +unset(RunCMake_TEST_SOURCE_DIR) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallInBinDir-build/prefix") +set(RunCMake_TEST_OPTIONS + "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallInBinDir-build/prefix" + "-DTEST_FILE=${RunCMake_SOURCE_DIR}/BinaryDirectoryInInterface.cmake" + ) +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/InstallInBinDir-build") +run_cmake(InstallInBinDir) +unset(RunCMake_TEST_BINARY_DIR) + +configure_file( + "${RunCMake_SOURCE_DIR}/CMakeLists.txt" + "${RunCMake_BINARY_DIR}/prefix/src/CMakeLists.txt" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/empty.cpp" + "${RunCMake_BINARY_DIR}/prefix/src/empty.cpp" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/SourceDirectoryInInterface.cmake" + "${RunCMake_BINARY_DIR}/prefix/src/SourceDirectoryInInterface.cmake" + COPYONLY +) + +foreach(policyStatus "" NEW OLD) + if (NOT "${policyStatus}" STREQUAL "") + set(policyOption -DCMAKE_POLICY_DEFAULT_CMP0052=${policyStatus}) + else() + unset(policyOption) + set(policyStatus WARN) + endif() + set(RunCMake_TEST_OPTIONS + "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix" ${policyOption} + "-DTEST_FILE=${RunCMake_SOURCE_DIR}/BinaryDirectoryInInterface.cmake" + ) + # Set the RunCMake_TEST_SOURCE_DIR here to the copy too. This is needed to run + # the test suite in-source properly. Otherwise the install directory would be + # a subdirectory or the source directory, which is allowed and tested separately + # below. + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/prefix/src") + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/prefix/BinInInstallPrefix-CMP0052-${policyStatus}-build") + run_cmake(BinInInstallPrefix-CMP0052-${policyStatus}) + unset(RunCMake_TEST_BINARY_DIR) + + set(RunCMake_TEST_OPTIONS + "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix" ${policyOption} + "-DTEST_FILE=${RunCMake_BINARY_DIR}/prefix/src/SourceDirectoryInInterface.cmake" + ) + run_cmake(SrcInInstallPrefix-CMP0052-${policyStatus}) + unset(RunCMake_TEST_SOURCE_DIR) +endforeach() + +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallPrefixInInterface-build/prefix") +run_cmake(InstallPrefixInInterface) + +configure_file( + "${RunCMake_SOURCE_DIR}/CMakeLists.txt" + "${RunCMake_BINARY_DIR}/installToSrc/CMakeLists.txt" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/empty.cpp" + "${RunCMake_BINARY_DIR}/installToSrc/empty.cpp" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/InstallPrefixInInterface.cmake" + "${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface.cmake" + COPYONLY +) +set(RunCMake_TEST_OPTIONS + "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface/prefix" + "-DTEST_FILE=${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface.cmake" + ) +set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/installToSrc") +run_cmake(InstallToPrefixInSrcDirOutOfSource) +unset(RunCMake_TEST_SOURCE_DIR) + + +file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/installToSrcInSrc") +set(RunCMake_TEST_NO_CLEAN ON) + +configure_file( + "${RunCMake_SOURCE_DIR}/CMakeLists.txt" + "${RunCMake_BINARY_DIR}/installToSrcInSrc/CMakeLists.txt" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/empty.cpp" + "${RunCMake_BINARY_DIR}/installToSrcInSrc/empty.cpp" + COPYONLY +) +configure_file( + "${RunCMake_SOURCE_DIR}/InstallPrefixInInterface.cmake" + "${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface.cmake" + COPYONLY +) + +set(RunCMake_TEST_OPTIONS + "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface/prefix" + "-DTEST_FILE=${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface.cmake" + ) +set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/installToSrcInSrc") +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/installToSrcInSrc") +run_cmake(InstallToPrefixInSrcDirInSource) +unset(RunCMake_TEST_SOURCE_DIR) +unset(RunCMake_TEST_BINARY_DIR) +unset(RunCMake_TEST_NO_CLEAN) diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake b/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake index c9a9c45..f814a3c 100644 --- a/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake +++ b/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake @@ -1,5 +1,5 @@ -project(SourceDirectoryInInterface) +enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/foo") diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt new file mode 100644 index 0000000..afa43e0 --- /dev/null +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/include_directories/prefix/src/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-stderr.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt new file mode 100644 index 0000000..0b13fd8 --- /dev/null +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0052 is not set: Reject source and build dirs in installed + INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + Directory: + + ".*Tests/RunCMake/include_directories/prefix/src/foo" + + in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory + of the install directory: + + ".*Tests/RunCMake/include_directories/prefix" + + however it is also a subdirectory of the source tree: + + ".*Tests/RunCMake/include_directories/prefix/src" + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/include_directories/TID-bad-target-stderr.txt b/Tests/RunCMake/include_directories/TID-bad-target-stderr.txt index 481e358..4e15de1 100644 --- a/Tests/RunCMake/include_directories/TID-bad-target-stderr.txt +++ b/Tests/RunCMake/include_directories/TID-bad-target-stderr.txt @@ -1,4 +1,4 @@ CMake Error at TID-bad-target.cmake:6 \(target_include_directories\): target_include_directories called with non-compilable target type Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/include_directories/export-NOWARN.cmake b/Tests/RunCMake/include_directories/export-NOWARN.cmake index 307ce5a..50720a0 100644 --- a/Tests/RunCMake/include_directories/export-NOWARN.cmake +++ b/Tests/RunCMake/include_directories/export-NOWARN.cmake @@ -1,4 +1,4 @@ - +enable_language(CXX) add_library(foo empty.cpp) set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<0:>/include/subdir) set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_PREFIX>/include/subdir) diff --git a/Tests/RunCMake/include_directories/incomplete-genex.cmake b/Tests/RunCMake/include_directories/incomplete-genex.cmake index b6900a4..976695a 100644 --- a/Tests/RunCMake/include_directories/incomplete-genex.cmake +++ b/Tests/RunCMake/include_directories/incomplete-genex.cmake @@ -1,4 +1,4 @@ -project(incomplete-genex) +enable_language(CXX) cmake_policy(SET CMP0022 NEW) cmake_policy(SET CMP0023 NEW) diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake index 7f5ef53..408cadb 100644 --- a/Tests/RunCMake/include_external_msproject/check_utils.cmake +++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake @@ -80,7 +80,9 @@ function(check_project test name guid type platform) set(type 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942) endif() if(NOT platform) - if("${RunCMake_GENERATOR}" MATCHES "Win64") + if(RunCMake_GENERATOR_PLATFORM) + set(platform "${RunCMake_GENERATOR_PLATFORM}") + elseif("${RunCMake_GENERATOR}" MATCHES "Win64") set(platform "x64") else() set(platform "Win32") diff --git a/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake b/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake new file mode 100644 index 0000000..2c716e1 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER-check.cmake @@ -0,0 +1,13 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/prefix) +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +if(out MATCHES "-- Installing: [^\n]*prefix/dir") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}Installation output was not quiet:\n${out}") +endif() +set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt) +if(NOT EXISTS "${f}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n") +endif() diff --git a/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER.cmake b/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER.cmake new file mode 100644 index 0000000..eefb837 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-MESSAGE_NEVER.cmake @@ -0,0 +1,3 @@ +set(CMAKE_INSTALL_MESSAGE "ALWAYS") +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/prefix") +install(DIRECTORY dir/ DESTINATION dir MESSAGE_NEVER) diff --git a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-result.txt b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt new file mode 100644 index 0000000..166ba6f --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at DIRECTORY-PATTERN-MESSAGE_NEVER.cmake:[0-9]+ \(install\): + install DIRECTORY does not allow "MESSAGE_NEVER" after PATTERN or REGEX. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER.cmake b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER.cmake new file mode 100644 index 0000000..de844f7 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER.cmake @@ -0,0 +1 @@ +install(DIRECTORY src DESTINATION src PATTERN *.txt MESSAGE_NEVER) diff --git a/Tests/RunCMake/install/DIRECTORY-message-check.cmake b/Tests/RunCMake/install/DIRECTORY-message-check.cmake new file mode 100644 index 0000000..857681f --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-message-check.cmake @@ -0,0 +1,28 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/prefix) +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +set(expect " +-- Installing: [^\n]*/prefix/dir\r? +-- Installing: [^\n]*/prefix/dir/empty.txt\r? +") +if(NOT out MATCHES "${expect}") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}First install did not say 'Installing' as expected:\n${out}") +endif() +set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt) +if(NOT EXISTS "${f}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n") +endif() +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +set(expect " +-- Up-to-date: [^\n]*/prefix/dir\r? +-- Up-to-date: [^\n]*/prefix/dir/empty.txt\r? +") +if(NOT out MATCHES "${expect}") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}Second install did not say 'Up-to-date' as expected:\n${out}") +endif() diff --git a/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake b/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake new file mode 100644 index 0000000..c7e6018 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-message-lazy-check.cmake @@ -0,0 +1,24 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/prefix) +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +set(expect " +-- Installing: [^\n]*/prefix/dir\r? +-- Installing: [^\n]*/prefix/dir/empty.txt\r? +") +if(NOT out MATCHES "${expect}") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}First install did not say 'Installing' as expected:\n${out}") +endif() +set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt) +if(NOT EXISTS "${f}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}File was not installed:\n ${f}\n") +endif() +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +if(out MATCHES "(Installing|Up-to-date)") + string(REGEX REPLACE "\n" "\n " out " ${out}") + set(RunCMake_TEST_FAILED + "${RunCMake_TEST_FAILED}Second install was not silent as expected:\n${out}") +endif() diff --git a/Tests/RunCMake/install/DIRECTORY-message-lazy.cmake b/Tests/RunCMake/install/DIRECTORY-message-lazy.cmake new file mode 100644 index 0000000..ed43567 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-message-lazy.cmake @@ -0,0 +1,3 @@ +set(CMAKE_INSTALL_MESSAGE "LAZY") +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/prefix") +install(DIRECTORY dir/ DESTINATION dir) diff --git a/Tests/RunCMake/install/DIRECTORY-message.cmake b/Tests/RunCMake/install/DIRECTORY-message.cmake new file mode 100644 index 0000000..913ed15 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-message.cmake @@ -0,0 +1,3 @@ +set(CMAKE_INSTALL_MESSAGE "ALWAYS") +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/prefix") +install(DIRECTORY dir/ DESTINATION dir) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index c8dc379..53b91f3 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -1,4 +1,8 @@ include(RunCMake) +run_cmake(DIRECTORY-MESSAGE_NEVER) +run_cmake(DIRECTORY-PATTERN-MESSAGE_NEVER) +run_cmake(DIRECTORY-message) +run_cmake(DIRECTORY-message-lazy) run_cmake(SkipInstallRulesWarning) run_cmake(SkipInstallRulesNoWarning1) run_cmake(SkipInstallRulesNoWarning2) diff --git a/Tests/RunCMake/install/dir/empty.txt b/Tests/RunCMake/install/dir/empty.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/install/dir/empty.txt diff --git a/Tests/RunCMake/set/ParentScope-result.txt b/Tests/RunCMake/set/ParentScope-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/set/ParentScope-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/set/PARENT_SCOPE.cmake b/Tests/RunCMake/set/ParentScope.cmake index 9bd6bca..9bd6bca 100644 --- a/Tests/RunCMake/set/PARENT_SCOPE.cmake +++ b/Tests/RunCMake/set/ParentScope.cmake diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake index 5d036e3..1b51ea2 100644 --- a/Tests/RunCMake/set/RunCMakeTest.cmake +++ b/Tests/RunCMake/set/RunCMakeTest.cmake @@ -1,3 +1,3 @@ include(RunCMake) -run_cmake(PARENT_SCOPE) +run_cmake(ParentScope) diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake index 501acd2..e83db27 100644 --- a/Tests/RunCMake/string/RunCMakeTest.cmake +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -2,3 +2,11 @@ include(RunCMake) run_cmake(Concat) run_cmake(ConcatNoArgs) + +run_cmake(Uuid) +run_cmake(UuidMissingNamespace) +run_cmake(UuidMissingNamespaceValue) +run_cmake(UuidBadNamespace) +run_cmake(UuidMissingNameValue) +run_cmake(UuidMissingTypeValue) +run_cmake(UuidBadType) diff --git a/Tests/RunCMake/string/Uuid.cmake b/Tests/RunCMake/string/Uuid.cmake new file mode 100644 index 0000000..2613d26 --- /dev/null +++ b/Tests/RunCMake/string/Uuid.cmake @@ -0,0 +1,17 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE MD5) + +if(NOT WWW_EXAMPLE_COM_MD5_UUID STREQUAL "5df41881-3aed-3515-88a7-2f4a814cf09e") + message(SEND_ERROR + "UUID did not create the expected MD5 result: ${WWW_EXAMPLE_COM_MD5_UUID}") +endif() + +string(UUID WWW_EXAMPLE_COM_SHA1_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE SHA1 UPPER) + +if(NOT WWW_EXAMPLE_COM_SHA1_UUID STREQUAL "2ED6657D-E927-568B-95E1-2665A8AEA6A2") + message(SEND_ERROR + "UUID did not create the expected SHA1 result: ${WWW_EXAMPLE_COM_SHA1_UUID}") +endif() diff --git a/Tests/RunCMake/string/UuidBadNamespace-result.txt b/Tests/RunCMake/string/UuidBadNamespace-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidBadNamespace-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidBadNamespace-stderr.txt b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt new file mode 100644 index 0000000..cb12903 --- /dev/null +++ b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidBadNamespace.cmake:3 \(string\): + string UUID sub-command, malformed NAMESPACE UUID. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidBadNamespace.cmake b/Tests/RunCMake/string/UuidBadNamespace.cmake new file mode 100644 index 0000000..f607925 --- /dev/null +++ b/Tests/RunCMake/string/UuidBadNamespace.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-fooo-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE MD5) diff --git a/Tests/RunCMake/string/UuidBadType-result.txt b/Tests/RunCMake/string/UuidBadType-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidBadType-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidBadType-stderr.txt b/Tests/RunCMake/string/UuidBadType-stderr.txt new file mode 100644 index 0000000..1993c04 --- /dev/null +++ b/Tests/RunCMake/string/UuidBadType-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidBadType.cmake:3 \(string\): + string UUID sub-command, unknown TYPE 'FOO'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidBadType.cmake b/Tests/RunCMake/string/UuidBadType.cmake new file mode 100644 index 0000000..bf4909e --- /dev/null +++ b/Tests/RunCMake/string/UuidBadType.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE FOO) diff --git a/Tests/RunCMake/string/UuidMissingNameValue-result.txt b/Tests/RunCMake/string/UuidMissingNameValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNameValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt new file mode 100644 index 0000000..0b7cde4 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingNameValue.cmake:3 \(string\): + string UUID sub-command, NAME requires a value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNameValue.cmake b/Tests/RunCMake/string/UuidMissingNameValue.cmake new file mode 100644 index 0000000..407a1d7 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNameValue.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} TYPE MD5 NAME) diff --git a/Tests/RunCMake/string/UuidMissingNamespace-result.txt b/Tests/RunCMake/string/UuidMissingNamespace-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespace-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt new file mode 100644 index 0000000..dfcfe42 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingNamespace.cmake:3 \(string\): + string UUID sub-command, malformed NAMESPACE UUID. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNamespace.cmake b/Tests/RunCMake/string/UuidMissingNamespace.cmake new file mode 100644 index 0000000..5a71e4f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespace.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAME www.example.com TYPE MD5) diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue-result.txt b/Tests/RunCMake/string/UuidMissingNamespaceValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt new file mode 100644 index 0000000..86585ad --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingNamespaceValue.cmake:3 \(string\): + string UUID sub-command, NAMESPACE requires a value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue.cmake b/Tests/RunCMake/string/UuidMissingNamespaceValue.cmake new file mode 100644 index 0000000..f2219c0 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAME www.example.com TYPE MD5 NAMESPACE) diff --git a/Tests/RunCMake/string/UuidMissingTypeValue-result.txt b/Tests/RunCMake/string/UuidMissingTypeValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingTypeValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt new file mode 100644 index 0000000..70252f8 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingTypeValue.cmake:3 \(string\): + string UUID sub-command, TYPE requires a value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingTypeValue.cmake b/Tests/RunCMake/string/UuidMissingTypeValue.cmake new file mode 100644 index 0000000..6678a46 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingTypeValue.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE) diff --git a/Tests/RunCMake/target_compile_features/CMakeLists.txt b/Tests/RunCMake/target_compile_features/CMakeLists.txt new file mode 100644 index 0000000..3482e6b --- /dev/null +++ b/Tests/RunCMake/target_compile_features/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake new file mode 100644 index 0000000..33faf2b --- /dev/null +++ b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake @@ -0,0 +1,13 @@ +include(RunCMake) + +run_cmake(not_enough_args) +run_cmake(alias_target) +run_cmake(utility_target) +run_cmake(invalid_args) +run_cmake(invalid_args_on_interface) +run_cmake(imported_target) +run_cmake(no_target) +run_cmake(not_a_cxx_feature) +run_cmake(no_matching_cxx_feature) +run_cmake(not_a_c_feature) +run_cmake(no_matching_c_feature) diff --git a/Tests/RunCMake/target_compile_features/alias_target-result.txt b/Tests/RunCMake/target_compile_features/alias_target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/alias_target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt new file mode 100644 index 0000000..417bf62 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at alias_target.cmake:4 \(target_compile_features\): + target_compile_features can not be used on an ALIAS target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/alias_target.cmake b/Tests/RunCMake/target_compile_features/alias_target.cmake new file mode 100644 index 0000000..d35ddba --- /dev/null +++ b/Tests/RunCMake/target_compile_features/alias_target.cmake @@ -0,0 +1,4 @@ + +add_executable(main empty.cpp) +add_executable(Alias::Main ALIAS main) +target_compile_features(Alias::Main PRIVATE cxx_delegating_constructors) diff --git a/Tests/RunCMake/target_compile_features/empty.c b/Tests/RunCMake/target_compile_features/empty.c new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/target_compile_features/empty.c @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_compile_features/empty.cpp b/Tests/RunCMake/target_compile_features/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/target_compile_features/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_compile_features/imported_target-result.txt b/Tests/RunCMake/target_compile_features/imported_target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/imported_target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt new file mode 100644 index 0000000..c6ff5ec --- /dev/null +++ b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at imported_target.cmake:3 \(target_compile_features\): + Cannot specify compile features for imported target "main". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/imported_target.cmake b/Tests/RunCMake/target_compile_features/imported_target.cmake new file mode 100644 index 0000000..e248c2f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/imported_target.cmake @@ -0,0 +1,3 @@ + +add_library(main INTERFACE IMPORTED) +target_compile_features(main INTERFACE cxx_delegating_constructors) diff --git a/Tests/RunCMake/target_compile_features/invalid_args-result.txt b/Tests/RunCMake/target_compile_features/invalid_args-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/invalid_args-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt new file mode 100644 index 0000000..bd5b7b9 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at invalid_args.cmake:3 \(target_compile_features\): + target_compile_features called with invalid arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/invalid_args.cmake b/Tests/RunCMake/target_compile_features/invalid_args.cmake new file mode 100644 index 0000000..1a7fb37 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/invalid_args.cmake @@ -0,0 +1,3 @@ + +add_executable(main empty.cpp) +target_compile_features(main INVALID cxx_delegating_constructors) diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-result.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt new file mode 100644 index 0000000..c30209a --- /dev/null +++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at invalid_args_on_interface.cmake:3 \(target_compile_features\): + target_compile_features may only be set INTERFACE properties on INTERFACE + targets +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake b/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake new file mode 100644 index 0000000..324d0f3 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake @@ -0,0 +1,3 @@ + +add_library(main INTERFACE) +target_compile_features(main PRIVATE cxx_delegating_constructors) diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature-result.txt b/Tests/RunCMake/target_compile_features/no_matching_c_feature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt new file mode 100644 index 0000000..96b959c --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at no_matching_c_feature.cmake:[0-9][0-9]? \((target_compile_features|message)\): + The compiler feature "gnu_c_dummy" is not known to C compiler + + "GNU" + + version 4.8.1. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake b/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake new file mode 100644 index 0000000..a44caf2 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake @@ -0,0 +1,15 @@ + +if (NOT ";${CMAKE_C_COMPILE_FEATURES};" MATCHES ";gnu_c_typeof;") + # Simulate passing the test. + message(SEND_ERROR + "The compiler feature \"gnu_c_dummy\" is not known to C compiler\n\"GNU\"\nversion 4.8.1." + ) + return() +endif() + +add_executable(main empty.c) + +target_compile_features(main + PRIVATE + gnu_c_typeof +) diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-result.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt new file mode 100644 index 0000000..f976dfe --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at no_matching_cxx_feature.cmake:[0-9][0-9]? \((target_compile_features|message)\): + The compiler feature "[^"]+" is not known to CXX compiler + + "[^"]*" + + version *[.0-9]+\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake new file mode 100644 index 0000000..ab1fd76 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake @@ -0,0 +1,26 @@ + +if (NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";gnu_cxx_typeof;" + AND NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";msvc_cxx_sealed;" ) + # Simulate passing the test. + message(SEND_ERROR + "The compiler feature \"gnu_cxx_dummy\" is not known to CXX compiler\n\"GNU\"\nversion 4.8.1." + ) + return() +endif() + +if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";gnu_cxx_typeof;") + set(feature msvc_cxx_sealed) + if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";msvc_cxx_sealed;") + # If a compiler supports both extensions, remove one of them. + list(REMOVE_ITEM CMAKE_CXX_COMPILE_FEATURES msvc_cxx_sealed) + endif() +else() + set(feature gnu_cxx_typeof) +endif() + +add_executable(main empty.cpp) + +target_compile_features(main + PRIVATE + ${feature} +) diff --git a/Tests/RunCMake/target_compile_features/no_target-result.txt b/Tests/RunCMake/target_compile_features/no_target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/no_target-stderr.txt b/Tests/RunCMake/target_compile_features/no_target-stderr.txt new file mode 100644 index 0000000..323ba7a --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_target-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at no_target.cmake:2 \(target_compile_features\): + Cannot specify compile features for target "main" which is not built by + this project. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/no_target.cmake b/Tests/RunCMake/target_compile_features/no_target.cmake new file mode 100644 index 0000000..3f0afe2 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/no_target.cmake @@ -0,0 +1,2 @@ + +target_compile_features(main INTERFACE cxx_delegating_constructors) diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature-result.txt b/Tests/RunCMake/target_compile_features/not_a_c_feature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_a_c_feature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt new file mode 100644 index 0000000..6dd00f3 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at not_a_c_feature.cmake:3 \(target_compile_features\): + target_compile_features specified unknown feature "c_not_a_feature" for + target "main". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake b/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake new file mode 100644 index 0000000..0420698 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake @@ -0,0 +1,6 @@ + +add_executable(main empty.c) +target_compile_features(main + PRIVATE + c_not_a_feature +) diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-result.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt new file mode 100644 index 0000000..efa2bad --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at not_a_cxx_feature.cmake:3 \(target_compile_features\): + target_compile_features specified unknown feature "cxx_not_a_feature" for + target "main". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake b/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake new file mode 100644 index 0000000..0207b72 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake @@ -0,0 +1,6 @@ + +add_executable(main empty.cpp) +target_compile_features(main + PRIVATE + cxx_not_a_feature +) diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-result.txt b/Tests/RunCMake/target_compile_features/not_enough_args-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_enough_args-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt new file mode 100644 index 0000000..2f8d812 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at not_enough_args.cmake:3 \(target_compile_features\): + target_compile_features called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/not_enough_args.cmake b/Tests/RunCMake/target_compile_features/not_enough_args.cmake new file mode 100644 index 0000000..9561230 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/not_enough_args.cmake @@ -0,0 +1,3 @@ + +add_executable(main empty.cpp) +target_compile_features(main) diff --git a/Tests/RunCMake/target_compile_features/utility_target-result.txt b/Tests/RunCMake/target_compile_features/utility_target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_compile_features/utility_target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt new file mode 100644 index 0000000..d239059 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at utility_target.cmake:4 \(target_compile_features\): + target_compile_features called with non-compilable target type +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_compile_features/utility_target.cmake b/Tests/RunCMake/target_compile_features/utility_target.cmake new file mode 100644 index 0000000..8919056 --- /dev/null +++ b/Tests/RunCMake/target_compile_features/utility_target.cmake @@ -0,0 +1,4 @@ + +add_custom_target(utility) + +target_compile_features(utility PRIVATE cxx_delegating_constructors) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt index d27686d..8e3f315 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0023-NEW-2.cmake:11 \(target_link_libraries\): - Policy CMP0023 is not set: Plain and keyword target_link_libraries - signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The plain signature for target_link_libraries has already been used with the target "foo". All uses of target_link_libraries with a target must be either all-keyword or all-plain. diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt index d7be0ff..2ef2290 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0023-NEW.cmake:11 \(target_link_libraries\): - Policy CMP0023 is not set: Plain and keyword target_link_libraries - signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The plain signature for target_link_libraries has already been used with the target "foo". All uses of target_link_libraries with a target must be either all-keyword or all-plain. diff --git a/Tests/SourcesProperty/CMakeLists.txt b/Tests/SourcesProperty/CMakeLists.txt new file mode 100644 index 0000000..6c99e00 --- /dev/null +++ b/Tests/SourcesProperty/CMakeLists.txt @@ -0,0 +1,12 @@ + +cmake_minimum_required(VERSION 3.0) + +project(SourcesProperty) + +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_SOURCES iface.cpp) + +add_executable(SourcesProperty main.cpp) +target_link_libraries(SourcesProperty iface) + +set_property(TARGET SourcesProperty APPEND PROPERTY SOURCES prop.cpp) diff --git a/Tests/SourcesProperty/iface.cpp b/Tests/SourcesProperty/iface.cpp new file mode 100644 index 0000000..e38ac37 --- /dev/null +++ b/Tests/SourcesProperty/iface.cpp @@ -0,0 +1,5 @@ + +int iface() +{ + return 0; +} diff --git a/Tests/SourcesProperty/iface.h b/Tests/SourcesProperty/iface.h new file mode 100644 index 0000000..6da80a4 --- /dev/null +++ b/Tests/SourcesProperty/iface.h @@ -0,0 +1,4 @@ + +int iface(); + +int prop(); diff --git a/Tests/SourcesProperty/main.cpp b/Tests/SourcesProperty/main.cpp new file mode 100644 index 0000000..33a97f4 --- /dev/null +++ b/Tests/SourcesProperty/main.cpp @@ -0,0 +1,7 @@ + +#include "iface.h" + +int main(int argc, char** argv) +{ + return iface() + prop(); +} diff --git a/Tests/SourcesProperty/prop.cpp b/Tests/SourcesProperty/prop.cpp new file mode 100644 index 0000000..e343431 --- /dev/null +++ b/Tests/SourcesProperty/prop.cpp @@ -0,0 +1,5 @@ + +int prop() +{ + return 0; +} diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt index 922776d..49ff7fe 100644 --- a/Tests/StagingPrefix/CMakeLists.txt +++ b/Tests/StagingPrefix/CMakeLists.txt @@ -38,6 +38,7 @@ add_custom_command( --build-project Producer --build-target install --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options -DCMAKE_VERBOSE_MAKEFILE=1 @@ -71,6 +72,7 @@ add_custom_command( --build-project Consumer --build-target install --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-options "-DCMAKE_FIND_ROOT_PATH=${CMAKE_BINARY_DIR}/ignored" diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 00383ab..e6c6152 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -55,6 +55,16 @@ else() "file(STRINGS) incorrectly read from srec file [${infile_strings}]") endif() +#this file has utf-8 content +file(STRINGS test.utf8 infile_strings ENCODING UTF-8) +list(LENGTH infile_strings content_len) +if(content_len MATCHES "3") + message("file(STRINGS) correctly read from utf8 file [${infile_strings}]") +else() + message(SEND_ERROR + "file(STRINGS) incorrectly read from utf8 file [${infile_strings}]") +endif() + # String test string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") string(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") @@ -113,7 +123,7 @@ string(STRIP "ST2 " ST2) string(STRIP " ST3" ST3) foreach(var ST1 ST2 ST3) - if("${var}" STREQUAL "${${var}}") + if("x${var}" STREQUAL "x${${var}}") message("[${var}] == [${${var}}]") else() message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") @@ -127,12 +137,6 @@ string(LENGTH ${substringres} lengthres) file(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest") -# Escaping test -set(var "\\ \" \ \t \n \r \# \( \) \0") -message("Output: [${var}]") -set(var \\ \" \ \t \n \r \# \( \) \0) -message("Output: [${var}]") - # Make-style unquoted argument test set(var $(VAR1)$(VAR2)/$(VAR3)) message("Output: [${var}]") @@ -141,13 +145,6 @@ if(NOT result) message(SEND_ERROR "Unquoted $(VAR) syntax is broken.") endif() -# Obscure environment variable name -set("ENV{x+(y)}" "Obscure environment variable value") -message("Output: [$ENV{x+(y)}]") -if(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value") - message(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.") -endif() - # Make directories test file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Includes" @@ -286,3 +283,9 @@ string(MAKE_C_IDENTIFIER "1one-two$" MCI_1) if(NOT MCI_1 STREQUAL _1one_two_) message(SEND_ERROR "MAKE_C_IDENTIFIER did not create expected result.") endif() + +string(GENEX_STRIP "one;$<1:two;three>;four;$<TARGET_OBJECTS:some_target>" strip_result) + +if (NOT strip_result STREQUAL "one;four") + message(SEND_ERROR "GENEX_STRIP did not create expected result: ${strip_result}") +endif() diff --git a/Tests/StringFileTest/test.utf8 b/Tests/StringFileTest/test.utf8 new file mode 100644 index 0000000..6c29170 --- /dev/null +++ b/Tests/StringFileTest/test.utf8 @@ -0,0 +1,3 @@ +The value of Ï€ (pi) is 3.141593 +Line mixed with binary partially matches valid utf8: Ï€ is à93.1593 +à
\ No newline at end of file diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt index 69f1d68..40c265e 100644 --- a/Tests/SubDirSpaces/CMakeLists.txt +++ b/Tests/SubDirSpaces/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6) project(SUBDIR) # Some systems do not seem to support rpath with spaces. -if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") +if(CMAKE_SYSTEM_NAME MATCHES "IRIX|QNX") set(CMAKE_SKIP_BUILD_RPATH 1) endif() diff --git a/Tests/SubProject/CMakeLists.txt b/Tests/SubProject/CMakeLists.txt index b669621..b2bada9 100644 --- a/Tests/SubProject/CMakeLists.txt +++ b/Tests/SubProject/CMakeLists.txt @@ -1,6 +1,15 @@ cmake_minimum_required (VERSION 2.6) project(SubProject) -message("${CMAKE_IMPORT_LIBRARY_SUFFIX}") +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/gen.cxx) # require generation +add_custom_command( + OUTPUT gen.cxx + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen.cxx.in + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/gen.cxx.in gen.cxx + ) +add_custom_target(gen DEPENDS gen.cxx) add_library(bar bar.cxx) +target_include_directories(bar PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +add_dependencies(bar gen) add_executable(car car.cxx) add_subdirectory(foo) diff --git a/Tests/SubProject/bar.cxx b/Tests/SubProject/bar.cxx index c3f6a18..c8b8743 100644 --- a/Tests/SubProject/bar.cxx +++ b/Tests/SubProject/bar.cxx @@ -1,4 +1 @@ -int bar() -{ - return 10; -} +#include "gen.cxx" diff --git a/Tests/SubProject/gen.cxx.in b/Tests/SubProject/gen.cxx.in new file mode 100644 index 0000000..c3f6a18 --- /dev/null +++ b/Tests/SubProject/gen.cxx.in @@ -0,0 +1,4 @@ +int bar() +{ + return 10; +} diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index c33380f..db54612 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.0) project(SystemInformation) include_directories("This does not exists") diff --git a/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in index df3bf49..f7e81e6 100644 --- a/Tests/SystemInformation/SystemInformation.in +++ b/Tests/SystemInformation/SystemInformation.in @@ -19,8 +19,26 @@ CMAKE_COMPILER_IS_GNUCC == "${CMAKE_COMPILER_IS_GNUCC}" CMAKE_COMPILER_IS_GNUCXX == "${CMAKE_COMPILER_IS_GNUCXX}" CMAKE_C_COMPILER_ID == "${CMAKE_C_COMPILER_ID}" CMAKE_C_COMPILER_VERSION == "${CMAKE_C_COMPILER_VERSION}" +CMAKE_C90_STANDARD_COMPILE_OPTION == "${CMAKE_C90_STANDARD_COMPILE_OPTION}" +CMAKE_C99_STANDARD_COMPILE_OPTION == "${CMAKE_C99_STANDARD_COMPILE_OPTION}" +CMAKE_C11_STANDARD_COMPILE_OPTION == "${CMAKE_C11_STANDARD_COMPILE_OPTION}" +CMAKE_C90_EXTENSION_COMPILE_OPTION == "${CMAKE_C90_EXTENSION_COMPILE_OPTION}" +CMAKE_C99_EXTENSION_COMPILE_OPTION == "${CMAKE_C99_EXTENSION_COMPILE_OPTION}" +CMAKE_C11_EXTENSION_COMPILE_OPTION == "${CMAKE_C11_EXTENSION_COMPILE_OPTION}" +CMAKE_C_COMPILE_FEATURES == "${CMAKE_C_COMPILE_FEATURES}" +CMAKE_C90_COMPILE_FEATURES == "${CMAKE_C90_COMPILE_FEATURES}" +CMAKE_C99_COMPILE_FEATURES == "${CMAKE_C99_COMPILE_FEATURES}" +CMAKE_C11_COMPILE_FEATURES == "${CMAKE_C11_COMPILE_FEATURES}" CMAKE_CXX_COMPILER_ID == "${CMAKE_CXX_COMPILER_ID}" CMAKE_CXX_COMPILER_VERSION == "${CMAKE_CXX_COMPILER_VERSION}" +CMAKE_CXX98_STANDARD_COMPILE_OPTION == "${CMAKE_CXX98_STANDARD_COMPILE_OPTION}" +CMAKE_CXX11_STANDARD_COMPILE_OPTION == "${CMAKE_CXX11_STANDARD_COMPILE_OPTION}" +CMAKE_CXX98_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX98_EXTENSION_COMPILE_OPTION}" +CMAKE_CXX11_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}" +CMAKE_CXX_COMPILE_FEATURES == "${CMAKE_CXX_COMPILE_FEATURES}" +CMAKE_CXX98_COMPILE_FEATURES == "${CMAKE_CXX98_COMPILE_FEATURES}" +CMAKE_CXX11_COMPILE_FEATURES == "${CMAKE_CXX11_COMPILE_FEATURES}" +CMAKE_CXX14_COMPILE_FEATURES == "${CMAKE_CXX14_COMPILE_FEATURES}" // C shared library flag CMAKE_SHARED_LIBRARY_C_FLAGS == "${CMAKE_SHARED_LIBRARY_C_FLAGS}" diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index 8fc2871..73ea05a 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -6,7 +6,7 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") else() set(PROJECT_EXT vcproj) endif() -if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012]") +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[0124]") set(PROJECT_EXT vcxproj) endif() @@ -19,7 +19,9 @@ make_directory("${LIB2_BINARY_DIR}") # generate lib1 execute_process( - COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib1" + COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" + -A "${CMAKE_GENERATOR_PLATFORM}" + -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib1" WORKING_DIRECTORY ${LIB1_BINARY_DIR} OUTPUT_VARIABLE OUT ERROR_VARIABLE OUT @@ -28,7 +30,9 @@ message("CMAKE Ran with the following output:\n\"${OUT}\"") # generate lib2 execute_process( - COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib2" + COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" + -A "${CMAKE_GENERATOR_PLATFORM}" + -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib2" WORKING_DIRECTORY ${LIB2_BINARY_DIR} OUTPUT_VARIABLE OUT ERROR_VARIABLE OUT @@ -54,7 +58,7 @@ add_dependencies(VSExternalInclude lib2) # and the sln file can no longer be the only source # of that depend. So, for VS 10 make the executable # depend on lib1 and lib2 -if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012]") +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[0124]") add_dependencies(VSExternalInclude lib1) endif() diff --git a/Tests/VSMASM/CMakeLists.txt b/Tests/VSMASM/CMakeLists.txt new file mode 100644 index 0000000..f2570a3 --- /dev/null +++ b/Tests/VSMASM/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 2.8.12) +project(VSMASM C ASM_MASM) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + add_definitions(-DTESTx64) +else() + add_definitions(-DTESTi386) + set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /safeseh") +endif() +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +add_executable(VSMASM main.c foo.asm) diff --git a/Tests/VSMASM/foo.asm b/Tests/VSMASM/foo.asm new file mode 100644 index 0000000..51cb969 --- /dev/null +++ b/Tests/VSMASM/foo.asm @@ -0,0 +1,7 @@ +ifndef TESTx64 +.386 +.model flat, c +endif +.code +include <foo-proc.asm> +end diff --git a/Tests/VSMASM/include/foo-proc.asm b/Tests/VSMASM/include/foo-proc.asm new file mode 100644 index 0000000..e8ba5dc --- /dev/null +++ b/Tests/VSMASM/include/foo-proc.asm @@ -0,0 +1,4 @@ +foo proc public + mov eax,0 + ret +foo endp diff --git a/Tests/VSMASM/main.c b/Tests/VSMASM/main.c new file mode 100644 index 0000000..570ba16 --- /dev/null +++ b/Tests/VSMASM/main.c @@ -0,0 +1,2 @@ +extern int foo(void); +int main(void) { return foo(); } diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt new file mode 100644 index 0000000..0041c75 --- /dev/null +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -0,0 +1,114 @@ +cmake_minimum_required(VERSION 3.0) +project(VSWinStorePhone) + +if(MSVC_VERSION GREATER 1700) + set(COMPILER_VERSION "12") +elseif(MSVC_VERSION GREATER 1600) + set(COMPILER_VERSION "11") +endif() + +set (APP_MANIFEST_NAME Package.appxmanifest) +if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") + set(PLATFORM WP) + add_definitions("-DPHONE") + if("${CMAKE_SYSTEM_VERSION}" STREQUAL "8.0") + set(APP_MANIFEST_NAME WMAppManifest.xml) + set(WINDOWS_PHONE8 1) + endif() +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") + set(PLATFORM STORE) +else() + set(PLATFORM DESKTOP) + message(FATAL_ERROR "This app supports Store / Phone only. Please edit the target platform.") +endif() + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(EXE_NAME Direct3DApp1) +set(SHORT_NAME ${EXE_NAME}) +set(PACKAGE_GUID "6514377e-dfd4-4cdb-80df-4e0366346efc") + +if (NOT "${PLATFORM}" STREQUAL "DESKTOP") + configure_file( + cmake/Package_vc${COMPILER_VERSION}.${PLATFORM}.appxmanifest.in + ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME} + @ONLY) +endif() + +set(SOURCE_FILES + Direct3DApp1/CubeRenderer.cpp + Direct3DApp1/Direct3DApp1.cpp + Direct3DApp1/Direct3DBase.cpp + Direct3DApp1/pch.cpp + ) + +set(HEADER_FILES + Direct3DApp1/BasicTimer.h + Direct3DApp1/CubeRenderer.h + Direct3DApp1/Direct3DApp1.h + Direct3DApp1/Direct3DBase.h + Direct3DApp1/DirectXHelper.h + Direct3DApp1/pch.h + ) + +set(PIXELSHADER_FILES + Direct3DApp1/SimplePixelShader.hlsl + ) + +set(VERTEXSHADER_FILES + Direct3DApp1/SimpleVertexShader.hlsl + ) + +set(CONTENT_FILES ${PIXELSHADER_FILES} ${VERTEXSHADER_FILES}) + +if (WINDOWS_PHONE8) + set(CONTENT_FILES ${CONTENT_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME} + Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png + Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png + Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png + Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png + Direct3DApp1/Assets/Tiles/IconicTileSmall.png + Direct3DApp1/Assets/ApplicationIcon.png + ) + # Windows Phone 8.0 needs to copy all the images. + # It doesn't know to use relative paths. + file(COPY + Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png + Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png + Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png + Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png + Direct3DApp1/Assets/Tiles/IconicTileSmall.png + Direct3DApp1/Assets/ApplicationIcon.png + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + ) + +elseif (NOT "${PLATFORM}" STREQUAL "DESKTOP") + set(CONTENT_FILES ${CONTENT_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME} + Direct3DApp1/Assets/Logo.png + Direct3DApp1/Assets/SmallLogo.png + Direct3DApp1/Assets/SplashScreen.png + Direct3DApp1/Assets/StoreLogo.png + ) +endif() + +set(RESOURCE_FILES + ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES} + Direct3DApp1/Direct3DApp1_TemporaryKey.pfx) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>) +set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY + VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>) + +set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) +set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex) + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) + +add_executable(${EXE_NAME} WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES}) +set_property(TARGET ${EXE_NAME} PROPERTY VS_WINRT_COMPONENT TRUE) +target_link_libraries(${EXE_NAME} d3d11) diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png Binary files differnew file mode 100644 index 0000000..7d95d4e --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png Binary files differnew file mode 100644 index 0000000..e26771c --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png Binary files differnew file mode 100644 index 0000000..1eb0d9d --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png Binary files differnew file mode 100644 index 0000000..c951e03 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png Binary files differnew file mode 100644 index 0000000..dcb6727 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png Binary files differnew file mode 100644 index 0000000..e0c59ac --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png Binary files differnew file mode 100644 index 0000000..e93b89d --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png Binary files differnew file mode 100644 index 0000000..550b1b5 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png Binary files differnew file mode 100644 index 0000000..686e6b5 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png Binary files differnew file mode 100644 index 0000000..d4b5ede --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png diff --git a/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h b/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h new file mode 100644 index 0000000..b58c77d --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h @@ -0,0 +1,76 @@ +#pragma once + +#include <wrl.h> + +// Helper class for basic timing. +ref class BasicTimer sealed +{ +public: + // Initializes internal timer values. + BasicTimer() + { + if (!QueryPerformanceFrequency(&m_frequency)) + { + throw ref new Platform::FailureException(); + } + Reset(); + } + + // Reset the timer to initial values. + void Reset() + { + Update(); + m_startTime = m_currentTime; + m_total = 0.0f; + m_delta = 1.0f / 60.0f; + } + + // Update the timer's internal values. + void Update() + { + if (!QueryPerformanceCounter(&m_currentTime)) + { + throw ref new Platform::FailureException(); + } + + m_total = static_cast<float>( + static_cast<double>(m_currentTime.QuadPart - m_startTime.QuadPart) / + static_cast<double>(m_frequency.QuadPart) + ); + + if (m_lastTime.QuadPart == m_startTime.QuadPart) + { + // If the timer was just reset, report a time delta equivalent to 60Hz frame time. + m_delta = 1.0f / 60.0f; + } + else + { + m_delta = static_cast<float>( + static_cast<double>(m_currentTime.QuadPart - m_lastTime.QuadPart) / + static_cast<double>(m_frequency.QuadPart) + ); + } + + m_lastTime = m_currentTime; + } + + // Duration in seconds between the last call to Reset() and the last call to Update(). + property float Total + { + float get() { return m_total; } + } + + // Duration in seconds between the previous two calls to Update(). + property float Delta + { + float get() { return m_delta; } + } + +private: + LARGE_INTEGER m_frequency; + LARGE_INTEGER m_currentTime; + LARGE_INTEGER m_startTime; + LARGE_INTEGER m_lastTime; + float m_total; + float m_delta; +}; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp new file mode 100644 index 0000000..f4827f2 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp @@ -0,0 +1,260 @@ +#include "pch.h" +#include "CubeRenderer.h" + +using namespace DirectX; +using namespace Microsoft::WRL; +using namespace Windows::Foundation; +using namespace Windows::UI::Core; + +CubeRenderer::CubeRenderer() : + m_loadingComplete(false), + m_indexCount(0) +{ +} + +void CubeRenderer::CreateDeviceResources() +{ + Direct3DBase::CreateDeviceResources(); + + auto loadVSTask = DX::ReadDataAsync("SimpleVertexShader.cso"); + auto loadPSTask = DX::ReadDataAsync("SimplePixelShader.cso"); + + auto createVSTask = loadVSTask.then([this](Platform::Array<byte>^ fileData) { + DX::ThrowIfFailed( + m_d3dDevice->CreateVertexShader( + fileData->Data, + fileData->Length, + nullptr, + &m_vertexShader + ) + ); + + const D3D11_INPUT_ELEMENT_DESC vertexDesc[] = + { + { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + { "COLOR", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + }; + + DX::ThrowIfFailed( + m_d3dDevice->CreateInputLayout( + vertexDesc, + ARRAYSIZE(vertexDesc), + fileData->Data, + fileData->Length, + &m_inputLayout + ) + ); + }); + + auto createPSTask = loadPSTask.then([this](Platform::Array<byte>^ fileData) { + DX::ThrowIfFailed( + m_d3dDevice->CreatePixelShader( + fileData->Data, + fileData->Length, + nullptr, + &m_pixelShader + ) + ); + + CD3D11_BUFFER_DESC constantBufferDesc(sizeof(ModelViewProjectionConstantBuffer), D3D11_BIND_CONSTANT_BUFFER); + DX::ThrowIfFailed( + m_d3dDevice->CreateBuffer( + &constantBufferDesc, + nullptr, + &m_constantBuffer + ) + ); + }); + + auto createCubeTask = (createPSTask && createVSTask).then([this] () { + VertexPositionColor cubeVertices[] = + { + {XMFLOAT3(-0.5f, -0.5f, -0.5f), XMFLOAT3(0.0f, 0.0f, 0.0f)}, + {XMFLOAT3(-0.5f, -0.5f, 0.5f), XMFLOAT3(0.0f, 0.0f, 1.0f)}, + {XMFLOAT3(-0.5f, 0.5f, -0.5f), XMFLOAT3(0.0f, 1.0f, 0.0f)}, + {XMFLOAT3(-0.5f, 0.5f, 0.5f), XMFLOAT3(0.0f, 1.0f, 1.0f)}, + {XMFLOAT3( 0.5f, -0.5f, -0.5f), XMFLOAT3(1.0f, 0.0f, 0.0f)}, + {XMFLOAT3( 0.5f, -0.5f, 0.5f), XMFLOAT3(1.0f, 0.0f, 1.0f)}, + {XMFLOAT3( 0.5f, 0.5f, -0.5f), XMFLOAT3(1.0f, 1.0f, 0.0f)}, + {XMFLOAT3( 0.5f, 0.5f, 0.5f), XMFLOAT3(1.0f, 1.0f, 1.0f)}, + }; + + D3D11_SUBRESOURCE_DATA vertexBufferData = {0}; + vertexBufferData.pSysMem = cubeVertices; + vertexBufferData.SysMemPitch = 0; + vertexBufferData.SysMemSlicePitch = 0; + CD3D11_BUFFER_DESC vertexBufferDesc(sizeof(cubeVertices), D3D11_BIND_VERTEX_BUFFER); + DX::ThrowIfFailed( + m_d3dDevice->CreateBuffer( + &vertexBufferDesc, + &vertexBufferData, + &m_vertexBuffer + ) + ); + + unsigned short cubeIndices[] = + { + 0,2,1, // -x + 1,2,3, + + 4,5,6, // +x + 5,7,6, + + 0,1,5, // -y + 0,5,4, + + 2,6,7, // +y + 2,7,3, + + 0,4,6, // -z + 0,6,2, + + 1,3,7, // +z + 1,7,5, + }; + + m_indexCount = ARRAYSIZE(cubeIndices); + + D3D11_SUBRESOURCE_DATA indexBufferData = {0}; + indexBufferData.pSysMem = cubeIndices; + indexBufferData.SysMemPitch = 0; + indexBufferData.SysMemSlicePitch = 0; + CD3D11_BUFFER_DESC indexBufferDesc(sizeof(cubeIndices), D3D11_BIND_INDEX_BUFFER); + DX::ThrowIfFailed( + m_d3dDevice->CreateBuffer( + &indexBufferDesc, + &indexBufferData, + &m_indexBuffer + ) + ); + }); + + createCubeTask.then([this] () { + m_loadingComplete = true; + }); +} + +void CubeRenderer::CreateWindowSizeDependentResources() +{ + Direct3DBase::CreateWindowSizeDependentResources(); + + float aspectRatio = m_windowBounds.Width / m_windowBounds.Height; + float fovAngleY = 70.0f * XM_PI / 180.0f; + if (aspectRatio < 1.0f) + { + fovAngleY /= aspectRatio; + } + + // Note that the m_orientationTransform3D matrix is post-multiplied here + // in order to correctly orient the scene to match the display orientation. + // This post-multiplication step is required for any draw calls that are + // made to the swap chain render target. For draw calls to other targets, + // this transform should not be applied. + XMStoreFloat4x4( + &m_constantBufferData.projection, + XMMatrixTranspose( + XMMatrixMultiply( + XMMatrixPerspectiveFovRH( + fovAngleY, + aspectRatio, + 0.01f, + 100.0f + ), + XMLoadFloat4x4(&m_orientationTransform3D) + ) + ) + ); +} + +void CubeRenderer::Update(float timeTotal, float timeDelta) +{ + (void) timeDelta; // Unused parameter. + + XMVECTOR eye = XMVectorSet(0.0f, 0.7f, 1.5f, 0.0f); + XMVECTOR at = XMVectorSet(0.0f, -0.1f, 0.0f, 0.0f); + XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); + + XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(XMMatrixLookAtRH(eye, at, up))); + XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixTranspose(XMMatrixRotationY(timeTotal * XM_PIDIV4))); +} + +void CubeRenderer::Render() +{ + const float midnightBlue[] = { 0.098f, 0.098f, 0.439f, 1.000f }; + m_d3dContext->ClearRenderTargetView( + m_renderTargetView.Get(), + midnightBlue + ); + + m_d3dContext->ClearDepthStencilView( + m_depthStencilView.Get(), + D3D11_CLEAR_DEPTH, + 1.0f, + 0 + ); + + // Only draw the cube once it is loaded (loading is asynchronous). + if (!m_loadingComplete) + { + return; + } + + m_d3dContext->OMSetRenderTargets( + 1, + m_renderTargetView.GetAddressOf(), + m_depthStencilView.Get() + ); + + m_d3dContext->UpdateSubresource( + m_constantBuffer.Get(), + 0, + NULL, + &m_constantBufferData, + 0, + 0 + ); + + UINT stride = sizeof(VertexPositionColor); + UINT offset = 0; + m_d3dContext->IASetVertexBuffers( + 0, + 1, + m_vertexBuffer.GetAddressOf(), + &stride, + &offset + ); + + m_d3dContext->IASetIndexBuffer( + m_indexBuffer.Get(), + DXGI_FORMAT_R16_UINT, + 0 + ); + + m_d3dContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + + m_d3dContext->IASetInputLayout(m_inputLayout.Get()); + + m_d3dContext->VSSetShader( + m_vertexShader.Get(), + nullptr, + 0 + ); + + m_d3dContext->VSSetConstantBuffers( + 0, + 1, + m_constantBuffer.GetAddressOf() + ); + + m_d3dContext->PSSetShader( + m_pixelShader.Get(), + nullptr, + 0 + ); + + m_d3dContext->DrawIndexed( + m_indexCount, + 0, + 0 + ); +} diff --git a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.h b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.h new file mode 100644 index 0000000..68cb188 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Direct3DBase.h" + +struct ModelViewProjectionConstantBuffer +{ + DirectX::XMFLOAT4X4 model; + DirectX::XMFLOAT4X4 view; + DirectX::XMFLOAT4X4 projection; +}; + +struct VertexPositionColor +{ + DirectX::XMFLOAT3 pos; + DirectX::XMFLOAT3 color; +}; + +// This class renders a simple spinning cube. +ref class CubeRenderer sealed : public Direct3DBase +{ +public: + CubeRenderer(); + + // Direct3DBase methods. + virtual void CreateDeviceResources() override; + virtual void CreateWindowSizeDependentResources() override; + virtual void Render() override; + + // Method for updating time-dependent objects. + void Update(float timeTotal, float timeDelta); + +private: + bool m_loadingComplete; + + Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout; + Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer; + Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer; + Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader; + Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader; + Microsoft::WRL::ComPtr<ID3D11Buffer> m_constantBuffer; + + uint32 m_indexCount; + ModelViewProjectionConstantBuffer m_constantBufferData; +}; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.cpp b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.cpp new file mode 100644 index 0000000..3dbb97f --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.cpp @@ -0,0 +1,153 @@ +#include "pch.h" +#include "Direct3DApp1.h" +#include "BasicTimer.h" + +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Core; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::UI::Core; +using namespace Windows::System; +using namespace Windows::Foundation; +using namespace Windows::Graphics::Display; +using namespace concurrency; + +Direct3DApp1::Direct3DApp1() : + m_windowClosed(false), + m_windowVisible(true) +{ +} + +void Direct3DApp1::Initialize(CoreApplicationView^ applicationView) +{ + applicationView->Activated += + ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &Direct3DApp1::OnActivated); + + CoreApplication::Suspending += + ref new EventHandler<SuspendingEventArgs^>(this, &Direct3DApp1::OnSuspending); + + CoreApplication::Resuming += + ref new EventHandler<Platform::Object^>(this, &Direct3DApp1::OnResuming); + + m_renderer = ref new CubeRenderer(); +} + +void Direct3DApp1::SetWindow(CoreWindow^ window) +{ + window->SizeChanged += + ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &Direct3DApp1::OnWindowSizeChanged); + + window->VisibilityChanged += + ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &Direct3DApp1::OnVisibilityChanged); + + window->Closed += + ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &Direct3DApp1::OnWindowClosed); + +#ifndef PHONE + window->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); +#endif + + window->PointerPressed += + ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &Direct3DApp1::OnPointerPressed); + + window->PointerMoved += + ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &Direct3DApp1::OnPointerMoved); + + m_renderer->Initialize(CoreWindow::GetForCurrentThread()); +} + +void Direct3DApp1::Load(Platform::String^ entryPoint) +{ +} + +void Direct3DApp1::Run() +{ + BasicTimer^ timer = ref new BasicTimer(); + + while (!m_windowClosed) + { + if (m_windowVisible) + { + timer->Update(); + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); + m_renderer->Update(timer->Total, timer->Delta); + m_renderer->Render(); + m_renderer->Present(); // This call is synchronized to the display frame rate. + } + else + { + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); + } + } +} + +void Direct3DApp1::Uninitialize() +{ +} + +void Direct3DApp1::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) +{ + m_renderer->UpdateForWindowSizeChange(); +} + +void Direct3DApp1::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) +{ + m_windowVisible = args->Visible; +} + +void Direct3DApp1::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) +{ + m_windowClosed = true; +} + +void Direct3DApp1::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) +{ + // Insert your code here. +} + +void Direct3DApp1::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) +{ + // Insert your code here. +} + +void Direct3DApp1::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) +{ + CoreWindow::GetForCurrentThread()->Activate(); +} + +void Direct3DApp1::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args) +{ + // Save app state asynchronously after requesting a deferral. Holding a deferral + // indicates that the application is busy performing suspending operations. Be + // aware that a deferral may not be held indefinitely. After about five seconds, + // the app will be forced to exit. + SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral(); + m_renderer->ReleaseResourcesForSuspending(); + + create_task([this, deferral]() + { + // Insert your code here. + + deferral->Complete(); + }); +} + +void Direct3DApp1::OnResuming(Platform::Object^ sender, Platform::Object^ args) +{ + // Restore any data or state that was unloaded on suspend. By default, data + // and state are persisted when resuming from suspend. Note that this event + // does not occur if the app was previously terminated. + m_renderer->CreateWindowSizeDependentResources(); +} + +IFrameworkView^ Direct3DApplicationSource::CreateView() +{ + return ref new Direct3DApp1(); +} + +[Platform::MTAThread] +int main(Platform::Array<Platform::String^>^) +{ + auto direct3DApplicationSource = ref new Direct3DApplicationSource(); + CoreApplication::Run(direct3DApplicationSource); + return 0; +} diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h new file mode 100644 index 0000000..40b69a1 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h @@ -0,0 +1,40 @@ +#pragma once + +#include "pch.h" +#include "CubeRenderer.h" + +ref class Direct3DApp1 sealed : public Windows::ApplicationModel::Core::IFrameworkView +{ +public: + Direct3DApp1(); + + // IFrameworkView Methods. + virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView); + virtual void SetWindow(Windows::UI::Core::CoreWindow^ window); + virtual void Load(Platform::String^ entryPoint); + virtual void Run(); + virtual void Uninitialize(); + +protected: + // Event Handlers. + void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args); + void OnLogicalDpiChanged(Platform::Object^ sender); + void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args); + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args); + void OnResuming(Platform::Object^ sender, Platform::Object^ args); + void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); + void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); + void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); + void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); + +private: + CubeRenderer^ m_renderer; + bool m_windowClosed; + bool m_windowVisible; +}; + +ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource +{ +public: + virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView(); +}; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1_TemporaryKey.pfx b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1_TemporaryKey.pfx Binary files differnew file mode 100644 index 0000000..1cad999 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1_TemporaryKey.pfx diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp new file mode 100644 index 0000000..46727b5 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp @@ -0,0 +1,384 @@ +#include "pch.h" +#include "Direct3DBase.h" + +using namespace DirectX; +using namespace Microsoft::WRL; +using namespace Windows::UI::Core; +using namespace Windows::Foundation; +using namespace Windows::Graphics::Display; + +// Constructor. +Direct3DBase::Direct3DBase() +{ +} + +// Initialize the Direct3D resources required to run. +void Direct3DBase::Initialize(CoreWindow^ window) +{ + m_window = window; + + CreateDeviceResources(); + CreateWindowSizeDependentResources(); +} + +// Recreate all device resources and set them back to the current state. +void Direct3DBase::HandleDeviceLost() +{ + // Reset these member variables to ensure that UpdateForWindowSizeChange recreates all resources. + m_windowBounds.Width = 0; + m_windowBounds.Height = 0; + m_swapChain = nullptr; + + CreateDeviceResources(); + UpdateForWindowSizeChange(); +} + +// These are the resources that depend on the device. +void Direct3DBase::CreateDeviceResources() +{ + // This flag adds support for surfaces with a different color channel ordering + // than the API default. It is required for compatibility with Direct2D. + UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT; + +#if defined(_DEBUG) + // If the project is in a debug build, enable debugging via SDK Layers with this flag. + creationFlags |= D3D11_CREATE_DEVICE_DEBUG; +#endif + + // This array defines the set of DirectX hardware feature levels this app will support. + // Note the ordering should be preserved. + // Don't forget to declare your application's minimum required feature level in its + // description. All applications are assumed to support 9.1 unless otherwise stated. + D3D_FEATURE_LEVEL featureLevels[] = + { + D3D_FEATURE_LEVEL_11_1, + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, + D3D_FEATURE_LEVEL_9_3, + D3D_FEATURE_LEVEL_9_2, + D3D_FEATURE_LEVEL_9_1 + }; + + // Create the Direct3D 11 API device object and a corresponding context. + ComPtr<ID3D11Device> device; + ComPtr<ID3D11DeviceContext> context; + DX::ThrowIfFailed( + D3D11CreateDevice( + nullptr, // Specify nullptr to use the default adapter. + D3D_DRIVER_TYPE_HARDWARE, + nullptr, + creationFlags, // Set set debug and Direct2D compatibility flags. + featureLevels, // List of feature levels this app can support. + ARRAYSIZE(featureLevels), + D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION for Windows Store apps. + &device, // Returns the Direct3D device created. + &m_featureLevel, // Returns feature level of device created. + &context // Returns the device immediate context. + ) + ); + + // Get the Direct3D 11.1 API device and context interfaces. + DX::ThrowIfFailed( + device.As(&m_d3dDevice) + ); + + DX::ThrowIfFailed( + context.As(&m_d3dContext) + ); +} + +// Allocate all memory resources that change on a window SizeChanged event. +void Direct3DBase::CreateWindowSizeDependentResources() +{ + // Store the window bounds so the next time we get a SizeChanged event we can + // avoid rebuilding everything if the size is identical. + m_windowBounds = m_window->Bounds; + + // Calculate the necessary swap chain and render target size in pixels. + float windowWidth = ConvertDipsToPixels(m_windowBounds.Width); + float windowHeight = ConvertDipsToPixels(m_windowBounds.Height); + + // The width and height of the swap chain must be based on the window's + // landscape-oriented width and height. If the window is in a portrait + // orientation, the dimensions must be reversed. +#if WINVER > 0x0602 + m_orientation = DisplayInformation::GetForCurrentView()->CurrentOrientation; +#else +#if PHONE + // WP8 doesn't support rotations so always make it landscape + m_orientation = DisplayOrientations::Landscape; +#else + m_orientation = DisplayProperties::CurrentOrientation; +#endif +#endif + bool swapDimensions = + m_orientation == DisplayOrientations::Portrait || + m_orientation == DisplayOrientations::PortraitFlipped; + m_renderTargetSize.Width = swapDimensions ? windowHeight : windowWidth; + m_renderTargetSize.Height = swapDimensions ? windowWidth : windowHeight; + + if(m_swapChain != nullptr) + { + // If the swap chain already exists, resize it. + DX::ThrowIfFailed( + m_swapChain->ResizeBuffers( + 2, // Double-buffered swap chain. + static_cast<UINT>(m_renderTargetSize.Width), + static_cast<UINT>(m_renderTargetSize.Height), + DXGI_FORMAT_B8G8R8A8_UNORM, + 0 + ) + ); + } + else + { + // Otherwise, create a new one using the same adapter as the existing Direct3D device. + DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0}; + swapChainDesc.Width = static_cast<UINT>(m_renderTargetSize.Width); // Match the size of the window. + swapChainDesc.Height = static_cast<UINT>(m_renderTargetSize.Height); + swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format. + swapChainDesc.Stereo = false; + swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling. + swapChainDesc.SampleDesc.Quality = 0; + swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; +#if PHONE && WINVER <= 0x0602 + swapChainDesc.BufferCount = 1; // Use double-buffering to minimize latency. + swapChainDesc.Scaling = DXGI_SCALING_STRETCH; // On phone, only stretch and aspect-ratio stretch scaling are allowed. + swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; // On phone, no swap effects are supported. +#else + swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency. + swapChainDesc.Scaling = DXGI_SCALING_NONE; + swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Store apps must use this SwapEffect. +#endif + swapChainDesc.Flags = 0; + + ComPtr<IDXGIDevice1> dxgiDevice; + DX::ThrowIfFailed( + m_d3dDevice.As(&dxgiDevice) + ); + + ComPtr<IDXGIAdapter> dxgiAdapter; + DX::ThrowIfFailed( + dxgiDevice->GetAdapter(&dxgiAdapter) + ); + + ComPtr<IDXGIFactory2> dxgiFactory; + DX::ThrowIfFailed( + dxgiAdapter->GetParent( + __uuidof(IDXGIFactory2), + &dxgiFactory + ) + ); + + Windows::UI::Core::CoreWindow^ window = m_window.Get(); + DX::ThrowIfFailed( + dxgiFactory->CreateSwapChainForCoreWindow( + m_d3dDevice.Get(), + reinterpret_cast<IUnknown*>(window), + &swapChainDesc, + nullptr, // Allow on all displays. + &m_swapChain + ) + ); + + // Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and + // ensures that the application will only render after each VSync, minimizing power consumption. + DX::ThrowIfFailed( + dxgiDevice->SetMaximumFrameLatency(1) + ); + } + + // Set the proper orientation for the swap chain, and generate the + // 3D matrix transformation for rendering to the rotated swap chain. + DXGI_MODE_ROTATION rotation = DXGI_MODE_ROTATION_UNSPECIFIED; + switch (m_orientation) + { + case DisplayOrientations::Landscape: + rotation = DXGI_MODE_ROTATION_IDENTITY; + m_orientationTransform3D = XMFLOAT4X4( // 0-degree Z-rotation + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + break; + + case DisplayOrientations::Portrait: + rotation = DXGI_MODE_ROTATION_ROTATE270; + m_orientationTransform3D = XMFLOAT4X4( // 90-degree Z-rotation + 0.0f, 1.0f, 0.0f, 0.0f, + -1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + break; + + case DisplayOrientations::LandscapeFlipped: + rotation = DXGI_MODE_ROTATION_ROTATE180; + m_orientationTransform3D = XMFLOAT4X4( // 180-degree Z-rotation + -1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + break; + + case DisplayOrientations::PortraitFlipped: + rotation = DXGI_MODE_ROTATION_ROTATE90; + m_orientationTransform3D = XMFLOAT4X4( // 270-degree Z-rotation + 0.0f, -1.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + break; + + default: + throw ref new Platform::FailureException(); + } + +#if !PHONE || WINVER > 0x0602 + DX::ThrowIfFailed( + m_swapChain->SetRotation(rotation) + ); +#endif // !PHONE + + // Create a render target view of the swap chain back buffer. + ComPtr<ID3D11Texture2D> backBuffer; + DX::ThrowIfFailed( + m_swapChain->GetBuffer( + 0, + __uuidof(ID3D11Texture2D), + &backBuffer + ) + ); + + DX::ThrowIfFailed( + m_d3dDevice->CreateRenderTargetView( + backBuffer.Get(), + nullptr, + &m_renderTargetView + ) + ); + + // Create a depth stencil view. + CD3D11_TEXTURE2D_DESC depthStencilDesc( + DXGI_FORMAT_D24_UNORM_S8_UINT, + static_cast<UINT>(m_renderTargetSize.Width), + static_cast<UINT>(m_renderTargetSize.Height), + 1, + 1, + D3D11_BIND_DEPTH_STENCIL + ); + + ComPtr<ID3D11Texture2D> depthStencil; + DX::ThrowIfFailed( + m_d3dDevice->CreateTexture2D( + &depthStencilDesc, + nullptr, + &depthStencil + ) + ); + + CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D); + DX::ThrowIfFailed( + m_d3dDevice->CreateDepthStencilView( + depthStencil.Get(), + &depthStencilViewDesc, + &m_depthStencilView + ) + ); + + // Set the rendering viewport to target the entire window. + CD3D11_VIEWPORT viewport( + 0.0f, + 0.0f, + m_renderTargetSize.Width, + m_renderTargetSize.Height + ); + + m_d3dContext->RSSetViewports(1, &viewport); +} + +// This method is called in the event handler for the SizeChanged event. +void Direct3DBase::UpdateForWindowSizeChange() +{ + if (m_window->Bounds.Width != m_windowBounds.Width || + m_window->Bounds.Height != m_windowBounds.Height || +#if WINVER > 0x0602 + m_orientation != DisplayInformation::GetForCurrentView()->CurrentOrientation) +#else + m_orientation != DisplayProperties::CurrentOrientation) +#endif + { + ID3D11RenderTargetView* nullViews[] = {nullptr}; + m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr); + m_renderTargetView = nullptr; + m_depthStencilView = nullptr; + m_d3dContext->Flush(); + CreateWindowSizeDependentResources(); + } +} + +void Direct3DBase::ReleaseResourcesForSuspending() +{ + // Phone applications operate in a memory-constrained environment, so when entering + // the background it is a good idea to free memory-intensive objects that will be + // easy to restore upon reactivation. The swapchain and backbuffer are good candidates + // here, as they consume a large amount of memory and can be reinitialized quickly. + m_swapChain = nullptr; + m_renderTargetView = nullptr; + m_depthStencilView = nullptr; +} + +// Method to deliver the final image to the display. +void Direct3DBase::Present() +{ + // The first argument instructs DXGI to block until VSync, putting the application + // to sleep until the next VSync. This ensures we don't waste any cycles rendering + // frames that will never be displayed to the screen. +#if PHONE && WINVER <= 0x0602 + HRESULT hr = m_swapChain->Present(1, 0); +#else + // The application may optionally specify "dirty" or "scroll" + // rects to improve efficiency in certain scenarios. + DXGI_PRESENT_PARAMETERS parameters = { 0 }; + parameters.DirtyRectsCount = 0; + parameters.pDirtyRects = nullptr; + parameters.pScrollRect = nullptr; + parameters.pScrollOffset = nullptr; + + HRESULT hr = m_swapChain->Present1(1, 0 , ¶meters); +#endif + + // Discard the contents of the render target. + // This is a valid operation only when the existing contents will be entirely + // overwritten. If dirty or scroll rects are used, this call should be removed. + m_d3dContext->DiscardView(m_renderTargetView.Get()); + + // Discard the contents of the depth stencil. + m_d3dContext->DiscardView(m_depthStencilView.Get()); + + // If the device was removed either by a disconnect or a driver upgrade, we + // must recreate all device resources. + if (hr == DXGI_ERROR_DEVICE_REMOVED) + { + HandleDeviceLost(); + } + else + { + DX::ThrowIfFailed(hr); + } +} + +// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels. +float Direct3DBase::ConvertDipsToPixels(float dips) +{ + static const float dipsPerInch = 96.0f; +#if WINVER > 0x0602 + return floor(dips * DisplayInformation::GetForCurrentView()->LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer. +#else + return floor(dips * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer. +#endif +} diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.h b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.h new file mode 100644 index 0000000..bba9f16 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.h @@ -0,0 +1,39 @@ +#pragma once + +#include "DirectXHelper.h" + +// Helper class that initializes DirectX APIs for 3D rendering. +ref class Direct3DBase abstract +{ +internal: + Direct3DBase(); + +public: + virtual void Initialize(Windows::UI::Core::CoreWindow^ window); + virtual void HandleDeviceLost(); + virtual void CreateDeviceResources(); + virtual void CreateWindowSizeDependentResources(); + virtual void UpdateForWindowSizeChange(); + virtual void ReleaseResourcesForSuspending(); + virtual void Render() = 0; + virtual void Present(); + virtual float ConvertDipsToPixels(float dips); + +protected private: + // Direct3D Objects. + Microsoft::WRL::ComPtr<ID3D11Device1> m_d3dDevice; + Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext; + Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain; + Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView; + Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView; + + // Cached renderer properties. + D3D_FEATURE_LEVEL m_featureLevel; + Windows::Foundation::Size m_renderTargetSize; + Windows::Foundation::Rect m_windowBounds; + Platform::Agile<Windows::UI::Core::CoreWindow> m_window; + Windows::Graphics::Display::DisplayOrientations m_orientation; + + // Transform used for display orientation. + DirectX::XMFLOAT4X4 m_orientationTransform3D; +}; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/DirectXHelper.h b/Tests/VSWinStorePhone/Direct3DApp1/DirectXHelper.h new file mode 100644 index 0000000..d411a9b --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/DirectXHelper.h @@ -0,0 +1,45 @@ +#pragma once + +#include <wrl/client.h> +#include <ppl.h> +#include <ppltasks.h> + +namespace DX +{ + inline void ThrowIfFailed(HRESULT hr) + { + if (FAILED(hr)) + { + // Set a breakpoint on this line to catch Win32 API errors. + throw Platform::Exception::CreateException(hr); + } + } + + // Function that reads from a binary file asynchronously. + inline Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ filename) + { + using namespace Windows::Storage; + using namespace Concurrency; + + auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation; + + return create_task(folder->GetFileAsync(filename)).then([] (StorageFile^ file) + { +#if !PHONE + return FileIO::ReadBufferAsync(file); +#else + return file->OpenReadAsync(); + }).then([](Streams::IRandomAccessStreamWithContentType^ stream) + { + unsigned int bufferSize = static_cast<unsigned int>(stream->Size); + auto fileBuffer = ref new Streams::Buffer(bufferSize); + return stream->ReadAsync(fileBuffer, bufferSize, Streams::InputStreamOptions::None); +#endif + }).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array<byte>^ + { + auto fileData = ref new Platform::Array<byte>(fileBuffer->Length); + Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData); + return fileData; + }); + } +} diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.cso b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.cso Binary files differnew file mode 100644 index 0000000..56f9c17 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.cso diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl new file mode 100644 index 0000000..d61e2c8 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl @@ -0,0 +1,10 @@ +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float3 color : COLOR0; +}; + +float4 main(PixelShaderInput input) : SV_TARGET +{ + return float4(input.color,1.0f); +} diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.cso b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.cso Binary files differnew file mode 100644 index 0000000..ea80258 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.cso diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl new file mode 100644 index 0000000..65d60e5 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl @@ -0,0 +1,35 @@ +cbuffer ModelViewProjectionConstantBuffer : register(b0) +{ + matrix model; + matrix view; + matrix projection; +}; + +struct VertexShaderInput +{ + float3 pos : POSITION; + float3 color : COLOR0; +}; + +struct VertexShaderOutput +{ + float4 pos : SV_POSITION; + float3 color : COLOR0; +}; + +VertexShaderOutput main(VertexShaderInput input) +{ + VertexShaderOutput output; + float4 pos = float4(input.pos, 1.0f); + + // Transform the vertex position into projected space. + pos = mul(pos, model); + pos = mul(pos, view); + pos = mul(pos, projection); + output.pos = pos; + + // Pass through the color without modification. + output.color = input.color; + + return output; +} diff --git a/Tests/VSWinStorePhone/Direct3DApp1/pch.cpp b/Tests/VSWinStorePhone/Direct3DApp1/pch.cpp new file mode 100644 index 0000000..1d9f38c --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/Tests/VSWinStorePhone/Direct3DApp1/pch.h b/Tests/VSWinStorePhone/Direct3DApp1/pch.h new file mode 100644 index 0000000..2302e66 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/pch.h @@ -0,0 +1,7 @@ +#pragma once + +#include <wrl/client.h> +#include <d3d11_1.h> +#include <DirectXMath.h> +#include <memory> +#include <agile.h> diff --git a/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in new file mode 100644 index 0000000..d3cb21f --- /dev/null +++ b/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest"> + <Identity Name="@PACKAGE_GUID@" Publisher="CN=mgong" Version="1.0.0.0" /> + <Properties> + <DisplayName>@SHORT_NAME@</DisplayName> + <PublisherDisplayName>mgong</PublisherDisplayName> + <Logo>StoreLogo.png</Logo> + </Properties> + <Prerequisites> + <OSMinVersion>6.2.1</OSMinVersion> + <OSMaxVersionTested>6.2.1</OSMaxVersionTested> + </Prerequisites> + <Resources> + <Resource Language="x-generate" /> + </Resources> + <Applications> + <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="@SHORT_NAME@.App"> + <VisualElements DisplayName="@SHORT_NAME@" Description="@SHORT_NAME@" BackgroundColor="#336699" ForegroundText="light" Logo="Logo.png" SmallLogo="SmallLogo.png"> + <DefaultTile ShowName="allLogos" ShortName="@SHORT_NAME@" /> + <SplashScreen Image="SplashScreen.png" /> + </VisualElements> + </Application> + </Applications> +</Package> diff --git a/Tests/VSWinStorePhone/cmake/Package_vc11.wp.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc11.wp.appxmanifest.in new file mode 100644 index 0000000..70f3abf --- /dev/null +++ b/Tests/VSWinStorePhone/cmake/Package_vc11.wp.appxmanifest.in @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0"> + <DefaultLanguage xmlns="" code="en-US"/> + <App xmlns="" ProductID="{@PACKAGE_GUID@}" Title="@SHORT_NAME@" RuntimeType="Modern Native" Version="1.0.0.0" Genre="apps.normal" Author="mgong" Description="Simple Direct3D application" Publisher="@SHORT_NAME@" PublisherID="{c618991e-1d39-41c2-a881-d3310705a091}"> + <IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath> + <Capabilities> + <Capability Name="ID_CAP_NETWORKING" /> + <Capability Name="ID_CAP_MEDIALIB_AUDIO" /> + <Capability Name="ID_CAP_MEDIALIB_PLAYBACK" /> + </Capabilities> + <Tasks> + <DefaultTask Name="_default" ImagePath="@SHORT_NAME@.exe" ImageParams="" /> + </Tasks> + <Tokens> + <PrimaryToken TokenID="@SHORT_NAME@Token" TaskName="_default"> + <TemplateFlip> + <SmallImageURI IsRelative="true" IsResource="false">FlipCycleTileSmall.png</SmallImageURI> + <Count>0</Count> + <BackgroundImageURI IsRelative="true" IsResource="false">FlipCycleTileMedium.png</BackgroundImageURI> + <Title>@SHORT_NAME@</Title> + <BackContent></BackContent> + <BackBackgroundImageURI></BackBackgroundImageURI> + <BackTitle></BackTitle> + <DeviceLockImageURI></DeviceLockImageURI> + <HasLarge></HasLarge> + </TemplateFlip> + </PrimaryToken> + </Tokens> + <ScreenResolutions> + <ScreenResolution Name="ID_RESOLUTION_WVGA" /> + <ScreenResolution Name="ID_RESOLUTION_WXGA" /> + <ScreenResolution Name="ID_RESOLUTION_HD720P" /> + </ScreenResolutions> + </App> +</Deployment> diff --git a/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in new file mode 100644 index 0000000..495f18e --- /dev/null +++ b/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"> + <Identity Name="@PACKAGE_GUID@" Publisher="CN=mgong" Version="1.1.0.0" /> + <Properties> + <DisplayName>@SHORT_NAME@</DisplayName> + <PublisherDisplayName>mgong</PublisherDisplayName> + <Logo>StoreLogo.png</Logo> + </Properties> + <Prerequisites> + <OSMinVersion>6.3</OSMinVersion> + <OSMaxVersionTested>6.3</OSMaxVersionTested> + </Prerequisites> + <Resources> + <Resource Language="x-generate" /> + </Resources> + <Applications> + <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="@SHORT_NAME@.App"> + <m2:VisualElements + DisplayName="@SHORT_NAME@" + Description="@SHORT_NAME@" + BackgroundColor="#336699" + ForegroundText="light" + Square150x150Logo="Logo.png" + Square30x30Logo="SmallLogo.png"> + <m2:DefaultTile ShortName="@SHORT_NAME@"> + <m2:ShowNameOnTiles> + <m2:ShowOn Tile="square150x150Logo" /> + </m2:ShowNameOnTiles> + </m2:DefaultTile> + <m2:SplashScreen Image="SplashScreen.png" /> + </m2:VisualElements> + </Application> + </Applications> +</Package> diff --git a/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in new file mode 100644 index 0000000..2d4d389 --- /dev/null +++ b/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"> + <Identity Name="@PACKAGE_GUID@" Publisher="CN=mgong" Version="1.1.0.0" /> + <mp:PhoneIdentity PhoneProductId="@PACKAGE_GUID@" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> + + <Properties> + <DisplayName>@SHORT_NAME@</DisplayName> + <PublisherDisplayName>mgong</PublisherDisplayName> + <Logo>StoreLogo.png</Logo> + </Properties> + <Prerequisites> + <OSMinVersion>6.3.1</OSMinVersion> + <OSMaxVersionTested>6.3.1</OSMaxVersionTested> + </Prerequisites> + <Resources> + <Resource Language="x-generate" /> + </Resources> + <Applications> + <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="@SHORT_NAME@.App"> + <m2:VisualElements + DisplayName="@SHORT_NAME@" + Description="@SHORT_NAME@" + BackgroundColor="#336699" + ForegroundText="light" + Square150x150Logo="Logo.png" + Square30x30Logo="SmallLogo.png"> + <m2:DefaultTile ShortName="@SHORT_NAME@"> + <m2:ShowNameOnTiles> + <m2:ShowOn Tile="square150x150Logo" /> + </m2:ShowNameOnTiles> + </m2:DefaultTile> + <m2:SplashScreen Image="SplashScreen.png" /> + </m2:VisualElements> + </Application> + </Applications> +</Package> |