summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/CMakeLists.txt8
-rw-r--r--Tests/CMakeLib/testCTestBinPacker.cxx18
-rw-r--r--Tests/CMakeLib/testCTestResourceAllocator.cxx (renamed from Tests/CMakeLib/testCTestHardwareAllocator.cxx)66
-rw-r--r--Tests/CMakeLib/testCTestResourceGroups.cxx (renamed from Tests/CMakeLib/testCTestProcesses.cxx)11
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec.cxx (renamed from Tests/CMakeLib/testCTestHardwareSpec.cxx)16
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec1.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec1.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec10.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec10.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec11.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec11.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec12.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec12.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec13.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec13.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec14.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec14.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec15.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec15.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec16.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec16.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec17.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec17.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec18.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec18.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec2.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec2.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec3.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec3.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec4.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec4.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec5.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec5.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec6.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec6.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec7.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec7.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec8.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec8.json)0
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec9.json (renamed from Tests/CMakeLib/testCTestHardwareSpec_data/spec9.json)0
-rw-r--r--Tests/CMakeLib/testUTF8.cxx2
-rw-r--r--Tests/CMakeLists.txt8
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt6
-rw-r--r--Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt5
-rw-r--r--Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake9
-rw-r--r--Tests/EnforceConfig.cmake.in1
-rw-r--r--Tests/ExternalProject/CMakeLists.txt60
-rw-r--r--Tests/ExternalProject/gitrepo-sub-rec.tgzbin0 -> 9008 bytes
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt8
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in3
-rw-r--r--Tests/FindPostgreSQL/Test/main.c15
-rw-r--r--Tests/FindPython/CMakeLists.txt14
-rw-r--r--Tests/FindPython/CustomFailureMessage/CMakeLists.txt79
-rw-r--r--Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMakeLists.txt30
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake59
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py6
-rw-r--r--Tests/RunCMake/CTestCommandLine/test1-pass.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/test1-timeout.cmake14
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/HardwareCommon.cmake23
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake167
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/checkfree1-ctest-s-hw-check.cmake1
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/checkfree1.cmake7
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/checkfree2-ctest-s-hw-check.cmake1
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/checkfree2.cmake8
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake6
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/lotsoftests-ctest-s-hw-check.cmake1
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/lotsoftests.cmake16
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-check.cmake3
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/notenough1.cmake5
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-check.cmake3
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/notenough2.cmake5
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/process_count-ctest-s-hw-check.cmake1
-rw-r--r--Tests/RunCMake/CTestHardwareAllocation/process_count.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in (renamed from Tests/RunCMake/CTestHardwareAllocation/CMakeLists.txt.in)2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake23
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake167
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake7
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake8
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nolog-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good1.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good2.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good2.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-noproc-count-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badcount-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badres-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets1-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets2-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets3-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets4-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough.log)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets5-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets6-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets7-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nocount-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nores-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nowidgets-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good1-check.cmake)6
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake6
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx (renamed from Tests/RunCMake/CTestHardwareAllocation/cthwalloc.cxx)99
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake (renamed from Tests/RunCMake/CTestHardwareAllocation/ensure_parallel-ctest-s-hw-check.cmake)6
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake (renamed from Tests/RunCMake/CTestHardwareAllocation/ensure_parallel.cmake)8
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake16
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt (renamed from Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-result.txt)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/process_count.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/resspec.json (renamed from Tests/RunCMake/CTestHardwareAllocation/hwspec.json)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/test.cmake.in (renamed from Tests/RunCMake/CTestHardwareAllocation/test.cmake.in)8
-rw-r--r--Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt13
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake18
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake2
-rw-r--r--Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in1
-rw-r--r--Tests/RunCMake/Graphviz/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Graphviz/GraphvizTestProject.cmake58
-rw-r--r--Tests/RunCMake/Graphviz/RunCMakeTest.cmake82
-rw-r--r--Tests/RunCMake/Graphviz/default_options-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot52
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot44
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot46
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot35
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot43
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot44
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot48
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot44
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot42
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot48
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot50
-rw-r--r--Tests/RunCMake/Graphviz/no_dependers_files-check.cmake4
-rw-r--r--Tests/RunCMake/Graphviz/no_executables-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_external_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_interface_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_module_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_object_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_per_target_files-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_shared_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_static_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/set_graph_header-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/set_graph_name-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/set_node_prefix-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/test_project/core_library.c3
-rw-r--r--Tests/RunCMake/Graphviz/test_project/graphic_library.c3
-rw-r--r--Tests/RunCMake/Graphviz/test_project/main.c4
-rw-r--r--Tests/RunCMake/Graphviz/test_project/module.c3
-rw-r--r--Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake15
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake69
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/none.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake6
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/test.c3
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt10
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt10
-rw-r--r--Tests/RunCMake/RunCMake.cmake29
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake6
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_skip.cmake5
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake33
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake26
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake8
-rw-r--r--Tests/RunCMake/VS10Project/VsGlobals-check.cmake93
-rw-r--r--Tests/RunCMake/VS10Project/VsGlobals.cmake7
-rw-r--r--Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake32
-rw-r--r--Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake20
-rw-r--r--Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake0
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/foreach/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/foreach/foreach-all-test-stdout.txt44
-rw-r--r--Tests/RunCMake/foreach/foreach-all-test.cmake67
-rw-r--r--Tests/RunCMake/message/RunCMakeTest.cmake34
-rw-r--r--Tests/RunCMake/message/message-checks-stderr.txt3
-rw-r--r--Tests/RunCMake/message/message-checks-stdout.txt10
-rw-r--r--Tests/RunCMake/message/message-checks.cmake13
-rw-r--r--Tests/RunCMake/message/message-context-cache-stdout.txt8
-rw-r--r--Tests/RunCMake/message/message-context-cli-stdout.txt8
-rw-r--r--Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt5
-rw-r--r--Tests/RunCMake/message/message-context.cmake27
-rw-r--r--Tests/RunCMake/message/message-log-level-debug-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-default-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-override-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-override-stdout.txt3
-rw-r--r--Tests/RunCMake/message/message-log-level-status-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-trace-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-verbose-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-debug-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-default-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-status-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-trace-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-verbose-stdout.txt2
-rw-r--r--Tests/RunCMake/message/warnmessage-rootdir-stderr.txt1
-rw-r--r--Tests/RunCMake/message/warnmessage-rootdir.cmake5
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard.cmake7
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard.cmake7
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/try_compile/src.m4
-rw-r--r--Tests/RunCMake/try_compile/src.mm4
-rw-r--r--Tests/TryCompile/CMakeLists.txt19
-rw-r--r--Tests/TryCompile/fail.m1
-rw-r--r--Tests/TryCompile/pass.m4
271 files changed, 2504 insertions, 486 deletions
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index bc2079fd56..840afc1682 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -8,9 +8,9 @@ include_directories(
set(CMakeLib_TESTS
testArgumentParser.cxx
testCTestBinPacker.cxx
- testCTestProcesses.cxx
- testCTestHardwareAllocator.cxx
- testCTestHardwareSpec.cxx
+ testCTestResourceAllocator.cxx
+ testCTestResourceSpec.cxx
+ testCTestResourceGroups.cxx
testGeneratedFileStream.cxx
testRST.cxx
testRange.cxx
@@ -32,7 +32,7 @@ add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
set(testUVProcessChain_ARGS $<TARGET_FILE:testUVProcessChainHelper>)
set(testUVStreambuf_ARGS $<TARGET_FILE:cmake>)
-set(testCTestHardwareSpec_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
+set(testCTestResourceSpec_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
if(WIN32)
list(APPEND CMakeLib_TESTS
diff --git a/Tests/CMakeLib/testCTestBinPacker.cxx b/Tests/CMakeLib/testCTestBinPacker.cxx
index 62ea55bb8a..6f09af20ef 100644
--- a/Tests/CMakeLib/testCTestBinPacker.cxx
+++ b/Tests/CMakeLib/testCTestBinPacker.cxx
@@ -5,12 +5,12 @@
#include <vector>
#include "cmCTestBinPacker.h"
-#include "cmCTestHardwareAllocator.h"
+#include "cmCTestResourceAllocator.h"
struct ExpectedPackResult
{
std::vector<int> SlotsNeeded;
- std::map<std::string, cmCTestHardwareAllocator::Resource> Hardware;
+ std::map<std::string, cmCTestResourceAllocator::Resource> Resources;
bool ExpectedReturnValue;
std::vector<cmCTestBinPackerAllocation> ExpectedRoundRobinAllocations;
std::vector<cmCTestBinPackerAllocation> ExpectedBlockAllocations;
@@ -233,18 +233,18 @@ bool TestExpectedPackResult(const ExpectedPackResult& expected)
roundRobinAllocations.push_back({ index++, n, "" });
}
- bool roundRobinResult = cmAllocateCTestHardwareRoundRobin(
- expected.Hardware, roundRobinAllocations);
+ bool roundRobinResult = cmAllocateCTestResourcesRoundRobin(
+ expected.Resources, roundRobinAllocations);
if (roundRobinResult != expected.ExpectedReturnValue) {
std::cout
- << "cmAllocateCTestHardwareRoundRobin did not return expected value"
+ << "cmAllocateCTestResourcesRoundRobin did not return expected value"
<< std::endl;
return false;
}
if (roundRobinResult &&
roundRobinAllocations != expected.ExpectedRoundRobinAllocations) {
- std::cout << "cmAllocateCTestHardwareRoundRobin did not return expected "
+ std::cout << "cmAllocateCTestResourcesRoundRobin did not return expected "
"allocations"
<< std::endl;
return false;
@@ -258,15 +258,15 @@ bool TestExpectedPackResult(const ExpectedPackResult& expected)
}
bool blockResult =
- cmAllocateCTestHardwareBlock(expected.Hardware, blockAllocations);
+ cmAllocateCTestResourcesBlock(expected.Resources, blockAllocations);
if (blockResult != expected.ExpectedReturnValue) {
- std::cout << "cmAllocateCTestHardwareBlock did not return expected value"
+ std::cout << "cmAllocateCTestResourcesBlock did not return expected value"
<< std::endl;
return false;
}
if (blockResult && blockAllocations != expected.ExpectedBlockAllocations) {
- std::cout << "cmAllocateCTestHardwareBlock did not return expected"
+ std::cout << "cmAllocateCTestResourcesBlock did not return expected"
" allocations"
<< std::endl;
return false;
diff --git a/Tests/CMakeLib/testCTestHardwareAllocator.cxx b/Tests/CMakeLib/testCTestResourceAllocator.cxx
index 6f05d0349a..33d6b913df 100644
--- a/Tests/CMakeLib/testCTestHardwareAllocator.cxx
+++ b/Tests/CMakeLib/testCTestResourceAllocator.cxx
@@ -3,24 +3,24 @@
#include <string>
#include <vector>
-#include "cmCTestHardwareAllocator.h"
-#include "cmCTestHardwareSpec.h"
+#include "cmCTestResourceAllocator.h"
+#include "cmCTestResourceSpec.h"
-static const cmCTestHardwareSpec spec{ { {
+static const cmCTestResourceSpec spec{ { {
/* clang-format off */
{ "gpus", { { "0", 4 }, { "1", 8 }, { "2", 0 }, { "3", 8 } } },
/* clang-format on */
} } };
-bool testInitializeFromHardwareSpec()
+bool testInitializeFromResourceSpec()
{
bool retval = true;
- cmCTestHardwareAllocator allocator;
- allocator.InitializeFromHardwareSpec(spec);
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected{
/* clang-format off */
{ "gpus", {
@@ -43,11 +43,11 @@ bool testAllocateResource()
{
bool retval = true;
- cmCTestHardwareAllocator allocator;
- allocator.InitializeFromHardwareSpec(spec);
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected1{
/* clang-format off */
{ "gpus", {
@@ -70,7 +70,7 @@ bool testAllocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected2{
/* clang-format off */
{ "gpus", {
@@ -93,7 +93,7 @@ bool testAllocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected3{
/* clang-format off */
{ "gpus", {
@@ -116,7 +116,7 @@ bool testAllocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected4{
/* clang-format off */
{ "gpus", {
@@ -145,7 +145,7 @@ bool testAllocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected5{
/* clang-format off */
{ "gpus", {
@@ -168,7 +168,7 @@ bool testAllocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected6{
/* clang-format off */
{ "gpus", {
@@ -191,7 +191,7 @@ bool testAllocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected7{
/* clang-format off */
{ "gpus", {
@@ -220,11 +220,11 @@ bool testDeallocateResource()
{
bool retval = true;
- cmCTestHardwareAllocator allocator;
- allocator.InitializeFromHardwareSpec(spec);
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected1{
/* clang-format off */
{ "gpus", {
@@ -253,7 +253,7 @@ bool testDeallocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected2{
/* clang-format off */
{ "gpus", {
@@ -276,7 +276,7 @@ bool testDeallocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected3{
/* clang-format off */
{ "gpus", {
@@ -299,7 +299,7 @@ bool testDeallocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected4{
/* clang-format off */
{ "gpus", {
@@ -322,7 +322,7 @@ bool testDeallocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected5{
/* clang-format off */
{ "gpus", {
@@ -345,7 +345,7 @@ bool testDeallocateResource()
}
static const std::map<
- std::string, std::map<std::string, cmCTestHardwareAllocator::Resource>>
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
expected6{
/* clang-format off */
{ "gpus", {
@@ -374,23 +374,23 @@ bool testResourceFree()
{
bool retval = true;
- const cmCTestHardwareAllocator::Resource r1{ 5, 0 };
+ const cmCTestResourceAllocator::Resource r1{ 5, 0 };
if (r1.Free() != 5) {
- std::cout << "cmCTestHardwareAllocator::Resource::Free() did not return "
+ std::cout << "cmCTestResourceAllocator::Resource::Free() did not return "
"expected value for { 5, 0 }\n";
retval = false;
}
- const cmCTestHardwareAllocator::Resource r2{ 3, 2 };
+ const cmCTestResourceAllocator::Resource r2{ 3, 2 };
if (r2.Free() != 1) {
- std::cout << "cmCTestHardwareAllocator::Resource::Free() did not return "
+ std::cout << "cmCTestResourceAllocator::Resource::Free() did not return "
"expected value for { 3, 2 }\n";
retval = false;
}
- const cmCTestHardwareAllocator::Resource r3{ 4, 4 };
+ const cmCTestResourceAllocator::Resource r3{ 4, 4 };
if (r3.Free() != 0) {
- std::cout << "cmCTestHardwareAllocator::Resource::Free() did not return "
+ std::cout << "cmCTestResourceAllocator::Resource::Free() did not return "
"expected value for { 4, 4 }\n";
retval = false;
}
@@ -398,12 +398,12 @@ bool testResourceFree()
return retval;
}
-int testCTestHardwareAllocator(int, char** const)
+int testCTestResourceAllocator(int, char** const)
{
int retval = 0;
- if (!testInitializeFromHardwareSpec()) {
- std::cout << "in testInitializeFromHardwareSpec()\n";
+ if (!testInitializeFromResourceSpec()) {
+ std::cout << "in testInitializeFromResourceSpec()\n";
retval = -1;
}
diff --git a/Tests/CMakeLib/testCTestProcesses.cxx b/Tests/CMakeLib/testCTestResourceGroups.cxx
index acf4f67bfc..5fd7d4ad86 100644
--- a/Tests/CMakeLib/testCTestProcesses.cxx
+++ b/Tests/CMakeLib/testCTestResourceGroups.cxx
@@ -106,24 +106,25 @@ bool TestExpectedParseResult(const ExpectedParseResult& expected)
std::vector<std::vector<cmCTestTestHandler::cmCTestTestResourceRequirement>>
result;
bool retval;
- if ((retval = cmCTestTestHandler::ParseProcessesProperty(
+ if ((retval = cmCTestTestHandler::ParseResourceGroupsProperty(
expected.String, result)) != expected.ExpectedReturnValue) {
- std::cout << "ParseProcessesProperty(\"" << expected.String
+ std::cout << "ParseResourceGroupsProperty(\"" << expected.String
<< "\") returned " << retval << ", should be "
<< expected.ExpectedReturnValue << std::endl;
return false;
}
if (result != expected.ExpectedValue) {
- std::cout << "ParseProcessesProperty(\"" << expected.String
- << "\") did not yield expected set of processes" << std::endl;
+ std::cout << "ParseResourceGroupsProperty(\"" << expected.String
+ << "\") did not yield expected set of resource groups"
+ << std::endl;
return false;
}
return true;
}
-int testCTestProcesses(int /*unused*/, char* /*unused*/ [])
+int testCTestResourceGroups(int /*unused*/, char* /*unused*/ [])
{
int retval = 0;
diff --git a/Tests/CMakeLib/testCTestHardwareSpec.cxx b/Tests/CMakeLib/testCTestResourceSpec.cxx
index 3e3eccc354..e4bc770645 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec.cxx
+++ b/Tests/CMakeLib/testCTestResourceSpec.cxx
@@ -2,16 +2,16 @@
#include <string>
#include <vector>
-#include "cmCTestHardwareSpec.h"
+#include "cmCTestResourceSpec.h"
struct ExpectedSpec
{
std::string Path;
bool ParseResult;
- cmCTestHardwareSpec Expected;
+ cmCTestResourceSpec Expected;
};
-static const std::vector<ExpectedSpec> expectedHardwareSpecs = {
+static const std::vector<ExpectedSpec> expectedResourceSpecs = {
/* clang-format off */
{"spec1.json", true, {{{
{"gpus", {
@@ -44,9 +44,9 @@ static const std::vector<ExpectedSpec> expectedHardwareSpecs = {
};
static bool testSpec(const std::string& path, bool expectedResult,
- const cmCTestHardwareSpec& expected)
+ const cmCTestResourceSpec& expected)
{
- cmCTestHardwareSpec actual;
+ cmCTestResourceSpec actual;
bool result = actual.ReadFromJSONFile(path);
if (result != expectedResult) {
std::cout << "ReadFromJSONFile(\"" << path << "\") returned " << result
@@ -63,7 +63,7 @@ static bool testSpec(const std::string& path, bool expectedResult,
return true;
}
-int testCTestHardwareSpec(int argc, char** const argv)
+int testCTestResourceSpec(int argc, char** const argv)
{
if (argc < 2) {
std::cout << "Invalid arguments.\n";
@@ -71,9 +71,9 @@ int testCTestHardwareSpec(int argc, char** const argv)
}
int retval = 0;
- for (auto const& spec : expectedHardwareSpecs) {
+ for (auto const& spec : expectedResourceSpecs) {
std::string path = argv[1];
- path += "/testCTestHardwareSpec_data/";
+ path += "/testCTestResourceSpec_data/";
path += spec.Path;
if (!testSpec(path, spec.ParseResult, spec.Expected)) {
retval = -1;
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec1.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec1.json
index ee3d0cea52..ee3d0cea52 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec1.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec1.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec10.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec10.json
index 22105d7618..22105d7618 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec10.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec10.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec11.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec11.json
index 1e37ef5536..1e37ef5536 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec11.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec11.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec12.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec12.json
index fe51488c70..fe51488c70 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec12.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec12.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec13.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec13.json
index 6b7a9f4e0c..6b7a9f4e0c 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec13.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec13.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec14.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec14.json
index ce708c77d2..ce708c77d2 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec14.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec14.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec15.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec15.json
index 78b6990c24..78b6990c24 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec15.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec15.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec16.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec16.json
index 95c7d2605d..95c7d2605d 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec16.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec16.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec17.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec17.json
index 1b6ab4b4b1..1b6ab4b4b1 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec17.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec17.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec18.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec18.json
index 1a17df7f8b..1a17df7f8b 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec18.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec18.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec2.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec2.json
index 6175b1a99d..6175b1a99d 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec2.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec2.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec3.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec3.json
index 82453ec12d..82453ec12d 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec3.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec3.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec4.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec4.json
index 05e73d7992..05e73d7992 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec4.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec4.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec5.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec5.json
index 2c63c08510..2c63c08510 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec5.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec5.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec6.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec6.json
index 93c790dcd7..93c790dcd7 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec6.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec6.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec7.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec7.json
index 28b6a4f2f7..28b6a4f2f7 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec7.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec7.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec8.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec8.json
index 79bd224269..79bd224269 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec8.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec8.json
diff --git a/Tests/CMakeLib/testCTestHardwareSpec_data/spec9.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec9.json
index 6bb1defabf..6bb1defabf 100644
--- a/Tests/CMakeLib/testCTestHardwareSpec_data/spec9.json
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec9.json
diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx
index 986f5956ef..1bf88cf4cd 100644
--- a/Tests/CMakeLib/testUTF8.cxx
+++ b/Tests/CMakeLib/testUTF8.cxx
@@ -9,9 +9,11 @@ typedef char test_utf8_char[5];
static void test_utf8_char_print(test_utf8_char const c)
{
unsigned char const* d = reinterpret_cast<unsigned char const*>(c);
+#ifndef __clang_analyzer__ // somehow thinks arguments are not initialized
printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast<int>(d[0]),
static_cast<int>(d[1]), static_cast<int>(d[2]),
static_cast<int>(d[3]));
+#endif
}
static void byte_array_print(char const* s)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b29638bafe..185401fc43 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -451,8 +451,12 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
ADD_TEST_MACRO(ImportedSameName ImportedSameName)
ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
- if(NOT _isMultiConfig)
- set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ if(_isMultiConfig)
+ set(ConfigSources_CTEST_OPTIONS --build-config $<CONFIGURATION>)
+ else()
+ set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ endif()
ADD_TEST_MACRO(ConfigSources ConfigSources)
endif()
ADD_TEST_MACRO(SourcesProperty SourcesProperty)
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 03babd263a..85b96942ab 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -75,6 +75,12 @@ add_test(CMakeOnly.ProjectIncludeAny ${CMAKE_CMAKE_COMMAND}
add_test(CMakeOnly.ProjectIncludeBefore ${CMAKE_CMAKE_COMMAND}
-DTEST=ProjectIncludeBefore
+ -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake
+ -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
+ )
+
+add_test(CMakeOnly.ProjectIncludeBeforeAny ${CMAKE_CMAKE_COMMAND}
+ -DTEST=ProjectIncludeBeforeAny
-DCMAKE_ARGS=-DCMAKE_PROJECT_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake
-P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
)
diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt
new file mode 100644
index 0000000000..5cd9cba2c0
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(FOO TRUE)
+project(ProjectInclude LANGUAGES NONE)
+if(NOT AUTO_INCLUDE)
+ message(FATAL_ERROR "include file not found")
+endif()
diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake
new file mode 100644
index 0000000000..0a4799df35
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake
@@ -0,0 +1,9 @@
+if(NOT FOO)
+ message(FATAL_ERROR "FOO is not set")
+endif()
+
+if(NOT "${PROJECT_NAME}" STREQUAL "")
+ message(FATAL_ERROR "PROJECT_NAME should be empty")
+endif()
+
+set(AUTO_INCLUDE TRUE)
diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in
index b7587aa47d..7781ded84a 100644
--- a/Tests/EnforceConfig.cmake.in
+++ b/Tests/EnforceConfig.cmake.in
@@ -33,5 +33,6 @@ unset(ENV{CMAKE_GENERATOR})
unset(ENV{CMAKE_GENERATOR_INSTANCE})
unset(ENV{CMAKE_GENERATOR_PLATFORM})
unset(ENV{CMAKE_GENERATOR_TOOLSET})
+unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
@TEST_HOME_ENV_CODE@
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 093391e3fb..ef81169ff4 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -482,6 +482,66 @@ if(do_git_tests)
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+ # Unzip/untar the git repository in our source folder so that other
+ # projects below may use it to test git args of ExternalProject_Add
+ #
+ set(proj SetupLocalGITRepositoryWithRecursiveSubmodules)
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT-with-recursive-submodules
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo-sub-rec.tgz
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
+ INSTALL_COMMAND ""
+ )
+ set_property(TARGET ${proj}
+ PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
+
+ set(local_git_repo "../../LocalRepositories/GIT-with-recursive-submodules")
+
+ set(proj TS1-GIT-RECURSIVE_SUBMODULES-default)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_RECURSIVE:BOOL=ON
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ "SetupLocalGITRepositoryWithRecursiveSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
+ set(proj TS1-GIT-RECURSIVE_SUBMODULES-exclusive)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_SUBMODULES_RECURSE TRUE
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_RECURSIVE:BOOL=ON
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ "SetupLocalGITRepositoryWithRecursiveSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
+ set(proj TS1-GIT-RECURSIVE_SUBMODULES-off)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_SUBMODULES_RECURSE FALSE
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_RECURSIVE:BOOL=OFF
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ "SetupLocalGITRepositoryWithRecursiveSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
endif()
set(do_hg_tests 0)
diff --git a/Tests/ExternalProject/gitrepo-sub-rec.tgz b/Tests/ExternalProject/gitrepo-sub-rec.tgz
new file mode 100644
index 0000000000..b0f3f18b74
--- /dev/null
+++ b/Tests/ExternalProject/gitrepo-sub-rec.tgz
Binary files differ
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 23832dacee..8a87a8c97d 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -19,6 +19,14 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile" AND
# configure a FindFoo.cmake so it knows where the library can be found
configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
+ # Need the -isysroot flag on recentish macOS after command line tools
+ # no longer provide headers in /usr/include
+ if(APPLE AND CMAKE_OSX_SYSROOT)
+ set(__EXTRA_OSX_SYSROOT_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+ else()
+ set(__EXTRA_OSX_SYSROOT_FLAGS "")
+ endif()
+
# now set up the test:
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index 8e7ff72aa2..5ef67d031c 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -5,6 +5,7 @@ CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"
CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"
CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@
+__EXTRA_OSX_SYSROOT_FLAGS = @__EXTRA_OSX_SYSROOT_FLAGS@
CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
@@ -15,7 +16,7 @@ all: pngtest
main.o: clean main.cpp
@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(__EXTRA_OSX_SYSROOT_FLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c
index 2cfeed0da2..a63377a256 100644
--- a/Tests/FindPostgreSQL/Test/main.c
+++ b/Tests/FindPostgreSQL/Test/main.c
@@ -5,10 +5,19 @@
int main()
{
int version = PQlibVersion();
- int major = version / 10000;
- int minor = version % 10000;
char version_string[100];
- snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+ // 9.x and older encoding.
+ if (version < 100000) {
+ int major = version / 10000;
+ int minor = version % 10000 / 100;
+ int patch = version % 100;
+ snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor,
+ patch);
+ } else {
+ int major = version / 10000;
+ int minor = version % 10000;
+ snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+ }
printf("Found PostgreSQL version %s, expected version %s\n", version_string,
CMAKE_EXPECTED_POSTGRESQL_VERSION);
return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION);
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 868cfe0e13..10c98c5360 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -134,6 +134,20 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.CustomFailureMessage COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
endif()
if(CMake_TEST_FindPython_NumPy)
diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
new file mode 100644
index 0000000000..a0d8eb2f44
--- /dev/null
+++ b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
@@ -0,0 +1,79 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestCustomFailureMessage LANGUAGES NONE)
+
+include(CTest)
+
+add_test(NAME FindPython.CustomFailureMessage.Interpreter COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Interpreter"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Interpreter"
+ "-DPython3_EXECUTABLE=/not/found/interpreter"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Interpreter PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter")
+
+add_test(NAME FindPython.CustomFailureMessage.Library COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Library"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Development"
+ "-DPython3_LIBRARY=/not/found/library"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Library PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the library")
+
+add_test(NAME FindPython.CustomFailureMessage.Include COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Include"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Development"
+ "-DPython3_INCLUDE_DIR=/not/found/include"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Include PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the directory")
+
+add_test(NAME FindPython.CustomFailureMessage.Multiple COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Multiple"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Interpreter;Development"
+ "-DPython3_EXECUTABLE=/not/found/interpreter"
+ "-DPython3_LIBRARY=/not/found/library"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library")
+
+
+if (CMake_TEST_FindPython_NumPy)
+ add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/NumPy"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Interpreter;Development;NumPy"
+ "-DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindPython.CustomFailureMessage.NumPy PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+NumPy: Cannot find the directory")
+endif()
diff --git a/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
new file mode 100644
index 0000000000..fed963e476
--- /dev/null
+++ b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestCustomFailureMessage.Check LANGUAGES C)
+
+find_package (Python3 REQUIRED COMPONENTS ${CHECK_COMPONENTS})
diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt
new file mode 100644
index 0000000000..a736129fe6
--- /dev/null
+++ b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0068-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0068 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt
new file mode 100644
index 0000000000..f51a6f4350
--- /dev/null
+++ b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0069-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0069 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0925c0e5a0..13712950bd 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -189,6 +189,7 @@ add_RunCMake_test(GeneratorToolset)
add_RunCMake_test(GetPrerequisites)
add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test
+add_RunCMake_test(Graphviz)
add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(LinkStatic)
@@ -289,6 +290,9 @@ add_RunCMake_test(set_property)
add_RunCMake_test(string)
add_RunCMake_test(test_include_dirs)
add_RunCMake_test(BundleUtilities)
+if(APPLE)
+ add_RunCMake_test(INSTALL_NAME_DIR)
+endif()
function(add_RunCMake_test_try_compile)
if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
@@ -313,6 +317,8 @@ function(add_RunCMake_test_try_compile)
CMAKE_CXX_COMPILER_VERSION
CMAKE_CXX_STANDARD_DEFAULT
CMake_TEST_CUDA
+ CMAKE_OBJC_STANDARD_DEFAULT
+ CMAKE_OBJCXX_STANDARD_DEFAULT
)
if(DEFINED ${var})
list(APPEND try_compile_ARGS -D${var}=${${var}})
@@ -335,7 +341,7 @@ add_RunCMake_test(no_install_prefix)
add_RunCMake_test(configure_file)
add_RunCMake_test(CTestTimeoutAfterMatch)
-# cthwalloc links against CMakeLib and CTestLib, which means it can't be built
+# ctresalloc links against CMakeLib and CTestLib, which means it can't be built
# if CMake_TEST_EXTERNAL_CMAKE is activated (the compiler might be different.)
# So, it has to be provided in the original build tree.
if(CMake_TEST_EXTERNAL_CMAKE)
@@ -343,7 +349,7 @@ if(CMake_TEST_EXTERNAL_CMAKE)
if(NOT CMAKE_VERSION VERSION_LESS 3.12)
set(no_package_root_path NO_PACKAGE_ROOT_PATH)
endif()
- find_program(cthwalloc cthwalloc PATHS ${CMake_TEST_EXTERNAL_CMAKE}
+ find_program(ctresalloc ctresalloc PATHS ${CMake_TEST_EXTERNAL_CMAKE}
NO_DEFAULT_PATH
${no_package_root_path}
NO_CMAKE_PATH
@@ -352,25 +358,25 @@ if(CMake_TEST_EXTERNAL_CMAKE)
NO_CMAKE_SYSTEM_PATH
NO_CMAKE_FIND_ROOT_PATH
)
- if(cthwalloc)
- add_executable(cthwalloc IMPORTED)
- set_property(TARGET cthwalloc PROPERTY IMPORTED_LOCATION ${cthwalloc})
+ if(ctresalloc)
+ add_executable(ctresalloc IMPORTED)
+ set_property(TARGET ctresalloc PROPERTY IMPORTED_LOCATION ${ctresalloc})
endif()
else()
- add_executable(cthwalloc CTestHardwareAllocation/cthwalloc.cxx)
- target_link_libraries(cthwalloc CTestLib)
- target_include_directories(cthwalloc PRIVATE
+ add_executable(ctresalloc CTestResourceAllocation/ctresalloc.cxx)
+ target_link_libraries(ctresalloc CTestLib)
+ target_include_directories(ctresalloc PRIVATE
${CMake_BINARY_DIR}/Source
${CMake_SOURCE_DIR}/Source
${CMake_SOURCE_DIR}/Source/CTest
)
- set_property(TARGET cthwalloc PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMake_BIN_DIR})
+ set_property(TARGET ctresalloc PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMake_BIN_DIR})
endif()
-if(TARGET cthwalloc)
- add_RunCMake_test(CTestHardwareAllocation -DCTHWALLOC_COMMAND=$<TARGET_FILE:cthwalloc>)
+if(TARGET ctresalloc)
+ add_RunCMake_test(CTestResourceAllocation -DCTRESALLOC_COMMAND=$<TARGET_FILE:ctresalloc>)
else()
- message(WARNING "Could not find or build cthwalloc")
+ message(WARNING "Could not find or build ctresalloc")
endif()
find_package(Qt4 QUIET)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index fd2c97fef0..6a7fd3b55c 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -4,6 +4,16 @@ set(RunCMake_TEST_TIMEOUT 60)
unset(ENV{CTEST_PARALLEL_LEVEL})
unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+run_cmake_command(repeat-until-pass-bad1
+ ${CMAKE_CTEST_COMMAND} --repeat-until-pass
+ )
+run_cmake_command(repeat-until-pass-bad2
+ ${CMAKE_CTEST_COMMAND} --repeat-until-pass foo
+ )
+run_cmake_command(repeat-until-pass-good
+ ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2
+ )
+
run_cmake_command(repeat-until-fail-bad1
${CMAKE_CTEST_COMMAND} --repeat-until-fail
)
@@ -14,14 +24,53 @@ run_cmake_command(repeat-until-fail-good
${CMAKE_CTEST_COMMAND} --repeat-until-fail 2
)
-function(run_repeat_until_fail_tests)
+run_cmake_command(repeat-after-timeout-bad1
+ ${CMAKE_CTEST_COMMAND} --repeat-after-timeout
+ )
+run_cmake_command(repeat-after-timeout-bad2
+ ${CMAKE_CTEST_COMMAND} --repeat-after-timeout foo
+ )
+run_cmake_command(repeat-after-timeout-good
+ ${CMAKE_CTEST_COMMAND} --repeat-after-timeout 2
+ )
+
+run_cmake_command(repeat-until-pass-and-fail
+ ${CMAKE_CTEST_COMMAND} --repeat-until-pass 2 --repeat-until-fail 2
+ )
+run_cmake_command(repeat-until-fail-and-pass
+ ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-until-pass 2
+ )
+run_cmake_command(repeat-until-fail-and-timeout
+ ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat-after-timeout 2
+ )
+
+function(run_repeat_until_pass_tests)
# Use a single build tree for a few tests without cleaning.
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-pass-build)
+ run_cmake(repeat-until-pass-cmake)
set(RunCMake_TEST_NO_CLEAN 1)
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake_command(repeat-until-pass-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-pass 3
+ )
+endfunction()
+run_repeat_until_pass_tests()
+function(run_repeat_after_timeout_tests)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-after-timeout-build)
+ run_cmake(repeat-after-timeout-cmake)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(repeat-after-timeout-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug --repeat-after-timeout 3
+ )
+endfunction()
+run_repeat_after_timeout_tests()
+
+function(run_repeat_until_fail_tests)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
run_cmake(repeat-until-fail-cmake)
+ set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(repeat-until-fail-ctest
${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-fail 3
)
@@ -258,7 +307,7 @@ function(run_ShowOnly)
add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
set_tests_properties(ShowOnly PROPERTIES
WILL_FAIL true
- PROCESSES \"2,threads:2,gpus:4;gpus:2,threads:4\"
+ RESOURCE_GROUPS \"2,threads:2,gpus:4;gpus:2,threads:4\"
REQUIRED_FILES RequiredFileDoesNotExist
_BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\"
)
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt
new file mode 100644
index 0000000000..aea92b8bb0
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad1-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat-after-timeout' requires an argument$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt
new file mode 100644
index 0000000000..c5db55b65b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-bad2-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat-after-timeout' given non-integer value 'foo'$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
new file mode 100644
index 0000000000..873c0bd6fb
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
@@ -0,0 +1,15 @@
+enable_testing()
+
+set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
+add_test(NAME initialization
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
+add_test(NAME test1
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-timeout.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 5)
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt
new file mode 100644
index 0000000000..d0a54872a9
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt
@@ -0,0 +1,15 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-build
+ Start 1: initialization
+1/4 Test #1: initialization ................... Passed +[0-9.]+ sec
+ Start 2: test1
+2/4 Test #2: test1 ............................\*\*\*Timeout +[0-9.]+ sec
+ Start 2: test1
+ Test #2: test1 ............................ Passed +[0-9.]+ sec
+ Start 3: hello
+3/4 Test #3: hello ............................ Passed +[0-9.]+ sec
+ Start 4: goodbye
+4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 4
+
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt
new file mode 100644
index 0000000000..a7c4b11f76
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-good-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt
new file mode 100644
index 0000000000..15ee3a98ea
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-pass-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat-\*' option may be used\.$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt
new file mode 100644
index 0000000000..15ee3a98ea
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-and-timeout-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat-\*' option may be used\.$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt
new file mode 100644
index 0000000000..15ee3a98ea
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-and-fail-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat-\*' option may be used\.$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt
new file mode 100644
index 0000000000..c6afb1d9cf
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad1-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat-until-pass' requires an argument$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt
new file mode 100644
index 0000000000..cc3aed5330
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-bad2-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat-until-pass' given non-integer value 'foo'$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake
new file mode 100644
index 0000000000..d1095518f3
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake
@@ -0,0 +1,15 @@
+enable_testing()
+
+set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
+add_test(NAME initialization
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
+add_test(NAME test1
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-pass.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization")
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt
new file mode 100644
index 0000000000..3745dc252b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt
@@ -0,0 +1,15 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-until-pass-build
+ Start 1: initialization
+1/4 Test #1: initialization ................... Passed +[0-9.]+ sec
+ Start 2: test1
+2/4 Test #2: test1 ............................\*\*\*Failed +[0-9.]+ sec
+ Start 2: test1
+ Test #2: test1 ............................ Passed +[0-9.]+ sec
+ Start 3: hello
+3/4 Test #3: hello ............................ Passed +[0-9.]+ sec
+ Start 4: goodbye
+4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 4
+
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt
new file mode 100644
index 0000000000..a7c4b11f76
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-good-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
index 6eb8624b60..b81865008c 100644
--- a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
+++ b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
@@ -80,12 +80,12 @@ def check_willfail_property(p):
assert p["name"] == "WILL_FAIL"
assert p["value"] == True
-def check_processes_property(p):
+def check_resource_groups_property(p):
assert is_dict(p)
assert sorted(p.keys()) == ["name", "value"]
assert is_string(p["name"])
assert is_list(p["value"])
- assert p["name"] == "PROCESSES"
+ assert p["name"] == "RESOURCE_GROUPS"
assert len(p["value"]) == 3
assert is_dict(p["value"][0])
@@ -147,7 +147,7 @@ def check_workingdir_property(p):
def check_properties(p):
assert is_list(p)
assert len(p) == 4
- check_processes_property(p[0])
+ check_resource_groups_property(p[0])
check_reqfiles_property(p[1])
check_willfail_property(p[2])
check_workingdir_property(p[3])
diff --git a/Tests/RunCMake/CTestCommandLine/test1-pass.cmake b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake
new file mode 100644
index 0000000000..dda8deae50
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake
@@ -0,0 +1,13 @@
+# This is run by test test1 in repeat-until-pass-cmake.cmake with cmake -P.
+# It reads the file TEST_OUTPUT_FILE and increments the number
+# found in the file by 1. Unless the number is 2, then the
+# code sends out a cmake error causing the test to pass only on
+# the second time it is run.
+message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
+file(READ "${TEST_OUTPUT_FILE}" COUNT)
+message("COUNT= ${COUNT}")
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
+if(NOT COUNT EQUAL 2)
+ message(FATAL_ERROR "this test passes only on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake
new file mode 100644
index 0000000000..fbf2cccd46
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake
@@ -0,0 +1,14 @@
+# This is run by test test1 in repeat-after-timeout-cmake.cmake with cmake -P.
+# It reads the file TEST_OUTPUT_FILE and increments the number
+# found in the file by 1. Unless the number is 2, then the
+# code sends out a cmake error causing the test to not timeout only on
+# the second time it is run.
+message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
+file(READ "${TEST_OUTPUT_FILE}" COUNT)
+message("COUNT= ${COUNT}")
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
+if(NOT COUNT EQUAL 2)
+ message("this test times out except on the 2nd run")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
+endif()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/HardwareCommon.cmake b/Tests/RunCMake/CTestHardwareAllocation/HardwareCommon.cmake
deleted file mode 100644
index 3893d40bbe..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/HardwareCommon.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-function(setup_hardware_tests)
- if(CTEST_HARDWARE_ALLOC_ENABLED)
- add_test(NAME HardwareSetup COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_BINARY_DIR}/cthwalloc.log")
- endif()
-endfunction()
-
-function(add_hardware_test name sleep_time proc)
- if(CTEST_HARDWARE_ALLOC_ENABLED)
- add_test(NAME "${name}" COMMAND "${CTHWALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/cthwalloc.log" "${name}" "${sleep_time}" "${proc}")
- set_property(TEST "${name}" PROPERTY DEPENDS HardwareSetup)
- else()
- add_test(NAME "${name}" COMMAND "${CTHWALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/cthwalloc.log" "${name}" "${sleep_time}")
- endif()
- set_property(TEST "${name}" PROPERTY PROCESSES "${proc}")
- list(APPEND HARDWARE_TESTS "${name}")
- set(HARDWARE_TESTS "${HARDWARE_TESTS}" PARENT_SCOPE)
-endfunction()
-
-function(cleanup_hardware_tests)
- if(CTEST_HARDWARE_ALLOC_ENABLED)
- file(WRITE "${CMAKE_BINARY_DIR}/hwtests.txt" "${HARDWARE_TESTS}")
- endif()
-endfunction()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake
deleted file mode 100644
index d666922e56..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake
+++ /dev/null
@@ -1,167 +0,0 @@
-include(RunCMake)
-include(RunCTest)
-
-###############################################################################
-# Test cthwalloc itself - we want to make sure it's not just rubber-stamping
-# the test results
-###############################################################################
-
-function(cthwalloc_verify_log expected_contents)
- if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log")
- string(APPEND RunCMake_TEST_FAILED "Log file was not written\n")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- return()
- endif()
- file(READ "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log" actual_contents)
- if(NOT actual_contents STREQUAL expected_contents)
- string(APPEND RunCMake_TEST_FAILED "Actual log did not match expected log\n")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
-endfunction()
-
-function(run_cthwalloc_write_proc name proc)
- file(REMOVE "${RunCMake_BINARY_DIR}/${name}-build/cthwalloc.log")
- run_cthwalloc_write_proc_nodel("${name}" "${proc}" "${ARGN}")
-endfunction()
-
-function(run_cthwalloc_write_proc_nodel name proc)
- string(REPLACE ";" "\\;" proc "${proc}")
- run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTHWALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/cthwalloc.log" "${name}" 0 "${proc}")
-endfunction()
-
-function(run_cthwalloc_write_noproc name)
- run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTHWALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/cthwalloc.log" "${name}" 0)
-endfunction()
-
-function(run_cthwalloc_verify name tests)
- string(REPLACE ";" "\\;" tests "${tests}")
- run_cmake_command(${name} "${CTHWALLOC_COMMAND}" verify "${RunCMake_SOURCE_DIR}/${name}.log" "${CMAKE_CURRENT_LIST_DIR}/hwspec.json" "${tests}")
-endfunction()
-
-unset(ENV{CTEST_PROCESS_COUNT})
-set(RunCMake_TEST_NO_CLEAN 1)
-file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/cthwalloc-write-proc-good1-build")
-file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/cthwalloc-write-proc-good1-build")
-file(WRITE "${RunCMake_BINARY_DIR}/cthwalloc-write-proc-good1-build/cthwalloc.log"
-[[begin test1
-alloc widgets 0 1
-dealloc widgets 0 1
-end test1
-]])
-run_cthwalloc_write_proc_nodel(cthwalloc-write-proc-good1 "1,widgets:2,transmogrifiers:1;2,widgets:1,widgets:2"
- CTEST_PROCESS_COUNT=3
- CTEST_PROCESS_0=widgets,transmogrifiers
- CTEST_PROCESS_0_WIDGETS=id:0,slots:2
- CTEST_PROCESS_0_TRANSMOGRIFIERS=id:calvin,slots:1
- CTEST_PROCESS_1=widgets
- "CTEST_PROCESS_1_WIDGETS=id:0,slots:1\\;id:2,slots:2"
- CTEST_PROCESS_2=widgets
- "CTEST_PROCESS_2_WIDGETS=id:0,slots:1\\;id:2,slots:2"
- )
-set(RunCMake_TEST_NO_CLEAN 0)
-run_cthwalloc_write_proc(cthwalloc-write-proc-good2 "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- CTEST_PROCESS_0_WIDGETS=id:3,slots:8
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-nocount "widgets:8")
-run_cthwalloc_write_proc(cthwalloc-write-proc-badcount "widgets:8"
- CTEST_PROCESS_COUNT=2
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-nores "widgets:8"
- CTEST_PROCESS_COUNT=1
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badres "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets,transmogrifiers
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-nowidgets "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets1 "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- CTEST_PROCESS_0_WIDGETS=
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets2 "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- "CTEST_PROCESS_0_WIDGETS=id:3,slots:8\\;id:0,slots:1"
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets3 "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- CTEST_PROCESS_0_WIDGETS=id:3,slots:7
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets4 "widgets:8"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- CTEST_PROCESS_0_WIDGETS=invalid
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets5 "widgets:2,widgets:2"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- "CTEST_PROCESS_0_WIDGETS=id:0,slots:2\\;id:0,slots:1"
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets6 "widgets:2"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- "CTEST_PROCESS_0_WIDGETS=id:0,slots:2\\;id:0,slots:1"
- )
-run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets7 "widgets:2,widgets:2"
- CTEST_PROCESS_COUNT=1
- CTEST_PROCESS_0=widgets
- CTEST_PROCESS_0_WIDGETS=id:0,slots:2
- )
-
-run_cthwalloc_write_noproc(cthwalloc-write-noproc-good1)
-run_cthwalloc_write_noproc(cthwalloc-write-noproc-count
- CTEST_PROCESS_COUNT=1
- )
-
-run_cthwalloc_verify(cthwalloc-verify-good1 "test1;test2")
-run_cthwalloc_verify(cthwalloc-verify-good2 "")
-run_cthwalloc_verify(cthwalloc-verify-nolog "")
-run_cthwalloc_verify(cthwalloc-verify-nores "")
-run_cthwalloc_verify(cthwalloc-verify-noid "")
-run_cthwalloc_verify(cthwalloc-verify-notenough "")
-run_cthwalloc_verify(cthwalloc-verify-baddealloc "")
-run_cthwalloc_verify(cthwalloc-verify-leak "")
-run_cthwalloc_verify(cthwalloc-verify-badtest1 "")
-run_cthwalloc_verify(cthwalloc-verify-badtest2 "test1")
-run_cthwalloc_verify(cthwalloc-verify-badtest3 "test1")
-run_cthwalloc_verify(cthwalloc-verify-badtest4 "test1")
-run_cthwalloc_verify(cthwalloc-verify-badtest5 "test1")
-run_cthwalloc_verify(cthwalloc-verify-nobegin "test1")
-run_cthwalloc_verify(cthwalloc-verify-noend "test1")
-
-###############################################################################
-# Now test the hardware allocation feature of CTest
-###############################################################################
-
-function(run_ctest_hardware name parallel random)
- run_ctest("${name}-ctest-s-hw" "-DCTEST_HARDWARE_ALLOC_ENABLED=1" "-DCTHWALLOC_COMMAND=${CTHWALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
- run_ctest("${name}-ctest-s-nohw" "-DCTEST_HARDWARE_ALLOC_ENABLED=0" "-DCTHWALLOC_COMMAND=${CTHWALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
-endfunction()
-
-function(verify_ctest_hardware)
- file(READ "${RunCMake_TEST_BINARY_DIR}/hwtests.txt" hwtests)
- execute_process(COMMAND "${CTHWALLOC_COMMAND}" verify "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log" "${CMAKE_CURRENT_LIST_DIR}/hwspec.json" "${hwtests}"
- OUTPUT_VARIABLE output ERROR_QUIET RESULT_VARIABLE result)
- if(result)
- string(APPEND RunCMake_TEST_FAILED "${output}")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
-endfunction()
-
-run_ctest_hardware(lotsoftests 10 1)
-run_ctest_hardware(checkfree1 2 0)
-run_ctest_hardware(checkfree2 1 0)
-run_ctest_hardware(notenough1 1 0)
-run_ctest_hardware(notenough2 1 0)
-run_ctest_hardware(ensure_parallel 2 0)
-
-set(ENV{CTEST_PROCESS_COUNT} 2)
-run_ctest_hardware(process_count 1 0)
-unset(ENV{CTEST_PROCESS_COUNT})
diff --git a/Tests/RunCMake/CTestHardwareAllocation/checkfree1-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/checkfree1-ctest-s-hw-check.cmake
deleted file mode 100644
index 94b1fa7838..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/checkfree1-ctest-s-hw-check.cmake
+++ /dev/null
@@ -1 +0,0 @@
-verify_ctest_hardware()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/checkfree1.cmake b/Tests/RunCMake/CTestHardwareAllocation/checkfree1.cmake
deleted file mode 100644
index 0e997b5be3..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/checkfree1.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-setup_hardware_tests()
-
-add_hardware_test(Test1 1 "widgets:8")
-add_hardware_test(Test2 1 "fluxcapacitors:50;fluxcapacitors:50,widgets:8")
-add_hardware_test(Test3 1 "fluxcapacitors:121")
-
-cleanup_hardware_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/checkfree2-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/checkfree2-ctest-s-hw-check.cmake
deleted file mode 100644
index 94b1fa7838..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/checkfree2-ctest-s-hw-check.cmake
+++ /dev/null
@@ -1 +0,0 @@
-verify_ctest_hardware()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/checkfree2.cmake b/Tests/RunCMake/CTestHardwareAllocation/checkfree2.cmake
deleted file mode 100644
index 3c2b666057..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/checkfree2.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-setup_hardware_tests()
-
-# This test is an attack on the hardware scheduling algorithm. It has been
-# carefully crafted to fool the algorithm into thinking there isn't sufficient
-# hardware for it.
-add_hardware_test(Test1 1 "widgets:2;4,widgets:4")
-
-cleanup_hardware_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake
deleted file mode 100644
index ca0c6b8660..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-cthwalloc_verify_log(
-[[begin cthwalloc-write-proc-good2
-alloc widgets 3 8
-dealloc widgets 3 8
-end cthwalloc-write-proc-good2
-]])
diff --git a/Tests/RunCMake/CTestHardwareAllocation/lotsoftests-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/lotsoftests-ctest-s-hw-check.cmake
deleted file mode 100644
index 94b1fa7838..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/lotsoftests-ctest-s-hw-check.cmake
+++ /dev/null
@@ -1 +0,0 @@
-verify_ctest_hardware()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/lotsoftests.cmake b/Tests/RunCMake/CTestHardwareAllocation/lotsoftests.cmake
deleted file mode 100644
index c684434c07..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/lotsoftests.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-setup_hardware_tests()
-
-add_hardware_test(Test1 2 "widgets:8;2,widgets:2")
-add_hardware_test(Test2 5 "fluxcapacitors:40")
-add_hardware_test(Test3 1 "10,widgets:1,fluxcapacitors:2")
-add_hardware_test(Test4 4 "fluxcapacitors:121")
-
-foreach(i RANGE 5 50)
- add_hardware_test(Test${i} 1 "2,widgets:1")
-endforeach()
-
-foreach(i RANGE 51 100)
- add_hardware_test(Test${i} 1 "2,transmogrifiers:2")
-endforeach()
-
-cleanup_hardware_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-check.cmake
deleted file mode 100644
index 9c730bef57..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-check.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-if(EXISTS "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log")
- set(RunCMake_TEST_FAILED "cthwalloc.log should not exist")
-endif()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-stderr.txt b/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-stderr.txt
deleted file mode 100644
index d465cd3058..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^Insufficient hardware
-CMake Error at [^
-]*/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw/test\.cmake:[0-9]+ \(message\):
- Tests did not pass$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough1.cmake b/Tests/RunCMake/CTestHardwareAllocation/notenough1.cmake
deleted file mode 100644
index 3e1f620048..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough1.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-setup_hardware_tests()
-
-add_hardware_test(Test1 1 "fluxcapacitors:200")
-
-cleanup_hardware_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-check.cmake
deleted file mode 100644
index 9c730bef57..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-check.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-if(EXISTS "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log")
- set(RunCMake_TEST_FAILED "cthwalloc.log should not exist")
-endif()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-stderr.txt b/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-stderr.txt
deleted file mode 100644
index 912f0fb534..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^Insufficient hardware
-CMake Error at [^
-]*/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw/test\.cmake:[0-9]+ \(message\):
- Tests did not pass$
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough2.cmake b/Tests/RunCMake/CTestHardwareAllocation/notenough2.cmake
deleted file mode 100644
index 8205c9577d..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough2.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-setup_hardware_tests()
-
-add_hardware_test(Test1 1 "terminators:2")
-
-cleanup_hardware_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/process_count-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/process_count-ctest-s-hw-check.cmake
deleted file mode 100644
index 94b1fa7838..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/process_count-ctest-s-hw-check.cmake
+++ /dev/null
@@ -1 +0,0 @@
-verify_ctest_hardware()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/process_count.cmake b/Tests/RunCMake/CTestHardwareAllocation/process_count.cmake
deleted file mode 100644
index c969648f47..0000000000
--- a/Tests/RunCMake/CTestHardwareAllocation/process_count.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-setup_hardware_tests()
-
-add_hardware_test(Test1 1 "widgets:1")
-
-cleanup_hardware_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/CMakeLists.txt.in b/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in
index d6cff631bc..998442116c 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/CMakeLists.txt.in
+++ b/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in
@@ -4,6 +4,6 @@ if(CASE_NAME MATCHES "^(.*)-ctest-s")
set(projname "${CMAKE_MATCH_1}")
project(${projname} NONE)
include(CTest)
- include("@RunCMake_SOURCE_DIR@/HardwareCommon.cmake")
+ include("@RunCMake_SOURCE_DIR@/ResourceCommon.cmake")
include("@RunCMake_SOURCE_DIR@/${projname}.cmake")
endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
new file mode 100644
index 0000000000..7d632999d6
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
@@ -0,0 +1,23 @@
+function(setup_resource_tests)
+ if(CTEST_RESOURCE_ALLOC_ENABLED)
+ add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
+ endif()
+endfunction()
+
+function(add_resource_test name sleep_time proc)
+ if(CTEST_RESOURCE_ALLOC_ENABLED)
+ add_test(NAME "${name}" COMMAND "${CTRESALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/ctresalloc.log" "${name}" "${sleep_time}" "${proc}")
+ set_property(TEST "${name}" PROPERTY DEPENDS ResourceSetup)
+ else()
+ add_test(NAME "${name}" COMMAND "${CTRESALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/ctresalloc.log" "${name}" "${sleep_time}")
+ endif()
+ set_property(TEST "${name}" PROPERTY RESOURCE_GROUPS "${proc}")
+ list(APPEND RESOURCE_TESTS "${name}")
+ set(RESOURCE_TESTS "${RESOURCE_TESTS}" PARENT_SCOPE)
+endfunction()
+
+function(cleanup_resource_tests)
+ if(CTEST_RESOURCE_ALLOC_ENABLED)
+ file(WRITE "${CMAKE_BINARY_DIR}/restests.txt" "${RESOURCE_TESTS}")
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
new file mode 100644
index 0000000000..d52a63e425
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
@@ -0,0 +1,167 @@
+include(RunCMake)
+include(RunCTest)
+
+###############################################################################
+# Test ctresalloc itself - we want to make sure it's not just rubber-stamping
+# the test results
+###############################################################################
+
+function(ctresalloc_verify_log expected_contents)
+ if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ string(APPEND RunCMake_TEST_FAILED "Log file was not written\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ return()
+ endif()
+ file(READ "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log" actual_contents)
+ if(NOT actual_contents STREQUAL expected_contents)
+ string(APPEND RunCMake_TEST_FAILED "Actual log did not match expected log\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(run_ctresalloc_write_proc name proc)
+ file(REMOVE "${RunCMake_BINARY_DIR}/${name}-build/ctresalloc.log")
+ run_ctresalloc_write_proc_nodel("${name}" "${proc}" "${ARGN}")
+endfunction()
+
+function(run_ctresalloc_write_proc_nodel name proc)
+ string(REPLACE ";" "\\;" proc "${proc}")
+ run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTRESALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/ctresalloc.log" "${name}" 0 "${proc}")
+endfunction()
+
+function(run_ctresalloc_write_noproc name)
+ run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTRESALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/ctresalloc.log" "${name}" 0)
+endfunction()
+
+function(run_ctresalloc_verify name tests)
+ string(REPLACE ";" "\\;" tests "${tests}")
+ run_cmake_command(${name} "${CTRESALLOC_COMMAND}" verify "${RunCMake_SOURCE_DIR}/${name}.log" "${CMAKE_CURRENT_LIST_DIR}/resspec.json" "${tests}")
+endfunction()
+
+unset(ENV{CTEST_RESOURCE_GROUP_COUNT})
+set(RunCMake_TEST_NO_CLEAN 1)
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build")
+file(WRITE "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build/ctresalloc.log"
+[[begin test1
+alloc widgets 0 1
+dealloc widgets 0 1
+end test1
+]])
+run_ctresalloc_write_proc_nodel(ctresalloc-write-proc-good1 "1,widgets:2,transmogrifiers:1;2,widgets:1,widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=3
+ CTEST_RESOURCE_GROUP_0=widgets,transmogrifiers
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2
+ CTEST_RESOURCE_GROUP_0_TRANSMOGRIFIERS=id:calvin,slots:1
+ CTEST_RESOURCE_GROUP_1=widgets
+ "CTEST_RESOURCE_GROUP_1_WIDGETS=id:0,slots:1\\;id:2,slots:2"
+ CTEST_RESOURCE_GROUP_2=widgets
+ "CTEST_RESOURCE_GROUP_2_WIDGETS=id:0,slots:1\\;id:2,slots:2"
+ )
+set(RunCMake_TEST_NO_CLEAN 0)
+run_ctresalloc_write_proc(ctresalloc-write-proc-good2 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:3,slots:8
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-nocount "widgets:8")
+run_ctresalloc_write_proc(ctresalloc-write-proc-badcount "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=2
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-nores "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badres "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets,transmogrifiers
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-nowidgets "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets1 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets2 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ "CTEST_RESOURCE_GROUP_0_WIDGETS=id:3,slots:8\\;id:0,slots:1"
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets3 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:3,slots:7
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets4 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=invalid
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets5 "widgets:2,widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ "CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2\\;id:0,slots:1"
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets6 "widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ "CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2\\;id:0,slots:1"
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets7 "widgets:2,widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2
+ )
+
+run_ctresalloc_write_noproc(ctresalloc-write-noproc-good1)
+run_ctresalloc_write_noproc(ctresalloc-write-noproc-count
+ CTEST_RESOURCE_GROUP_COUNT=1
+ )
+
+run_ctresalloc_verify(ctresalloc-verify-good1 "test1;test2")
+run_ctresalloc_verify(ctresalloc-verify-good2 "")
+run_ctresalloc_verify(ctresalloc-verify-nolog "")
+run_ctresalloc_verify(ctresalloc-verify-nores "")
+run_ctresalloc_verify(ctresalloc-verify-noid "")
+run_ctresalloc_verify(ctresalloc-verify-notenough "")
+run_ctresalloc_verify(ctresalloc-verify-baddealloc "")
+run_ctresalloc_verify(ctresalloc-verify-leak "")
+run_ctresalloc_verify(ctresalloc-verify-badtest1 "")
+run_ctresalloc_verify(ctresalloc-verify-badtest2 "test1")
+run_ctresalloc_verify(ctresalloc-verify-badtest3 "test1")
+run_ctresalloc_verify(ctresalloc-verify-badtest4 "test1")
+run_ctresalloc_verify(ctresalloc-verify-badtest5 "test1")
+run_ctresalloc_verify(ctresalloc-verify-nobegin "test1")
+run_ctresalloc_verify(ctresalloc-verify-noend "test1")
+
+###############################################################################
+# Now test the resource allocation feature of CTest
+###############################################################################
+
+function(run_ctest_resource name parallel random)
+ run_ctest("${name}-ctest-s-res" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+ run_ctest("${name}-ctest-s-nores" "-DCTEST_RESOURCE_ALLOC_ENABLED=0" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+endfunction()
+
+function(verify_ctest_resources)
+ file(READ "${RunCMake_TEST_BINARY_DIR}/restests.txt" restests)
+ execute_process(COMMAND "${CTRESALLOC_COMMAND}" verify "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log" "${CMAKE_CURRENT_LIST_DIR}/resspec.json" "${restests}"
+ OUTPUT_VARIABLE output ERROR_QUIET RESULT_VARIABLE result)
+ if(result)
+ string(APPEND RunCMake_TEST_FAILED "${output}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+run_ctest_resource(lotsoftests 10 1)
+run_ctest_resource(checkfree1 2 0)
+run_ctest_resource(checkfree2 1 0)
+run_ctest_resource(notenough1 1 0)
+run_ctest_resource(notenough2 1 0)
+run_ctest_resource(ensure_parallel 2 0)
+
+set(ENV{CTEST_RESOURCE_GROUP_COUNT} 2)
+run_ctest_resource(process_count 1 0)
+unset(ENV{CTEST_RESOURCE_GROUP_COUNT})
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..ceda72ea81
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake
new file mode 100644
index 0000000000..45cbf20996
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake
@@ -0,0 +1,7 @@
+setup_resource_tests()
+
+add_resource_test(Test1 1 "widgets:8")
+add_resource_test(Test2 1 "fluxcapacitors:50;fluxcapacitors:50,widgets:8")
+add_resource_test(Test3 1 "fluxcapacitors:121")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..ceda72ea81
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake
new file mode 100644
index 0000000000..03b737cea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake
@@ -0,0 +1,8 @@
+setup_resource_tests()
+
+# This test is an attack on the resource scheduling algorithm. It has been
+# carefully crafted to fool the algorithm into thinking there aren't sufficient
+# resources for it.
+add_resource_test(Test1 1 "widgets:2;4,widgets:4")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log
index abd6badc8a..abd6badc8a 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log
index 605104b1a0..605104b1a0 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log
index 1ff1b0d715..1ff1b0d715 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nolog-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nolog-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log
index 1925e6a3d4..1925e6a3d4 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log
index 3fe7da1699..3fe7da1699 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log
index 3a2e7e3bf9..3a2e7e3bf9 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good1.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log
index 2cca0c39c8..2cca0c39c8 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good1.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good2.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good2.log
index e69de29bb2..e69de29bb2 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good2.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good2.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-noproc-count-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-noproc-count-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log
index b900d86d19..b900d86d19 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badcount-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badcount-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin.log
index e69de29bb2..e69de29bb2 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badres-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badres-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log
index 605104b1a0..605104b1a0 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets1-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets1-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log
index c718975253..c718975253 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets2-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets2-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets3-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets3-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log
index a18202b0a1..a18202b0a1 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets4-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets4-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log
index ac78d5ad3e..ac78d5ad3e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough.log
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets5-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets5-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets6-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets6-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets7-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets7-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nocount-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nocount-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nores-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nores-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nowidgets-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nowidgets-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good1-check.cmake b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake
index 949d2d7b9a..40144c89b9 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good1-check.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake
@@ -1,9 +1,9 @@
-cthwalloc_verify_log(
+ctresalloc_verify_log(
[[begin test1
alloc widgets 0 1
dealloc widgets 0 1
end test1
-begin cthwalloc-write-proc-good1
+begin ctresalloc-write-proc-good1
alloc transmogrifiers calvin 1
alloc widgets 0 2
alloc widgets 0 1
@@ -16,5 +16,5 @@ dealloc widgets 0 1
dealloc widgets 2 2
dealloc widgets 0 1
dealloc widgets 2 2
-end cthwalloc-write-proc-good1
+end ctresalloc-write-proc-good1
]])
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake
new file mode 100644
index 0000000000..4545466fba
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake
@@ -0,0 +1,6 @@
+ctresalloc_verify_log(
+[[begin ctresalloc-write-proc-good2
+alloc widgets 3 8
+dealloc widgets 3 8
+end ctresalloc-write-proc-good2
+]])
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc.cxx b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
index eee2c7fa2f..27644af284 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc.cxx
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
@@ -13,9 +13,9 @@
#include "cmsys/Encoding.hxx"
#include "cmsys/FStream.hxx"
-#include "cmCTestHardwareAllocator.h"
-#include "cmCTestHardwareSpec.h"
#include "cmCTestMultiProcessHandler.h"
+#include "cmCTestResourceAllocator.h"
+#include "cmCTestResourceSpec.h"
#include "cmCTestTestHandler.h"
#include "cmFileLock.h"
#include "cmFileLockResult.h"
@@ -23,15 +23,15 @@
#include "cmSystemTools.h"
/*
- * This helper program is used to verify that the CTest hardware allocation
+ * This helper program is used to verify that the CTest resource allocation
* feature is working correctly. It consists of two stages:
*
- * 1) write - This stage receives the PROCESSES property of the test and
- * compares it with the values passed in the CTEST_PROCESS_* environment
- * variables. If it received all of the resources it expected, then it
- * writes this information to a log file, which will be read in the verify
- * stage.
- * 2) verify - This stage compares the log file with the hardware spec file to
+ * 1) write - This stage receives the RESOURCE_GROUPS property of the test and
+ * compares it with the values passed in the CTEST_RESOURCE_GROUP_*
+ * environment variables. If it received all of the resources it expected,
+ * then it writes this information to a log file, which will be read in
+ * the verify stage.
+ * 2) verify - This stage compares the log file with the resource spec file to
* make sure that no resources were over-subscribed, deallocated without
* being allocated, or allocated without being deallocated.
*/
@@ -46,7 +46,7 @@ static int usageWrite(const char* argv0)
{
std::cout << "Usage: " << argv0
<< " write <log-file> <test-name> <sleep-time-secs>"
- " [<processes-property>]"
+ " [<resource-groups-property>]"
<< std::endl;
return 1;
}
@@ -54,7 +54,7 @@ static int usageWrite(const char* argv0)
static int usageVerify(const char* argv0)
{
std::cout << "Usage: " << argv0
- << " verify <log-file> <hardware-spec-file> [<test-names>]"
+ << " verify <log-file> <resource-spec-file> [<test-names>]"
<< std::endl;
return 1;
}
@@ -68,31 +68,33 @@ static int doWrite(int argc, char const* const* argv)
std::string testName = argv[3];
unsigned int sleepTime = std::atoi(argv[4]);
std::vector<std::map<
- std::string, std::vector<cmCTestMultiProcessHandler::HardwareAllocation>>>
- hardware;
+ std::string, std::vector<cmCTestMultiProcessHandler::ResourceAllocation>>>
+ resources;
if (argc == 6) {
- // Parse processes property
- std::string processesProperty = argv[5];
+ // Parse RESOURCE_GROUPS property
+ std::string resourceGroupsProperty = argv[5];
std::vector<
std::vector<cmCTestTestHandler::cmCTestTestResourceRequirement>>
- processes;
- bool result =
- cmCTestTestHandler::ParseProcessesProperty(processesProperty, processes);
+ resourceGroups;
+ bool result = cmCTestTestHandler::ParseResourceGroupsProperty(
+ resourceGroupsProperty, resourceGroups);
(void)result;
assert(result);
- // Verify process count
- const char* processCountEnv = cmSystemTools::GetEnv("CTEST_PROCESS_COUNT");
- if (!processCountEnv) {
- std::cout << "CTEST_PROCESS_COUNT should be defined" << std::endl;
+ // Verify group count
+ const char* resourceGroupCountEnv =
+ cmSystemTools::GetEnv("CTEST_RESOURCE_GROUP_COUNT");
+ if (!resourceGroupCountEnv) {
+ std::cout << "CTEST_RESOURCE_GROUP_COUNT should be defined" << std::endl;
return 1;
}
- int processCount = std::atoi(processCountEnv);
- if (processes.size() != std::size_t(processCount)) {
- std::cout << "CTEST_PROCESS_COUNT does not match expected processes"
- << std::endl
- << "Expected: " << processes.size() << std::endl
- << "Actual: " << processCount << std::endl;
+ int resourceGroupCount = std::atoi(resourceGroupCountEnv);
+ if (resourceGroups.size() != std::size_t(resourceGroupCount)) {
+ std::cout
+ << "CTEST_RESOURCE_GROUP_COUNT does not match expected resource groups"
+ << std::endl
+ << "Expected: " << resourceGroups.size() << std::endl
+ << "Actual: " << resourceGroupCount << std::endl;
return 1;
}
@@ -110,15 +112,15 @@ static int doWrite(int argc, char const* const* argv)
std::size_t i = 0;
cmsys::ofstream fout(logFile.c_str(), std::ios::app);
fout << "begin " << testName << std::endl;
- for (auto& process : processes) {
+ for (auto& resourceGroup : resourceGroups) {
try {
// Build and verify set of expected resources
std::set<std::string> expectedResources;
- for (auto const& it : process) {
+ for (auto const& it : resourceGroup) {
expectedResources.insert(it.ResourceType);
}
- std::string prefix = "CTEST_PROCESS_";
+ std::string prefix = "CTEST_RESOURCE_GROUP_";
prefix += std::to_string(i);
const char* actualResourcesCStr = cmSystemTools::GetEnv(prefix);
if (!actualResourcesCStr) {
@@ -144,10 +146,10 @@ static int doWrite(int argc, char const* const* argv)
// Verify that we got what we asked for and write it to the log
prefix += '_';
std::map<std::string,
- std::vector<cmCTestMultiProcessHandler::HardwareAllocation>>
- hwEntry;
+ std::vector<cmCTestMultiProcessHandler::ResourceAllocation>>
+ resEntry;
for (auto const& type : actualResources) {
- auto it = process.begin();
+ auto it = resourceGroup.begin();
std::string varName = prefix;
varName += cmSystemTools::UpperCase(type);
@@ -161,7 +163,7 @@ static int doWrite(int argc, char const* const* argv)
for (auto const& r : received) {
while (it->ResourceType != type || it->UnitsNeeded == 0) {
++it;
- if (it == process.end()) {
+ if (it == resourceGroup.end()) {
std::cout << varName << " did not list expected resources"
<< std::endl;
return 1;
@@ -192,13 +194,13 @@ static int doWrite(int argc, char const* const* argv)
fout << "alloc " << type << " " << id << " " << amount
<< std::endl;
- hwEntry[type].push_back({ id, amount });
+ resEntry[type].push_back({ id, amount });
}
bool ended = false;
while (it->ResourceType != type || it->UnitsNeeded == 0) {
++it;
- if (it == process.end()) {
+ if (it == resourceGroup.end()) {
ended = true;
break;
}
@@ -210,7 +212,7 @@ static int doWrite(int argc, char const* const* argv)
return 1;
}
}
- hardware.push_back(hwEntry);
+ resources.push_back(resEntry);
++i;
} catch (...) {
@@ -225,8 +227,9 @@ static int doWrite(int argc, char const* const* argv)
return 1;
}
} else {
- if (cmSystemTools::GetEnv("CTEST_PROCESS_COUNT")) {
- std::cout << "CTEST_PROCESS_COUNT should not be defined" << std::endl;
+ if (cmSystemTools::GetEnv("CTEST_RESOURCE_GROUP_COUNT")) {
+ std::cout << "CTEST_RESOURCE_GROUP_COUNT should not be defined"
+ << std::endl;
return 1;
}
}
@@ -246,8 +249,8 @@ static int doWrite(int argc, char const* const* argv)
return 1;
}
cmsys::ofstream fout(logFile.c_str(), std::ios::app);
- for (auto const& process : hardware) {
- for (auto const& it : process) {
+ for (auto const& group : resources) {
+ for (auto const& it : group) {
for (auto const& it2 : it.second) {
fout << "dealloc " << it.first << " " << it2.Id << " " << it2.Slots
<< std::endl;
@@ -273,7 +276,7 @@ static int doVerify(int argc, char const* const* argv)
return usageVerify(argv[0]);
}
std::string logFile = argv[2];
- std::string hwFile = argv[3];
+ std::string resFile = argv[3];
std::string testNames;
if (argc == 5) {
testNames = argv[4];
@@ -281,14 +284,14 @@ static int doVerify(int argc, char const* const* argv)
auto testNameList = cmExpandedList(testNames, false);
std::set<std::string> testNameSet(testNameList.begin(), testNameList.end());
- cmCTestHardwareSpec spec;
- if (!spec.ReadFromJSONFile(hwFile)) {
- std::cout << "Could not read hardware spec " << hwFile << std::endl;
+ cmCTestResourceSpec spec;
+ if (!spec.ReadFromJSONFile(resFile)) {
+ std::cout << "Could not read resource spec " << resFile << std::endl;
return 1;
}
- cmCTestHardwareAllocator allocator;
- allocator.InitializeFromHardwareSpec(spec);
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
cmsys::ifstream fin(logFile.c_str(), std::ios::in);
if (!fin) {
diff --git a/Tests/RunCMake/CTestHardwareAllocation/ensure_parallel-ctest-s-hw-check.cmake b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake
index e5f6828042..d842a76f49 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/ensure_parallel-ctest-s-hw-check.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake
@@ -1,4 +1,4 @@
-verify_ctest_hardware()
+verify_ctest_resources()
set(expected_contents [[
begin Test1
@@ -10,7 +10,7 @@ end Test1
dealloc transmogrifiers hobbes 2
end Test2
]])
-file(READ "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log" actual_contents)
+file(READ "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log" actual_contents)
if(NOT actual_contents STREQUAL expected_contents)
- string(APPEND RunCMake_TEST_FAILED "cthwalloc.log contents did not match expected\n")
+ string(APPEND RunCMake_TEST_FAILED "ctresalloc.log contents did not match expected\n")
endif()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/ensure_parallel.cmake b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake
index 1dafb8fc28..562d05acb0 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/ensure_parallel.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake
@@ -1,11 +1,11 @@
-setup_hardware_tests()
+setup_resource_tests()
-add_hardware_test(Test1 4 "transmogrifiers:2")
+add_resource_test(Test1 4 "transmogrifiers:2")
# Mitigate possible race conditions to ensure that the events are logged in the
# exact order we want
add_test(NAME Test2Sleep COMMAND "${CMAKE_COMMAND}" -E sleep 2)
-add_hardware_test(Test2 4 "transmogrifiers:2")
+add_resource_test(Test2 4 "transmogrifiers:2")
set_property(TEST Test2 APPEND PROPERTY DEPENDS Test2Sleep)
-cleanup_hardware_tests()
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..ceda72ea81
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake b/Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake
new file mode 100644
index 0000000000..4c0a7a554f
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake
@@ -0,0 +1,16 @@
+setup_resource_tests()
+
+add_resource_test(Test1 2 "widgets:8;2,widgets:2")
+add_resource_test(Test2 5 "fluxcapacitors:40")
+add_resource_test(Test3 1 "10,widgets:1,fluxcapacitors:2")
+add_resource_test(Test4 4 "fluxcapacitors:121")
+
+foreach(i RANGE 5 50)
+ add_resource_test(Test${i} 1 "2,widgets:1")
+endforeach()
+
+foreach(i RANGE 51 100)
+ add_resource_test(Test${i} 1 "2,transmogrifiers:2")
+endforeach()
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..321e9a2f87
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt
index b57e2deb77..b57e2deb77 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough1-ctest-s-hw-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
new file mode 100644
index 0000000000..41df5afadb
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
@@ -0,0 +1,4 @@
+^Insufficient resources
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
new file mode 100644
index 0000000000..2908812d36
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 1 "fluxcapacitors:200")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..321e9a2f87
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt
index b57e2deb77..b57e2deb77 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/notenough2-ctest-s-hw-result.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
new file mode 100644
index 0000000000..6c2f554e54
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
@@ -0,0 +1,4 @@
+^Insufficient resources
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
new file mode 100644
index 0000000000..d7600c8963
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 1 "terminators:2")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..ceda72ea81
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/process_count.cmake b/Tests/RunCMake/CTestResourceAllocation/process_count.cmake
new file mode 100644
index 0000000000..1457f8976f
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/process_count.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 1 "widgets:1")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestHardwareAllocation/hwspec.json b/Tests/RunCMake/CTestResourceAllocation/resspec.json
index c67fcca1df..c67fcca1df 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/hwspec.json
+++ b/Tests/RunCMake/CTestResourceAllocation/resspec.json
diff --git a/Tests/RunCMake/CTestHardwareAllocation/test.cmake.in b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
index 5ba3587238..4b426f1617 100644
--- a/Tests/RunCMake/CTestHardwareAllocation/test.cmake.in
+++ b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
@@ -10,14 +10,14 @@ set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
ctest_start(Experimental QUIET)
ctest_configure(OPTIONS
- "-DCTEST_HARDWARE_ALLOC_ENABLED=${CTEST_HARDWARE_ALLOC_ENABLED};-DCTHWALLOC_COMMAND=${CTHWALLOC_COMMAND}"
+ "-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}"
)
ctest_build()
-if(CTEST_HARDWARE_ALLOC_ENABLED)
- set(hwspec HARDWARE_SPEC_FILE "@RunCMake_SOURCE_DIR@/hwspec.json")
+if(CTEST_RESOURCE_ALLOC_ENABLED)
+ set(resspec RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json")
endif()
-ctest_test(${hwspec} RETURN_VALUE retval PARALLEL_LEVEL ${CTEST_PARALLEL} SCHEDULE_RANDOM ${CTEST_RANDOM})
+ctest_test(${resspec} RETURN_VALUE retval PARALLEL_LEVEL ${CTEST_PARALLEL} SCHEDULE_RANDOM ${CTEST_RANDOM})
if(retval)
message(FATAL_ERROR "Tests did not pass")
endif()
diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
index f183594e53..1baa63a314 100644
--- a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
+++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
@@ -1,4 +1,15 @@
-^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
+^CMake Deprecation Warning at cmp0069-is-old.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0069 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
Policy CMP0069 set to OLD
Call Stack \(most recent call first\):
cmp0069-is-old\.cmake:[0-9]+ \(check_ipo_supported\)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index b608d334a7..f903c3d84a 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -254,6 +254,24 @@ function(run_EnvironmentGenerator)
endfunction()
run_EnvironmentGenerator()
+function(run_EnvironmentExportCompileCommands)
+ set(RunCMake_TEST_SOURCE_DIR ${RunCMake_SOURCE_DIR}/env-export-compile-commands)
+
+ run_cmake(env-export-compile-commands-unset)
+
+ set(ENV{CMAKE_EXPORT_COMPILE_COMMANDS} ON)
+ run_cmake(env-export-compile-commands-set)
+
+ set(RunCMake_TEST_OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF)
+ run_cmake(env-export-compile-commands-override)
+
+ unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
+endfunction(run_EnvironmentExportCompileCommands)
+
+if(RunCMake_GENERATOR MATCHES "Unix Makefiles" OR RunCMake_GENERATOR MATCHES "Ninja")
+ run_EnvironmentExportCompileCommands()
+endif()
+
if(RunCMake_GENERATOR STREQUAL "Ninja")
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Build-build)
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake
new file mode 100644
index 0000000000..032a1ae1e1
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS overridden")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake
new file mode 100644
index 0000000000..a749a55a47
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json not generated with CMAKE_EXPORT_COMPILE_COMMANDS set")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake
new file mode 100644
index 0000000000..c5878f0634
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS unset")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt
new file mode 100644
index 0000000000..aa6fbfd86d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.14)
+project(env-export-compile-commands C)
+
+# Add target with a source file to make sure compile_commands.json gets
+# generated.
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/main.c)
+add_executable(env-export-compile-commands ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index ae75561b11..bb22841543 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -30,6 +30,8 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
run_cmake(BadToolsetHostArchTwice)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
+ set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=Test Path")
+ run_cmake(TestToolsetVCTargetsPathOnly)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
run_cmake(TestToolsetVersionBoth)
set(RunCMake_GENERATOR_TOOLSET ",version=Test Toolset Version")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt
new file mode 100644
index 0000000000..c46373f2e3
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+'
+-- CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='Test Path'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake
new file mode 100644
index 0000000000..c20a303b6a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake
@@ -0,0 +1,2 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}'")
diff --git a/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in
new file mode 100644
index 0000000000..8a1c3d0000
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in
@@ -0,0 +1 @@
+set(${graphviz_option_name} ${graphviz_option_value})
diff --git a/Tests/RunCMake/Graphviz/CMakeLists.txt b/Tests/RunCMake/Graphviz/CMakeLists.txt
new file mode 100644
index 0000000000..d23d4cf6e1
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.15)
+project(${RunCMake_TEST} C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
new file mode 100644
index 0000000000..772f31221c
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
@@ -0,0 +1,58 @@
+# For the sake of clarity, we model a dummy but realistic application:
+#
+# - We have two executables, for a console and a GUI variant of that app
+# - Both executables depend on a CoreLibrary (STATIC)
+# - The GUI executable also depends on a GraphicLibrary (SHARED)
+# - We build two GraphicDrivers as MODULEs
+# - The CoreLibrary depends on a third-party header-only (INTERFACE)
+# GoofyLoggingLibrary, which we rename using an ALIAS for obvious reasons
+# - All library depend on a common INTERFACE library holding compiler flags
+# - We have a custom target to generate a man page
+# - Someone has added an UNKNOWN, IMPORTED crypto mining library!
+
+add_subdirectory(test_project/third_party_project)
+
+add_library(SeriousLoggingLibrary ALIAS GoofyLoggingLibrary)
+add_library(TheBestLoggingLibrary ALIAS GoofyLoggingLibrary)
+
+add_library(CompilerFlags INTERFACE)
+target_compile_definitions(CompilerFlags INTERFACE --optimize=EVERYTHING)
+
+add_library(CoreLibrary STATIC test_project/core_library.c)
+target_link_libraries(CoreLibrary PUBLIC CompilerFlags)
+
+target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary)
+
+add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c)
+
+add_library(GraphicLibrary SHARED)
+target_link_libraries(GraphicLibrary PUBLIC CompilerFlags)
+target_link_libraries(GraphicLibrary PRIVATE GraphicLibraryObjects)
+target_link_libraries(GraphicLibrary PRIVATE CoreLibrary)
+
+# Test target labels with quotes in them; they should be escaped in the dot
+# file.
+# See https://gitlab.kitware.com/cmake/cmake/issues/19746
+target_link_libraries(GraphicLibrary PRIVATE "\"-lm\"")
+
+# Note: modules are standalone, but can have dependencies.
+add_library(GraphicDriverOpenGL MODULE test_project/module.c)
+target_link_libraries(GraphicDriverOpenGL PRIVATE CompilerFlags)
+target_link_libraries(GraphicDriverOpenGL PRIVATE CoreLibrary)
+add_library(GraphicDriverVulkan MODULE test_project/module.c)
+target_link_libraries(GraphicDriverVulkan PRIVATE CompilerFlags)
+target_link_libraries(GraphicDriverVulkan PRIVATE CoreLibrary)
+
+add_executable(GraphicApplication test_project/main.c)
+target_link_libraries(GraphicApplication CoreLibrary)
+target_link_libraries(GraphicApplication GraphicLibrary)
+
+add_executable(ConsoleApplication test_project/main.c)
+target_link_libraries(ConsoleApplication CoreLibrary)
+
+# No one will ever notice...
+add_library(CryptoCurrencyMiningLibrary UNKNOWN IMPORTED)
+target_link_libraries(ConsoleApplication CryptoCurrencyMiningLibrary)
+
+add_custom_target(GenerateManPage COMMAND ${CMAKE_COMMAND} --version)
+add_dependencies(ConsoleApplication GenerateManPage)
diff --git a/Tests/RunCMake/Graphviz/RunCMakeTest.cmake b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
new file mode 100644
index 0000000000..c0cea1046a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
@@ -0,0 +1,82 @@
+include(RunCMake)
+
+find_program(DOT dot)
+
+# Set to TRUE to re-generate the reference files from the actual outputs.
+# Make sure you verify them!
+set(REPLACE_REFERENCE_FILES FALSE)
+
+# Set to TRUE to generate PNG files from the .dot files, using Graphviz (dot).
+# Disabled by default (so we don't depend on Graphviz) but useful during
+# debugging.
+set(GENERATE_PNG_FILES FALSE)
+
+# 1. Generate the Graphviz (.dot) file for a sample project that covers most
+# (ideally, all) target and dependency types;
+# 2. Compare that generated file with a reference file.
+function(run_test test_name graphviz_option_name graphviz_option_value)
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test_name})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ # Set ${graphviz_option_name} to ${graphviz_option_value}.
+ if(graphviz_option_name)
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeGraphVizOptions.cmake.in
+ ${RunCMake_TEST_BINARY_DIR}/CMakeGraphVizOptions.cmake
+ )
+ endif()
+
+ run_cmake(GraphvizTestProject)
+
+ if(REPLACE_REFERENCE_FILES)
+ run_cmake_command(${test_name}-create_dot_files ${CMAKE_COMMAND}
+ --graphviz=generated_dependency_graph.dot .
+ )
+
+ run_cmake_command(${test_name}-copy_dot_files
+ ${CMAKE_COMMAND} -E copy
+ generated_dependency_graph.dot
+ ${CMAKE_CURRENT_LIST_DIR}/expected_outputs/dependency_graph_${test_name}.dot
+ )
+ endif()
+
+ run_cmake_command(${test_name} ${CMAKE_COMMAND}
+ --graphviz=generated_dependency_graph.dot .
+ )
+
+ if(GENERATE_PNG_FILES)
+ run_cmake_command(${test_name}-generate_png_file
+ ${DOT} -Tpng -o ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.png
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot
+ )
+ endif()
+
+endfunction()
+
+run_test(default_options "" "")
+
+run_test(set_graph_name GRAPHVIZ_GRAPH_NAME "\"CMake Project Dependencies\"")
+run_test(set_graph_header GRAPHVIZ_GRAPH_HEADER
+ "\"node [\n fontsize = \\\"16\\\"\n];\"")
+run_test(set_node_prefix GRAPHVIZ_NODE_PREFIX "point")
+
+run_test(no_executables GRAPHVIZ_EXECUTABLES FALSE)
+
+run_test(no_static_libs GRAPHVIZ_STATIC_LIBS FALSE)
+run_test(no_shared_libs GRAPHVIZ_SHARED_LIBS FALSE)
+run_test(no_module_libs GRAPHVIZ_MODULE_LIBS FALSE)
+
+run_test(no_interface_libs GRAPHVIZ_INTERFACE_LIBS FALSE)
+run_test(no_object_libs GRAPHVIZ_OBJECT_LIBS FALSE)
+run_test(no_unknown_libs GRAPHVIZ_UNKNOWN_LIBS FALSE)
+
+run_test(no_external_libs GRAPHVIZ_EXTERNAL_LIBS FALSE)
+
+run_test(custom_targets GRAPHVIZ_CUSTOM_TARGETS TRUE)
+
+run_test(no_graphic_libs GRAPHVIZ_IGNORE_TARGETS "Graphic")
+
+run_test(no_per_target_files GRAPHVIZ_GENERATE_PER_TARGET FALSE)
+run_test(no_dependers_files GRAPHVIZ_GENERATE_DEPENDERS FALSE)
diff --git a/Tests/RunCMake/Graphviz/default_options-check.cmake b/Tests/RunCMake/Graphviz/default_options-check.cmake
new file mode 100644
index 0000000000..c9a7562ae5
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/default_options-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_default_options.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
new file mode 100644
index 0000000000..8b0365a772
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
@@ -0,0 +1,52 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GenerateManPage", shape = box ];
+ "node1" -> "node5" // ConsoleApplication -> GenerateManPage
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
new file mode 100644
index 0000000000..1bbf25aba8
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
new file mode 100644
index 0000000000..1bbf25aba8
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
new file mode 100644
index 0000000000..558a470617
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "CoreLibrary", shape = octagon ];
+ "node1" -> "node0" // CoreLibrary -> CompilerFlags
+ "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node5" [ label = "\"-lm\"", shape = septagon ];
+ "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node4" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
new file mode 100644
index 0000000000..660af37c0d
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
@@ -0,0 +1,46 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
new file mode 100644
index 0000000000..5af7fecc95
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
@@ -0,0 +1,35 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "\"-lm\"", shape = septagon ];
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
new file mode 100644
index 0000000000..94ec41ce25
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
@@ -0,0 +1,43 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "ConsoleApplication", shape = egg ];
+ "node1" [ label = "CoreLibrary", shape = octagon ];
+ "node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node3" [ label = "GraphicApplication", shape = egg ];
+ "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node5" [ label = "\"-lm\"", shape = septagon ];
+ "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
new file mode 100644
index 0000000000..65b7a71a49
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
new file mode 100644
index 0000000000..8116bc9819
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
@@ -0,0 +1,48 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
new file mode 100644
index 0000000000..1bbf25aba8
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
new file mode 100644
index 0000000000..439d1f76f8
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot
new file mode 100644
index 0000000000..81199a245a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot
@@ -0,0 +1,42 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
new file mode 100644
index 0000000000..1be6550164
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
@@ -0,0 +1,48 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
new file mode 100644
index 0000000000..1cfbe0f6b1
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "16"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
new file mode 100644
index 0000000000..9653c33028
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
@@ -0,0 +1,50 @@
+digraph "CMake Project Dependencies" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
new file mode 100644
index 0000000000..82d96d0771
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "point0" [ label = "CompilerFlags", shape = pentagon ];
+ "point1" [ label = "ConsoleApplication", shape = egg ];
+ "point2" [ label = "CoreLibrary", shape = octagon ];
+ "point2" -> "point0" // CoreLibrary -> CompilerFlags
+ "point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "point5" [ label = "GraphicApplication", shape = egg ];
+ "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "point6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "point7" [ label = "\"-lm\"", shape = septagon ];
+ "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "point6" -> "point0" // GraphicLibrary -> CompilerFlags
+ "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "point8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake
new file mode 100644
index 0000000000..f4a43b69b7
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake
@@ -0,0 +1,4 @@
+file(GLOB dependers_files ${RunCMake_TEST_BINARY_DIR}/*.dependers)
+if(${dependers_files})
+ set(RunCMake_TEST_FAILED "Found *.dependers files despite GRAPHVIZ_GENERATE_DEPENDERS set to FALSE.")
+endif()
diff --git a/Tests/RunCMake/Graphviz/no_executables-check.cmake b/Tests/RunCMake/Graphviz/no_executables-check.cmake
new file mode 100644
index 0000000000..be29a4f0a7
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_executables-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_executables.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_external_libs-check.cmake b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake
new file mode 100644
index 0000000000..518ef7b0cb
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_external_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake
new file mode 100644
index 0000000000..0f5aa477a2
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_graphic_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake
new file mode 100644
index 0000000000..018fef0190
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_interface_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_module_libs-check.cmake b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake
new file mode 100644
index 0000000000..e185cb1508
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_module_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_object_libs-check.cmake b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake
new file mode 100644
index 0000000000..90e7ecbf15
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_object_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake
new file mode 100644
index 0000000000..95d05a1be3
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake
@@ -0,0 +1,5 @@
+file(GLOB per_target_files ${RunCMake_TEST_BINARY_DIR}/*.dot.*)
+list(FILTER per_target_files EXCLUDE REGEX ".*\\.dependers$")
+if(per_target_files)
+ set(RunCMake_TEST_FAILED "Found per-target .dot files despite GRAPHVIZ_GENERATE_PER_TARGET set to FALSE.")
+endif()
diff --git a/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake
new file mode 100644
index 0000000000..b45da2e360
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_shared_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_static_libs-check.cmake b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake
new file mode 100644
index 0000000000..befc11b2bb
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_static_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake
new file mode 100644
index 0000000000..95286bc206
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_unknown_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_graph_header-check.cmake b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake
new file mode 100644
index 0000000000..13964847cd
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_header.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_graph_name-check.cmake b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake
new file mode 100644
index 0000000000..0c522e91d0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_name.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake
new file mode 100644
index 0000000000..61e9b243ef
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_node_prefix.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/test_project/core_library.c b/Tests/RunCMake/Graphviz/test_project/core_library.c
new file mode 100644
index 0000000000..e8a88447ea
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/core_library.c
@@ -0,0 +1,3 @@
+void log_something()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/graphic_library.c b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
new file mode 100644
index 0000000000..958c8abb2b
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
@@ -0,0 +1,3 @@
+void initialize_graphics()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/main.c b/Tests/RunCMake/Graphviz/test_project/main.c
new file mode 100644
index 0000000000..d123e0977a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/main.c
@@ -0,0 +1,4 @@
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/module.c b/Tests/RunCMake/Graphviz/test_project/module.c
new file mode 100644
index 0000000000..a508b09a55
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/module.c
@@ -0,0 +1,3 @@
+static void some_function()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt
new file mode 100644
index 0000000000..e381750dd5
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(ThirdPartyProject)
+
+add_library(GoofyLoggingLibrary INTERFACE)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt
new file mode 100644
index 0000000000..5253d3479e
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${CMAKE_CURRENT_LIST_DIR}/INSTALL_NAME_DIR.cmake)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake
new file mode 100644
index 0000000000..eaa0b456a6
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake
@@ -0,0 +1,15 @@
+function(add_install_name_dir_libraries install_name_dir)
+ add_library(build_dir SHARED test.c)
+ add_library(install_dir SHARED test.c)
+ if(NOT install_name_dir STREQUAL "NONE")
+ set_target_properties(build_dir install_dir PROPERTIES
+ INSTALL_NAME_DIR "${install_name_dir}"
+ )
+ endif()
+ set_target_properties(install_dir PROPERTIES
+ BUILD_WITH_INSTALL_NAME_DIR TRUE
+ )
+ install(TARGETS build_dir install_dir EXPORT InstallNameDirTest DESTINATION lib)
+ install(EXPORT InstallNameDirTest DESTINATION lib/cmake/InstallNameDirTest FILE InstallNameDirTest-targets.cmake)
+ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/targets.txt" CONTENT "$<TARGET_FILE:build_dir>\n$<TARGET_FILE:install_dir>\n" CONDITION $<CONFIG:Debug>)
+endfunction()
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake
new file mode 100644
index 0000000000..2aa03ddab3
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake
@@ -0,0 +1,69 @@
+cmake_minimum_required(VERSION 3.16)
+
+include(RunCMake)
+
+function(run_install_test case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/fake_install")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${case})
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${case}-install ${CMAKE_COMMAND} --install . --config Debug --prefix "${RunCMake_TEST_BINARY_DIR}/real_install")
+endfunction()
+
+find_program(OTOOL_COMMAND otool)
+
+function(check_install_name_dir file expected)
+ execute_process(COMMAND ${OTOOL_COMMAND} -l ${file} RESULT_VARIABLE _result OUTPUT_VARIABLE _output)
+ if(_result)
+ string(APPEND RunCMake_TEST_FAILED "Could not run otool on ${file}\n")
+ elseif(_output MATCHES "cmd LC_ID_DYLIB\n[^\n]*\n *name ([^\n]*) \\(offset [0-9]+\\)\n")
+ set(_install_name "${CMAKE_MATCH_1}")
+ if(NOT _install_name MATCHES "${expected}")
+ string(APPEND RunCMake_TEST_FAILED "Install name of ${file} did not match ${expected} (actual: ${_install_name})\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "otool did not print install name for ${file}\n")
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_imported_soname contents target expected)
+ if(contents MATCHES "set_target_properties\\(${target} PROPERTIES\n[^\n]*\n *IMPORTED_SONAME_DEBUG \"([^\n]*)\"\n")
+ set(_soname "${CMAKE_MATCH_1}")
+ set(_regex "^${expected}lib${target}\\.dylib$")
+ if(NOT _soname MATCHES "${_regex}")
+ string(APPEND RunCMake_TEST_FAILED "Target ${target}'s IMPORTED_SONAME_DEBUG did not match ${_regex} (actual: ${_soname})\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "Could not find IMPORTED_SONAME_DEBUG for target ${target} in package config file\n")
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_libraries fake_install real_install soname_prefix)
+ file(STRINGS "${RunCMake_TEST_BINARY_DIR}/targets.txt" _targets)
+ list(GET _targets 0 _build_dir)
+ list(GET _targets 1 _install_dir)
+ check_install_name_dir("${_build_dir}" "^@rpath/libbuild_dir\\.dylib$")
+ check_install_name_dir("${_install_dir}" "^${fake_install}libinstall_dir\\.dylib$")
+ check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libbuild_dir.dylib" "^${real_install}libbuild_dir\\.dylib$")
+ check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libinstall_dir.dylib" "^${real_install}libinstall_dir\\.dylib$")
+
+ file(READ "${RunCMake_TEST_BINARY_DIR}/real_install/lib/cmake/InstallNameDirTest/InstallNameDirTest-targets-debug.cmake" _targets)
+ check_imported_soname("${_targets}" build_dir "${soname_prefix}")
+ check_imported_soname("${_targets}" install_dir "${soname_prefix}")
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+run_install_test(none)
+run_install_test(empty)
+run_install_test(simple)
+run_install_test(simple_genex)
+run_install_test(prefix_genex)
+run_install_test(empty_genex)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake
new file mode 100644
index 0000000000..db87d2cb9d
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake
@@ -0,0 +1 @@
+check_libraries("" "" "")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake
new file mode 100644
index 0000000000..0cde4d1184
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries("")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake
new file mode 100644
index 0000000000..db87d2cb9d
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake
@@ -0,0 +1 @@
+check_libraries("" "" "")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake
new file mode 100644
index 0000000000..321c8d1ab9
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<0:/usr/local/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake
new file mode 100644
index 0000000000..c3e7ac4f72
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(@rpath/ @rpath/ @rpath/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake
new file mode 100644
index 0000000000..79c5e7d754
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries(NONE)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake
new file mode 100644
index 0000000000..8cf7db82d8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake
@@ -0,0 +1,6 @@
+check_libraries(
+ ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/fake_install/lib/"
+ ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/real_install/lib/"
+ # "$" has to be escaped twice because of its significance in regexes.
+ "\\\${_IMPORT_PREFIX}/lib/"
+ )
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake
new file mode 100644
index 0000000000..7e26208f53
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<1:$<INSTALL_PREFIX>/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake
new file mode 100644
index 0000000000..5f737cbfb8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake
new file mode 100644
index 0000000000..d0198750dc
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries(/usr/local/lib)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake
new file mode 100644
index 0000000000..5f737cbfb8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake
new file mode 100644
index 0000000000..1e729e86f8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<1:/usr/local/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/test.c b/Tests/RunCMake/INSTALL_NAME_DIR/test.c
new file mode 100644
index 0000000000..c2db61cc82
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/test.c
@@ -0,0 +1,3 @@
+void test(void)
+{
+}
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
index 4dddc96c8c..07deee2eaf 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
index a8b4756da1..b2395b30f3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
index 4dddc96c8c..07deee2eaf 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
index a8b4756da1..b2395b30f3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
index 00b2b3c111..52fedd314c 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
@@ -2,17 +2,17 @@
6
8
10
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of 10 exceeded
Call Stack \(most recent call first\):
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:9 \(set\)
.*/CMakeLists\.txt:5 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
index 8f27bf1c29..1427f1df99 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
@@ -2,17 +2,17 @@
6
8
10
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of 10 exceeded
Call Stack \(most recent call first\):
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:9 \(set\)
CMakeLists\.txt:5 \(include\)
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index da4d1e5322..cb20fb1f3d 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -146,6 +146,12 @@ function(run_cmake test)
"|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:"
"|Error kstat returned"
"|Hit xcodebuild bug"
+
+ "|LICENSE WARNING:"
+ "|Your license to use PGI[^\n]*expired"
+ "|Please obtain a new version at"
+ "|contact PGI Sales at"
+
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
"|[^\n]*is a member of multiple groups"
"|[^\n]*from Time Machine by path"
@@ -204,5 +210,28 @@ function(run_cmake_with_options test)
run_cmake(${test})
endfunction()
+function(ensure_files_match expected_file actual_file)
+ if(NOT EXISTS "${expected_file}")
+ message(FATAL_ERROR "Expected file does not exist:\n ${expected_file}")
+ endif()
+ if(NOT EXISTS "${actual_file}")
+ message(FATAL_ERROR "Actual file does not exist:\n ${actual_file}")
+ endif()
+ file(READ "${expected_file}" expected_file_content)
+ file(READ "${actual_file}" actual_file_content)
+ if(NOT "${expected_file_content}" STREQUAL "${actual_file_content}")
+ message(FATAL_ERROR "Actual file content does not match expected:\n
+ \n
+ expected file: ${expected_file}\n
+ expected content:\n
+ ${expected_file_content}\n
+ \n
+ actual file: ${actual_file}\n
+ actual content:\n
+ ${actual_file_content}\n
+ ")
+ endif()
+endfunction()
+
# Protect RunCMake tests from calling environment.
unset(ENV{MAKEFLAGS})
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index bee8c4e38f..0d462ba66c 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -1,6 +1,6 @@
include(RunCMake)
-if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+if(RunCMake_GENERATOR STREQUAL "Xcode")
run_cmake(ConfigNotAllowed)
endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
index fdd45bc83d..61419d866c 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
@@ -1,9 +1,9 @@
set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
-string(REGEX MATCH "\\/s[1-6].c" matched_files_1_6 ${unitybuild_c_strings})
-if(matched_files_1_6)
- set(RunCMake_TEST_FAILED "Generated unity contains s1.c -> s6.c which should have been skipped")
+string(REGEX MATCH "\\/s[2-6].c" matched_files_2_6 ${unitybuild_c_strings})
+if(matched_files_2_6)
+ set(RunCMake_TEST_FAILED "Generated unity contains s2.c -> s6.c which should have been skipped")
return()
endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake
index 74524ad274..eef8cccb1d 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake
@@ -1,7 +1,7 @@
project(unitybuild_skip C)
set(srcs "")
-foreach(s RANGE 1 8)
+foreach(s RANGE 2 8)
set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
list(APPEND srcs "${src}")
@@ -11,9 +11,6 @@ add_library(tgt SHARED ${srcs})
set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s1.c
- PROPERTIES GENERATED ON)
-
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s2.c
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 44ccd6b585..1487161335 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ run_cmake(VsDebuggerCommand)
run_cmake(VsDebuggerCommandArguments)
run_cmake(VsDebuggerEnvironment)
run_cmake(VsCSharpCustomTags)
+run_cmake(VsCSharpDocumentationFile)
run_cmake(VsCSharpReferenceProps)
run_cmake(VsCSharpWithoutSources)
run_cmake(VsCSharpDeployFiles)
@@ -28,6 +29,10 @@ run_cmake(VsDpiAwareBadParam)
run_cmake(VsPrecompileHeaders)
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
+set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)")
+run_cmake(VsVCTargetsPath)
+unset(RunCMake_GENERATOR_TOOLSET)
+
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
run_cmake(VsJustMyCode)
endif()
diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
index 655120adfe..ee0c4120c0 100644
--- a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
+++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
@@ -13,6 +13,7 @@ include(${RunCMake_TEST_SOURCE_DIR}/SourceGroupHelpers.cmake)
set(SOURCE_GROUPS_TO_FIND
"Dir"
"Dir\\DirNested"
+ "Generated"
"SourcesPrefix"
"SourcesPrefix\\PrefixedNested"
)
diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake
index 83c87a9d8d..7655e60944 100644
--- a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake
+++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake
@@ -1,16 +1,45 @@
set(CMAKE_CONFIGURATION_TYPES Debug)
+# Test regular tree grouping.
set(SRC_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Dir/foo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Dir/DirNested/foo_nested.cpp
)
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES})
+
+
+# Test files that are not present at configuration time.
+set(GENERATED_SRC_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/Generated/generated.cpp
+)
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Generated)
+
+if(WIN32)
+ add_custom_command(OUTPUT ${GENERATED_SRC_FILES}
+ COMMAND echo. 2>${CMAKE_CURRENT_BINARY_DIR}\\Generated\\generated.cpp
+ )
+else()
+ add_custom_command(OUTPUT ${GENERATED_SRC_FILES}
+ COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/Generated/generated.cpp
+ )
+endif()
+
+source_group(TREE ${CMAKE_CURRENT_BINARY_DIR} FILES ${GENERATED_SRC_FILES})
+
+
+# Test prefixed tree grouping.
set(PREFIXED_SRC_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Prefixed/bar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Prefixed/PrefixedNested/bar_nested.cpp
)
-add_custom_target(SourceGroupTree SOURCES ${SRC_FILES} ${PREFIXED_SRC_FILES})
+add_custom_target(SourceGroupTree
+ SOURCES
+ ${SRC_FILES}
+ ${GENERATED_SRC_FILES}
+ ${PREFIXED_SRC_FILES}
+)
-source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed PREFIX SourcesPrefix FILES ${PREFIXED_SRC_FILES})
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
new file mode 100644
index 0000000000..0393362d62
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
@@ -0,0 +1,26 @@
+#
+# Check C# VS project for required elements
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+file(STRINGS "${csProjectFile}" lines)
+
+set(HAVE_DocumentationFile 0)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<DocumentationFile>([^<>]+)</DocumentationFile>")
+ if(HAVE_DocumentationFile)
+ set(RunCMake_TEST_FAILED "Documentation node has been generated more than once for\n ${csProjectFile}")
+ return()
+ endif()
+ set(HAVE_DocumentationFile 1)
+ endif()
+endforeach()
+
+if(NOT HAVE_DocumentationFile)
+ set(RunCMake_TEST_FAILED "Documentation node has not been generated for\n ${csProjectFile}")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
new file mode 100644
index 0000000000..83b6b97065
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
@@ -0,0 +1,8 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(CSharp)
+
+add_library(foo SHARED
+ foo.cs)
+
+set_target_properties(foo PROPERTIES
+ VS_DOTNET_DOCUMENTATION_FILE foo.xml)
diff --git a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
index 0e7fd45c10..6a300991dd 100644
--- a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
@@ -1,44 +1,65 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
- set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
- return()
-endif()
+macro(check_project_file projectFile)
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile})
-set(InsideGlobals FALSE)
-set(DefaultLanguageSet FALSE)
-set(MinimumVisualStudioVersionSet FALSE)
+ set(InsideGlobals FALSE)
+ set(DefaultLanguageSet FALSE)
+ set(MinimumVisualStudioVersionSet FALSE)
+ set(TestPropertySet FALSE)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<PropertyGroup Label=\"Globals\"> *$")
- set(InsideGlobals TRUE)
- elseif(line MATCHES "^ *<DefaultLanguage>([a-zA-Z\\-]+)</DefaultLanguage> *$")
- if("${CMAKE_MATCH_1}" STREQUAL "en-US")
- if(InsideGlobals)
- message(STATUS "foo.vcxproj has correct DefaultLanguage global property")
- set(DefaultLanguageSet TRUE)
- else()
- message(STATUS "DefaultLanguage is set but not within \"Globals\" property group")
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<PropertyGroup Label=\"Globals\"> *$")
+ set(InsideGlobals TRUE)
+ elseif(line MATCHES "^ *<DefaultLanguage>([a-zA-Z\\-]+)</DefaultLanguage> *$")
+ if("${CMAKE_MATCH_1}" STREQUAL "en-US")
+ if(InsideGlobals)
+ message(STATUS "${projectName} has correct DefaultLanguage global property")
+ set(DefaultLanguageSet TRUE)
+ else()
+ message(STATUS "DefaultLanguage is set but not within \"Globals\" property group")
+ endif()
endif()
- endif()
- elseif(line MATCHES "^ *<MinimumVisualStudioVersion>([0-9\\.]+)</MinimumVisualStudioVersion> *$")
- if("${CMAKE_MATCH_1}" STREQUAL "14.0")
- if(InsideGlobals)
- message(STATUS "foo.vcxproj has correct MinimumVisualStudioVersion global property")
- set(MinimumVisualStudioVersionSet TRUE)
- else()
- message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group")
+ elseif(line MATCHES "^ *<MinimumVisualStudioVersion>([0-9\\.]+)</MinimumVisualStudioVersion> *$")
+ if("${CMAKE_MATCH_1}" STREQUAL "10.0")
+ if(InsideGlobals)
+ message(STATUS "${projectName} has correct MinimumVisualStudioVersion global property")
+ set(MinimumVisualStudioVersionSet TRUE)
+ else()
+ message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group")
+ endif()
+ endif()
+ elseif(line MATCHES "^ *<TestProperty>(.+)</TestProperty> *$")
+ if("${CMAKE_MATCH_1}" STREQUAL "TestValue")
+ if(InsideGlobals)
+ message(STATUS "${projectName} has correct TestProperty global property")
+ set(TestPropertySet TRUE)
+ else()
+ message(STATUS "TestProperty is set but not within \"Globals\" property group")
+ endif()
endif()
endif()
+ endforeach()
+
+ if(NOT DefaultLanguageSet)
+ set(RunCMake_TEST_FAILED "DefaultLanguage not found or not set correctly in ${projectName}.")
+ return()
+ endif()
+
+ if(NOT MinimumVisualStudioVersionSet)
+ set(RunCMake_TEST_FAILED "MinimumVisualStudioVersion not found or not set correctly in ${projectName}.")
+ return()
endif()
-endforeach()
-if(NOT DefaultLanguageSet)
- set(RunCMake_TEST_FAILED "DefaultLanguageSet not found or not set correctly.")
- return()
-endif()
+ if(NOT TestPropertySet)
+ set(RunCMake_TEST_FAILED "TestProperty not found or not set correctly in ${projectName}.")
+ return()
+ endif()
+endmacro()
-if(NOT MinimumVisualStudioVersionSet)
- set(RunCMake_TEST_FAILED "MinimumVisualStudioVersionSet not found or not set correctly.")
- return()
-endif()
+check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj")
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsGlobals.cmake b/Tests/RunCMake/VS10Project/VsGlobals.cmake
index a3ed5afa9b..09d806dfb2 100644
--- a/Tests/RunCMake/VS10Project/VsGlobals.cmake
+++ b/Tests/RunCMake/VS10Project/VsGlobals.cmake
@@ -1,8 +1,9 @@
-enable_language(CXX)
-
set(CMAKE_VS_GLOBALS
"DefaultLanguage=en-US"
- "MinimumVisualStudioVersion=14.0"
+ "MinimumVisualStudioVersion=10.0"
+ "TestProperty=TestValue"
)
+enable_language(CXX)
+
add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake
new file mode 100644
index 0000000000..5b1701c85c
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake
@@ -0,0 +1,32 @@
+macro(check_project_file projectFile)
+ set(insideGlobals FALSE)
+ set(pathFound FALSE)
+
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile})
+
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<PropertyGroup Label=\"Globals\">.*$")
+ set(insideGlobals TRUE)
+ elseif(insideGlobals)
+ if(line MATCHES "^ *</PropertyGroup>.*$")
+ set(insideGlobals FALSE)
+ elseif(line MATCHES "^ *<VCTargetsPath>(.+)</VCTargetsPath>*$")
+ message(STATUS "Found VCTargetsPath = ${CMAKE_MATCH_1} in PropertyGroup 'Globals' in ${projectName}")
+ set(pathFound TRUE)
+ endif()
+ endif()
+ endforeach()
+ if(NOT pathFound)
+ set(RunCMake_TEST_FAILED "VCTargetsPath not found in \"Globals\" propertygroup in ${projectName}")
+ return() # This should intentionally return from the caller, not the macro
+ endif()
+endmacro()
+
+check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj")
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake
new file mode 100644
index 0000000000..6a6088f9e3
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+
+add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake
new file mode 100644
index 0000000000..c6bbc1be18
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake
@@ -0,0 +1,20 @@
+set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ImplicitCMakeLists.xcodeproj/project.pbxproj")
+if(NOT EXISTS "${xcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
+ return()
+endif()
+
+set(foundCMakeLists 0)
+file(STRINGS "${xcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "PBXFileReference.*CMakeLists.txt")
+ if(foundCMakeLists)
+ set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times")
+ return()
+ endif()
+ set(foundCMakeLists 1)
+ endif()
+endforeach()
+if(NOT foundCMakeLists)
+ set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 1dfa8b2bd3..9e828415b6 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,6 +1,7 @@
include(RunCMake)
run_cmake(ExplicitCMakeLists)
+run_cmake(ImplicitCMakeLists)
run_cmake(XcodeFileType)
run_cmake(XcodeAttributeLocation)
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake
index 4b74cfe493..0f1fdd47d8 100644
--- a/Tests/RunCMake/foreach/RunCMakeTest.cmake
+++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(BadRangeInFunction)
+run_cmake(foreach-all-test)
diff --git a/Tests/RunCMake/foreach/foreach-all-test-stdout.txt b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt
new file mode 100644
index 0000000000..e8f622d6ee
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt
@@ -0,0 +1,44 @@
+-- foreach\(RANGE\):
+-- \[0\.\.1\]/1
+-- < 0
+-- < 1
+-- \[1\.\.1\]/1
+-- < 1
+-- \[0\.\.10\]/2
+-- < 0
+-- < 2
+-- < 4
+-- < 6
+-- < 8
+-- < 10
+-- \[-10\.\.0\]/3
+-- < -10
+-- < -7
+-- < -4
+-- < -1
+-- \[0\.\.-10\]/-5
+-- < 0
+-- < -5
+-- < -10
+-- foreach\(IN ITEMS\):
+-- < one
+-- < two
+-- < three
+-- foreach\(IN LISTS\):
+-- < satu
+-- < dua
+-- < tiga
+-- foreach\(IN LISTS and ITEMS\):
+-- < satu
+-- < dua
+-- < tiga
+-- < one
+-- < two
+-- < three
+-- foreach\(IN ITEMS and LISTS\):
+-- < one
+-- < two
+-- < three
+-- < satu
+-- < dua
+-- < tiga
diff --git a/Tests/RunCMake/foreach/foreach-all-test.cmake b/Tests/RunCMake/foreach/foreach-all-test.cmake
new file mode 100644
index 0000000000..2e377c8028
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-all-test.cmake
@@ -0,0 +1,67 @@
+message(STATUS "foreach(RANGE):")
+list(APPEND CMAKE_MESSAGE_INDENT " ")
+
+message(STATUS "[0..1]/1")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 1)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[1..1]/1")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 1 1)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[0..10]/2")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 0 10 2)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[-10..0]/3")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE -10 0 3)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[0..-10]/-5")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 0 -10 -5)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN ITEMS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i IN ITEMS one two three)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+list(APPEND count satu dua tiga)
+foreach(i IN LISTS count)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN LISTS and ITEMS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i IN LISTS count ITEMS one two three)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN ITEMS and LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i IN ITEMS one two three LISTS count)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
index 9198a25f6e..0313ed1b13 100644
--- a/Tests/RunCMake/message/RunCMakeTest.cmake
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -5,6 +5,15 @@ run_cmake(nomessage)
run_cmake(message-internal-warning)
run_cmake(nomessage-internal-warning)
run_cmake(warnmessage)
+
+# Have to explicitly give the command for the working dir to be honoured
+set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY /)
+run_cmake_command(
+ warnmessage-rootdir
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/warnmessage-rootdir.cmake
+ )
+unset(RunCMake_TEST_COMMAND_WORKING_DIRECTORY)
+
# message command sets fatal occurred flag, so check each type of error
# separately
@@ -56,6 +65,11 @@ foreach(opt IN ITEMS loglevel log-level)
endforeach()
run_cmake_command(
+ message-log-level-override
+ ${CMAKE_COMMAND} --log-level=debug -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+
+run_cmake_command(
message-indent
${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent.cmake
)
@@ -63,3 +77,23 @@ run_cmake_command(
message-indent-multiline
${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent-multiline.cmake
)
+
+run_cmake_command(
+ message-context-cli
+ ${CMAKE_COMMAND} --log-level=trace --log-context -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+ )
+
+run_cmake_command(
+ message-context-cache
+ ${CMAKE_COMMAND} -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -DCMAKE_MESSAGE_CONTEXT_SHOW=ON -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+ )
+
+run_cmake_command(
+ message-context-cli-wins-cache
+ ${CMAKE_COMMAND} --log-level=verbose --log-context -DCMAKE_MESSAGE_CONTEXT_SHOW=OFF -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+ )
+
+run_cmake_command(
+ message-checks
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-checks.cmake
+ )
diff --git a/Tests/RunCMake/message/message-checks-stderr.txt b/Tests/RunCMake/message/message-checks-stderr.txt
new file mode 100644
index 0000000000..fdacdb2a22
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-checks.cmake:13 \(message\):
+ Ignored CHECK_FAIL without CHECK_START
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/message/message-checks-stdout.txt b/Tests/RunCMake/message/message-checks-stdout.txt
new file mode 100644
index 0000000000..4f5f2ef3b1
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stdout.txt
@@ -0,0 +1,10 @@
+-- Find `libfoo`
+-- Looking for `libfoo\.h`
+-- Looking for `libfoo\.h` - found \[/usr/include\]
+-- Looking for `libfoo\.so`
+-- Looking for `libfoo\.so` - found \[/usr/lib/libfoo\.so\]
+-- Getting `libfoo` version
+-- Looking for `libfoo/version\.h`
+-- Looking for `libfoo/version\.h` - found
+-- Getting `libfoo` version - 1\.2\.3
+-- Find `libfoo` - required version 4\.5\.6 but found 1\.2\.3
diff --git a/Tests/RunCMake/message/message-checks.cmake b/Tests/RunCMake/message/message-checks.cmake
new file mode 100644
index 0000000000..605846e7be
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks.cmake
@@ -0,0 +1,13 @@
+message(CHECK_START "Find `libfoo`")
+message(CHECK_START "Looking for `libfoo.h`")
+message(CHECK_PASS "found [/usr/include]")
+message(CHECK_START "Looking for `libfoo.so`")
+message(CHECK_PASS "found [/usr/lib/libfoo.so]")
+message(CHECK_START "Getting `libfoo` version")
+message(CHECK_START "Looking for `libfoo/version.h`")
+message(CHECK_PASS "found")
+message(CHECK_PASS "1.2.3")
+message(CHECK_FAIL "required version 4.5.6 but found 1.2.3")
+
+# Should generate an error, no associated CHECK_START
+message(CHECK_FAIL "unmatched check fail case")
diff --git a/Tests/RunCMake/message/message-context-cache-stdout.txt b/Tests/RunCMake/message/message-context-cache-stdout.txt
new file mode 100644
index 0000000000..af18c15d28
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cache-stdout.txt
@@ -0,0 +1,8 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\.foo\] foo TRACE message
+-- \[top\.foo\.baz\] This is the multi-line
+\[top\.foo\.baz\] baz DEBUG message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context-cli-stdout.txt b/Tests/RunCMake/message/message-context-cli-stdout.txt
new file mode 100644
index 0000000000..af18c15d28
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cli-stdout.txt
@@ -0,0 +1,8 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\.foo\] foo TRACE message
+-- \[top\.foo\.baz\] This is the multi-line
+\[top\.foo\.baz\] baz DEBUG message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt
new file mode 100644
index 0000000000..157db97d11
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt
@@ -0,0 +1,5 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context.cmake b/Tests/RunCMake/message/message-context.cmake
new file mode 100644
index 0000000000..93d4cd9114
--- /dev/null
+++ b/Tests/RunCMake/message/message-context.cmake
@@ -0,0 +1,27 @@
+function(bar)
+ list(APPEND CMAKE_MESSAGE_CONTEXT "bar")
+ list(APPEND CMAKE_MESSAGE_INDENT "<-- indent -->")
+ message(VERBOSE "bar VERBOSE message")
+endfunction()
+
+function(baz)
+ list(APPEND CMAKE_MESSAGE_CONTEXT "baz")
+ message(DEBUG "This is the multi-line\nbaz DEBUG message")
+endfunction()
+
+function(foo)
+ list(APPEND CMAKE_MESSAGE_CONTEXT "foo")
+ bar()
+ message(TRACE "foo TRACE message")
+ baz()
+endfunction()
+
+message(STATUS "Begin context output test")
+list(APPEND CMAKE_MESSAGE_CONTEXT "top")
+
+message(STATUS "Top: before")
+foo()
+message(STATUS "Top: after")
+
+list(POP_BACK CMAKE_MESSAGE_CONTEXT)
+message(STATUS "End of context output test")
diff --git a/Tests/RunCMake/message/message-log-level-debug-stdout.txt b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
index 1452137036..feee110915 100644
--- a/Tests/RunCMake/message/message-log-level-debug-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
@@ -1,3 +1,3 @@
-- STATUS message
-- VERBOSE message
--- DEBUG message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-log-level-default-stdout.txt b/Tests/RunCMake/message/message-log-level-default-stdout.txt
index 809f4cc4a4..b5d6acbd8f 100644
--- a/Tests/RunCMake/message/message-log-level-default-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-default-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-log-level-override-stderr.txt b/Tests/RunCMake/message/message-log-level-override-stderr.txt
new file mode 100644
index 0000000000..efec736fe6
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-override-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:2 \(message\):
+ Deprecation warning
++
+CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:3 \(message\):
+ Author warning message
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+CMake Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:4 \(message\):
+ Warning message
++
+Default NOTICE message
+NOTICE message$
diff --git a/Tests/RunCMake/message/message-log-level-override-stdout.txt b/Tests/RunCMake/message/message-log-level-override-stdout.txt
new file mode 100644
index 0000000000..feee110915
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-override-stdout.txt
@@ -0,0 +1,3 @@
+-- STATUS message
+-- VERBOSE message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-log-level-status-stdout.txt b/Tests/RunCMake/message/message-log-level-status-stdout.txt
index 809f4cc4a4..b5d6acbd8f 100644
--- a/Tests/RunCMake/message/message-log-level-status-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-status-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-log-level-trace-stdout.txt b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
index 1cfce6f11c..3d36a7fe98 100644
--- a/Tests/RunCMake/message/message-log-level-trace-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
@@ -1,4 +1,4 @@
-- STATUS message
-- VERBOSE message
-- DEBUG message
--- TRACE message
+-- TRACE message$
diff --git a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
index c15d43fc49..47c0846f4b 100644
--- a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
@@ -1,2 +1,2 @@
-- STATUS message
--- VERBOSE message
+-- VERBOSE message$
diff --git a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
index 1452137036..feee110915 100644
--- a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
@@ -1,3 +1,3 @@
-- STATUS message
-- VERBOSE message
--- DEBUG message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-loglevel-default-stdout.txt b/Tests/RunCMake/message/message-loglevel-default-stdout.txt
index 809f4cc4a4..b5d6acbd8f 100644
--- a/Tests/RunCMake/message/message-loglevel-default-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-default-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-loglevel-status-stdout.txt b/Tests/RunCMake/message/message-loglevel-status-stdout.txt
index 809f4cc4a4..b5d6acbd8f 100644
--- a/Tests/RunCMake/message/message-loglevel-status-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-status-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
index 1cfce6f11c..3d36a7fe98 100644
--- a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
@@ -1,4 +1,4 @@
-- STATUS message
-- VERBOSE message
-- DEBUG message
--- TRACE message
+-- TRACE message$
diff --git a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
index c15d43fc49..47c0846f4b 100644
--- a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
@@ -1,2 +1,2 @@
-- STATUS message
--- VERBOSE message
+-- VERBOSE message$
diff --git a/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt b/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt
new file mode 100644
index 0000000000..19d93989a6
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt
@@ -0,0 +1 @@
+We expect to see this warning message
diff --git a/Tests/RunCMake/message/warnmessage-rootdir.cmake b/Tests/RunCMake/message/warnmessage-rootdir.cmake
new file mode 100644
index 0000000000..f82efb909b
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage-rootdir.cmake
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.15)
+
+# Generating the backtrace for this warning message used to trigger a
+# spurious assertion when the current directory is the root directory
+message(WARNING "We expect to see this warning message")
diff --git a/Tests/RunCMake/try_compile/ObjCStandard-result.txt b/Tests/RunCMake/try_compile/ObjCStandard-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCStandard-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/ObjCStandard-stderr.txt b/Tests/RunCMake/try_compile/ObjCStandard-stderr.txt
new file mode 100644
index 0000000000..f1b4df9e02
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCStandard-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Tests/RunCMake/try_compile/ObjCStandard-build/CMakeFiles/CMakeTmp/CMakeLists.txt:[0-9]+ \(add_executable\):
+ OBJC_STANDARD is set to invalid value '3'
++
+CMake Error at ObjCStandard.cmake:[0-9]+ \(try_compile\):
+ Failed to generate test project build system.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/try_compile/ObjCStandard.cmake b/Tests/RunCMake/try_compile/ObjCStandard.cmake
new file mode 100644
index 0000000000..b2066f9575
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCStandard.cmake
@@ -0,0 +1,7 @@
+enable_language(OBJC)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.m
+ OBJC_STANDARD 3
+ OUTPUT_VARIABLE out
+ )
+message("try_compile output:\n${out}")
diff --git a/Tests/RunCMake/try_compile/ObjCxxStandard-result.txt b/Tests/RunCMake/try_compile/ObjCxxStandard-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCxxStandard-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt b/Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt
new file mode 100644
index 0000000000..a2f91b48f4
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Tests/RunCMake/try_compile/ObjCxxStandard-build/CMakeFiles/CMakeTmp/CMakeLists.txt:[0-9]+ \(add_executable\):
+ OBJCXX_STANDARD is set to invalid value '3'
++
+CMake Error at ObjCxxStandard.cmake:[0-9]+ \(try_compile\):
+ Failed to generate test project build system.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/try_compile/ObjCxxStandard.cmake b/Tests/RunCMake/try_compile/ObjCxxStandard.cmake
new file mode 100644
index 0000000000..1221805c0d
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCxxStandard.cmake
@@ -0,0 +1,7 @@
+enable_language(OBJCXX)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.mm
+ OBJCXX_STANDARD 3
+ OUTPUT_VARIABLE out
+ )
+message("try_compile output:\n${out}")
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 77fb7a0f35..91f014e4d2 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -37,11 +37,17 @@ if(CMAKE_C_STANDARD_DEFAULT)
elseif(DEFINED CMAKE_C_STANDARD_DEFAULT)
run_cmake(CStandardNoDefault)
endif()
+if(CMAKE_OBJC_STANDARD_DEFAULT)
+ run_cmake(ObjCStandard)
+endif()
if(CMAKE_CXX_STANDARD_DEFAULT)
run_cmake(CxxStandard)
elseif(DEFINED CMAKE_CXX_STANDARD_DEFAULT)
run_cmake(CxxStandardNoDefault)
endif()
+if(CMAKE_OBJCXX_STANDARD_DEFAULT)
+ run_cmake(ObjCxxStandard)
+endif()
if(CMake_TEST_CUDA)
if(CMAKE_HOST_WIN32)
run_cmake(CudaStandardNoDefault)
diff --git a/Tests/RunCMake/try_compile/src.m b/Tests/RunCMake/try_compile/src.m
new file mode 100644
index 0000000000..f8b643afbf
--- /dev/null
+++ b/Tests/RunCMake/try_compile/src.m
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/try_compile/src.mm b/Tests/RunCMake/try_compile/src.mm
new file mode 100644
index 0000000000..f8b643afbf
--- /dev/null
+++ b/Tests/RunCMake/try_compile/src.mm
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 498e5562db..9ec9b70fdd 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -365,6 +365,25 @@ if (APPLE)
TEST_ASSERT(SIMPLE_OBJCXX_RUN_SHOULD_WORK "CHECK_OBJCXX_SOURCE_RUNS() failed, but should have succeeded")
TEST_FAIL(OBJCXX_RUN_SHOULD_FAIL "CHECK_OBJCXX_SOURCE_RUNS() succeeds, but should have failed")
TEST_ASSERT(OBJCXX_RUN_SHOULD_WORK "CHECK_OBJCXX_SOURCE_RUNS() failed, but should have succeeded")
+
+ # try to compile a file that should compile
+ try_compile(SHOULD_PASS
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/pass.m
+ OUTPUT_VARIABLE TRY_OUT)
+ if(NOT SHOULD_PASS)
+ message(SEND_ERROR "should pass failed ${TRY_OUT}")
+ endif()
+
+ # try to compile a file that should not compile
+ try_compile(SHOULD_FAIL
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/fail.m
+ OUTPUT_VARIABLE TRY_OUT)
+ if(SHOULD_FAIL)
+ message(SEND_ERROR "Should fail passed ${TRY_OUT}")
+ endif()
+
endif()
#######################################################################
diff --git a/Tests/TryCompile/fail.m b/Tests/TryCompile/fail.m
new file mode 100644
index 0000000000..b915ebe4cb
--- /dev/null
+++ b/Tests/TryCompile/fail.m
@@ -0,0 +1 @@
+asdflkjasdlj
diff --git a/Tests/TryCompile/pass.m b/Tests/TryCompile/pass.m
new file mode 100644
index 0000000000..f8b643afbf
--- /dev/null
+++ b/Tests/TryCompile/pass.m
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}