diff options
Diffstat (limited to 'Tests')
38 files changed, 149 insertions, 275 deletions
diff --git a/Tests/CMakeLib/testList.cxx b/Tests/CMakeLib/testList.cxx index 3e99ae8..8822806 100644 --- a/Tests/CMakeLib/testList.cxx +++ b/Tests/CMakeLib/testList.cxx @@ -858,7 +858,7 @@ bool testStaticModifiers() } { std::string list{ "a;b;c" }; - cmList::append(list, ""); + cmList::append(list, ""_s); if (list != "a;b;c;") { result = false; @@ -893,7 +893,7 @@ bool testStaticModifiers() } { std::string list{ "a;b;c" }; - cmList::prepend(list, "d;e"); + cmList::prepend(list, "d;e"_s); if (list != "d;e;a;b;c") { result = false; @@ -901,7 +901,7 @@ bool testStaticModifiers() } { std::string list; - cmList::prepend(list, "d;e"); + cmList::prepend(list, "d;e"_s); if (list != "d;e") { result = false; @@ -909,7 +909,7 @@ bool testStaticModifiers() } { std::string list{ "a;b;c" }; - cmList::prepend(list, ""); + cmList::prepend(list, ""_s); if (list != ";a;b;c") { result = false; diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index fc84bb0..aab084b 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -12,6 +12,8 @@ #include <cm3p/uv.h> +#include "cm_fileno.hxx" + #include "cmGetPipes.h" #include "cmStringAlgorithms.h" #include "cmUVHandlePtr.h" @@ -630,7 +632,8 @@ bool testUVProcessChainInputFile(const char* helperCommand) cmUVProcessChainBuilder builder; builder.AddCommand({ helperCommand, "dedup" }) - .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, fileno(f.get())) + .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, + cm_fileno(f.get())) .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); auto chain = builder.Start(); diff --git a/Tests/RunCMake/CXXModules/CMakeLists.txt b/Tests/RunCMake/CXXModules/CMakeLists.txt index 640d67b..ecc66b6 100644 --- a/Tests/RunCMake/CXXModules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.23) project(${RunCMake_TEST} NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index d324ec9..25670bd 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -148,6 +148,8 @@ if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(duplicate) set(RunCMake_CXXModules_NO_TEST 1) run_cxx_module_test(circular) + run_cxx_module_test(try-compile) + run_cxx_module_test(try-run) unset(RunCMake_CXXModules_NO_TEST) run_cxx_module_test(same-src-name) run_cxx_module_test(scan_properties) diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake index c17b5a4..6238d37 100644 --- a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake +++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake @@ -1,4 +1,4 @@ -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") if (NOT EXISTS "${CMake_TEST_MODULE_COMPILATION_RULES}") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt index a3e55f6..4d7a85b 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt index 0144b70..b96328f 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt index bd2f2d4..74f16a6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt index 87451fe..a4c9225 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index 5b6abc6..7f145ba2 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index 5b6abc6..7f145ba2 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt index 1dd9876..06160ce 100644 --- a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:12 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:16 \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt index 73f7ff7..9a8da3d 100644 --- a/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt @@ -3,10 +3,14 @@ project(cxx_modules_generated CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/importable.cxx.in" - "${CMAKE_CURRENT_BINARY_DIR}/importable.cxx" - COPYONLY) +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/importable.cxx" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/importable.cxx.in" + COMMAND "${CMAKE_COMMAND}" + -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/importable.cxx.in" + "${CMAKE_CURRENT_BINARY_DIR}/importable.cxx" + COMMENT "Copying 'importable.cxx'") add_executable(generated) target_sources(generated diff --git a/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt b/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt new file mode 100644 index 0000000..571bb9c --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt @@ -0,0 +1,4 @@ +CMake Warning \(dev\) at CMakeLists.txt:[0-9]* \(try_compile\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt new file mode 100644 index 0000000..dee61f1 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_try_compile CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") +try_compile(can_use_modules + SOURCES_TYPE CXX_MODULE + SOURCES + "${CMAKE_CURRENT_LIST_DIR}/importable.cxx" + SOURCES_TYPE NORMAL + SOURCE_FROM_FILE + use_importable.cxx "${CMAKE_CURRENT_LIST_DIR}/use_importable.cxx" + CXX_STANDARD 20) + +if (NOT can_use_modules) + message(FATAL_ERROR + "`try_compile` could not compile sources using modules.") +endif () diff --git a/Tests/RunCMake/CXXModules/examples/try-compile/importable.cxx b/Tests/RunCMake/CXXModules/examples/try-compile/importable.cxx new file mode 100644 index 0000000..607680a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-compile/importable.cxx @@ -0,0 +1,6 @@ +export module importable; + +export int from_import() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/try-compile/use_importable.cxx b/Tests/RunCMake/CXXModules/examples/try-compile/use_importable.cxx new file mode 100644 index 0000000..8d6bab2 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-compile/use_importable.cxx @@ -0,0 +1,6 @@ +import importable; + +int foo() +{ + return from_import(); +} diff --git a/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt b/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt new file mode 100644 index 0000000..508db55 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt @@ -0,0 +1,4 @@ +CMake Warning \(dev\) at CMakeLists.txt:[0-9]* \(try_run\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt new file mode 100644 index 0000000..fb03571 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_try_run CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +try_run(can_run_modules_result can_compile_modules + SOURCES_TYPE CXX_MODULE + SOURCES + "${CMAKE_CURRENT_LIST_DIR}/importable.cxx" + SOURCES_TYPE NORMAL + SOURCE_FROM_FILE + main.cxx "${CMAKE_CURRENT_LIST_DIR}/main.cxx" + CXX_STANDARD 20) + +if (NOT can_compile_modules) + message(FATAL_ERROR + "`try_run` could not compile sources using modules.") +endif () + +if (can_run_modules_result) + message(FATAL_ERROR + "`try_run` could not run sources using modules.") +endif () diff --git a/Tests/RunCMake/CXXModules/examples/try-run/importable.cxx b/Tests/RunCMake/CXXModules/examples/try-run/importable.cxx new file mode 100644 index 0000000..607680a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-run/importable.cxx @@ -0,0 +1,6 @@ +export module importable; + +export int from_import() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/try-run/main.cxx b/Tests/RunCMake/CXXModules/examples/try-run/main.cxx new file mode 100644 index 0000000..5c1bb42 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/try-run/main.cxx @@ -0,0 +1,6 @@ +import importable; + +int main(int argc, char* argv[]) +{ + return from_import() == 1; +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index b669543..8911e18 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -897,216 +897,6 @@ def gen_check_targets(c, g, inSource): # The json files have data for Xcode. Substitute data for VS. e["sources"] = [ { - "path": "^CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^alias/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^codemodel-v2\\.cmake$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^custom/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^cxx/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^framework/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^dir/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^dir/dir/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^fileset/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^imported/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^include_test\\.cmake$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^interface/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^object/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^subdir/CMakeLists\\.txt$", - "isGenerated": None, - "fileSetName": None, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", "isGenerated": True, "fileSetName": None, @@ -1124,25 +914,6 @@ def gen_check_targets(c, g, inSource): ] e["sourceGroups"] = [ { - "name": "", - "sourcePaths": [ - "^CMakeLists\\.txt$", - "^alias/CMakeLists\\.txt$", - "^codemodel-v2\\.cmake$", - "^custom/CMakeLists\\.txt$", - "^cxx/CMakeLists\\.txt$", - "^framework/CMakeLists\\.txt$", - "^dir/CMakeLists\\.txt$", - "^dir/dir/CMakeLists\\.txt$", - "^fileset/CMakeLists\\.txt$", - "^imported/CMakeLists\\.txt$", - "^include_test\\.cmake$", - "^interface/CMakeLists\\.txt$", - "^object/CMakeLists\\.txt$", - "^subdir/CMakeLists\\.txt$", - ], - }, - { "name": "CMake Rules", "sourcePaths": [ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", diff --git a/Tests/RunCMake/File_Generate/OutOfOrderArgs-result.txt b/Tests/RunCMake/File_Generate/OutOfOrderArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutOfOrderArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/OutOfOrderArgs-stderr.txt b/Tests/RunCMake/File_Generate/OutOfOrderArgs-stderr.txt new file mode 100644 index 0000000..a3f5cd5 --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutOfOrderArgs-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at OutOfOrderArgs\.cmake:[0-9]+ \(file\): + file Unknown argument to GENERATE subcommand\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/File_Generate/OutOfOrderArgs.cmake b/Tests/RunCMake/File_Generate/OutOfOrderArgs.cmake new file mode 100644 index 0000000..7f0578b --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutOfOrderArgs.cmake @@ -0,0 +1,4 @@ +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + CONDITION 1 + CONTENT "CONTENT argument" + ) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index 5a670ae..e601991 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -15,6 +15,7 @@ endif() run_cmake(EmptyCondition1) run_cmake(EmptyCondition2) run_cmake(BadCondition) +run_cmake(OutOfOrderArgs) run_cmake(DebugEvaluate) run_cmake(GenerateSource) run_cmake(InputAndContent) diff --git a/Tests/RunCMake/VS10Project/CMakeInputs-check.cmake b/Tests/RunCMake/VS10Project/CMakeInputs-check.cmake deleted file mode 100644 index a125574..0000000 --- a/Tests/RunCMake/VS10Project/CMakeInputs-check.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/ZERO_CHECK.vcxproj") -if(NOT EXISTS "${vcProjectFile}") - set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") - return() -endif() - -set(found_CMakeInputs 0) -file(STRINGS "${vcProjectFile}" lines) -foreach(line IN LISTS lines) - if(line MATCHES "<([A-Za-z0-9_]+) +Include=.*CMakeInputs.cmake") - set(rule "${CMAKE_MATCH_1}") - if(NOT rule STREQUAL "None") - set(RunCMake_TEST_FAILED "CMakeInputs.cmake referenced as ${rule} instead of None") - return() - endif() - if(found_CMakeInputs) - set(RunCMake_TEST_FAILED "CMakeInputs.cmake referenced multiple times") - return() - endif() - set(found_CMakeInputs 1) - endif() -endforeach() -if(NOT found_CMakeInputs) - set(RunCMake_TEST_FAILED "CMakeInputs.cmake not referenced") -endif() diff --git a/Tests/RunCMake/VS10Project/CMakeInputs.cmake b/Tests/RunCMake/VS10Project/CMakeInputs.cmake deleted file mode 100644 index e69de29..0000000 --- a/Tests/RunCMake/VS10Project/CMakeInputs.cmake +++ /dev/null diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index cb1a5d5..669049a 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -7,7 +7,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREA run_cmake(LanguageStandard) endif() -run_cmake(CMakeInputs) run_cmake(CustomCommandGenex) if(NOT RunCMake_GENERATOR MATCHES "^Visual Studio 1[1-5] ") run_cmake(CustomCommandParallel) diff --git a/Tests/RunCMake/add_custom_command/ConfigureFile.cmake b/Tests/RunCMake/add_custom_command/ConfigureFile.cmake new file mode 100644 index 0000000..ca53a6c --- /dev/null +++ b/Tests/RunCMake/add_custom_command/ConfigureFile.cmake @@ -0,0 +1,9 @@ +configure_file(ConfigureFile.in foo.txt @ONLY) +add_custom_target(foo) +add_custom_command( + OUTPUT bar.txt + MAIN_DEPENDENCY ConfigureFile.in # Attach to input of configure_file + DEPENDS foo + COMMAND ${CMAKE_COMMAND} -E copy foo.txt bar.txt + ) +add_custom_target(bar DEPENDS bar.txt) diff --git a/Tests/RunCMake/add_custom_command/ConfigureFile.in b/Tests/RunCMake/add_custom_command/ConfigureFile.in new file mode 100644 index 0000000..f89fc33 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/ConfigureFile.in @@ -0,0 +1 @@ +# ConfigureFile case diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake index 6c677c0..713b269 100644 --- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake @@ -7,6 +7,7 @@ run_cmake(BadArgument) run_cmake(BadByproduct) run_cmake(BadOutput) run_cmake(BadCommand) +run_cmake(ConfigureFile) run_cmake(GeneratedProperty) run_cmake(LiteralQuotes) run_cmake(NoArguments) diff --git a/Tests/RunCMake/set/CacheErrors-result.txt b/Tests/RunCMake/set/CacheErrors-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/set/CacheErrors-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/set/CacheErrors-stderr.txt b/Tests/RunCMake/set/CacheErrors-stderr.txt new file mode 100644 index 0000000..9983160 --- /dev/null +++ b/Tests/RunCMake/set/CacheErrors-stderr.txt @@ -0,0 +1,19 @@ +^CMake Error at CacheErrors\.cmake:1 \(set\): + set given invalid arguments for CACHE mode: missing type and docstring +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at CacheErrors\.cmake:2 \(set\): + set given invalid arguments for CACHE mode: missing type or docstring +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at CacheErrors\.cmake:3 \(set\): + set given invalid arguments for CACHE mode: missing type or docstring +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at CacheErrors\.cmake:4 \(set\): + set given invalid arguments: FORCE specified without CACHE +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/set/CacheErrors.cmake b/Tests/RunCMake/set/CacheErrors.cmake new file mode 100644 index 0000000..d177474 --- /dev/null +++ b/Tests/RunCMake/set/CacheErrors.cmake @@ -0,0 +1,4 @@ +set (var val CACHE) +set (var val CACHE STRING) +set (var val CACHE "") +set (var val CACH3 STRING "" FORCE) diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake index b3bd0a4..c785450 100644 --- a/Tests/RunCMake/set/RunCMakeTest.cmake +++ b/Tests/RunCMake/set/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(CacheErrors) run_cmake(ParentScope) run_cmake(ParentPulling) run_cmake(ParentPullingRecursive) diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake index 84e1802..0826686 100644 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET UNKNOWN) diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake index 78e782d..7935178 100644 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "a816ed09-43d1-40e5-bc8c-1a2824ee194e") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET a TYPE UNKNOWN) |