diff options
Diffstat (limited to 'Tests')
151 files changed, 6786 insertions, 74 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8b5f2e9..408c941 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1441,6 +1441,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindODBC) endif() + if(CMake_TEST_FindOctave) + add_subdirectory(FindOctave) + endif() + if(CMake_TEST_FindOpenCL) add_subdirectory(FindOpenCL) endif() diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in index 566f4b1..154afa7 100644 --- a/Tests/CMakeTests/StringTest.cmake.in +++ b/Tests/CMakeTests/StringTest.cmake.in @@ -81,7 +81,7 @@ check_cmake_test(String # Execute each test listed in StringTestScript.cmake: # set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake") -set(number_of_tests_expected 70) +set(number_of_tests_expected 74) include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake") execute_all_script_tests(${scriptname} number_of_tests_executed) diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 44d5653..e069897 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -1,5 +1,18 @@ message(STATUS "testname='${testname}'") +function(test_configure_line_number EXPRESSION POLICY) + cmake_policy(PUSH) + cmake_policy(SET CMP0053 ${POLICY}) + string(CONFIGURE + "${EXPRESSION}" v) # line should indicate string() call + math(EXPR vplus3 "${v} + 3") + if(NOT ${CMAKE_CURRENT_LIST_LINE} EQUAL ${vplus3}) + message(SEND_ERROR "Couldn't configure CMAKE_CURRENT_LIST_LINE, evaluated into '${v}'") + endif() + message(STATUS "v='${v}'") + cmake_policy(POP) +endfunction() + if(testname STREQUAL empty) # fail string() @@ -32,6 +45,18 @@ elseif(testname STREQUAL configure_escape_quotes) # pass string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES) message(STATUS "v='${v}'") +elseif(testname STREQUAL configure_line_number_CMP0053_old) # pass + test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" OLD) + +elseif(testname STREQUAL configure_line_number_CMP0053_new) # pass + test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" NEW) + +elseif(testname STREQUAL configure_line_number_CMP0053_old_use_at) # pass + test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" OLD) + +elseif(testname STREQUAL configure_line_number_CMP0053_new_use_at) # pass + test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" NEW) + elseif(testname STREQUAL configure_bogus) # fail string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES BOGUS) diff --git a/Tests/CTestTestBadExe/CTestConfig.cmake b/Tests/CTestTestBadExe/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestBadExe/CTestConfig.cmake +++ b/Tests/CTestTestBadExe/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestBadGenerator/CTestConfig.cmake b/Tests/CTestTestBadGenerator/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestBadGenerator/CTestConfig.cmake +++ b/Tests/CTestTestBadGenerator/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCostSerial/CTestConfig.cmake b/Tests/CTestTestCostSerial/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestCostSerial/CTestConfig.cmake +++ b/Tests/CTestTestCostSerial/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCrash/CTestConfig.cmake b/Tests/CTestTestCrash/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestCrash/CTestConfig.cmake +++ b/Tests/CTestTestCrash/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCycle/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestCycle/CTestConfig.cmake +++ b/Tests/CTestTestCycle/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestDepends/CTestConfig.cmake +++ b/Tests/CTestTestDepends/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestFailure/CTestConfig.cmake b/Tests/CTestTestFailure/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestFailure/CTestConfig.cmake +++ b/Tests/CTestTestFailure/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake index 409d83a..c08eded 100644 --- a/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake @@ -1,7 +1,5 @@ set(CTEST_USE_LAUNCHERS 1) set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake index 409d83a..c08eded 100644 --- a/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake @@ -1,7 +1,5 @@ set(CTEST_USE_LAUNCHERS 1) set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake index 409d83a..c08eded 100644 --- a/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake @@ -1,7 +1,5 @@ set(CTEST_USE_LAUNCHERS 1) set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestParallel/CTestConfig.cmake b/Tests/CTestTestParallel/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestParallel/CTestConfig.cmake +++ b/Tests/CTestTestParallel/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestResourceLock/CTestConfig.cmake b/Tests/CTestTestResourceLock/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestResourceLock/CTestConfig.cmake +++ b/Tests/CTestTestResourceLock/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestScheduler/CTestConfig.cmake b/Tests/CTestTestScheduler/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestScheduler/CTestConfig.cmake +++ b/Tests/CTestTestScheduler/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake +++ b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestStopTime/CTestConfig.cmake b/Tests/CTestTestStopTime/CTestConfig.cmake index fc5bffc..5bc1e9e 100644 --- a/Tests/CTestTestStopTime/CTestConfig.cmake +++ b/Tests/CTestTestStopTime/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestSubdir/CTestConfig.cmake b/Tests/CTestTestSubdir/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestSubdir/CTestConfig.cmake +++ b/Tests/CTestTestSubdir/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestTimeout/CTestConfig.cmake b/Tests/CTestTestTimeout/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestTimeout/CTestConfig.cmake +++ b/Tests/CTestTestTimeout/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestUpload/CTestConfig.cmake b/Tests/CTestTestUpload/CTestConfig.cmake index 95c79ff..21318b4 100644 --- a/Tests/CTestTestUpload/CTestConfig.cmake +++ b/Tests/CTestTestUpload/CTestConfig.cmake @@ -1,6 +1,4 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set (CTEST_DROP_METHOD "http") set (CTEST_DROP_SITE "open.cdash.org") set (CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set (CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestVerboseOutput/CTestConfig.cmake b/Tests/CTestTestVerboseOutput/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestVerboseOutput/CTestConfig.cmake +++ b/Tests/CTestTestVerboseOutput/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake index faa91f0..bd265f9 100644 --- a/Tests/CTestTestZeroTimeout/CTestConfig.cmake +++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake @@ -1,6 +1,4 @@ set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/FindCURL/Test/CMakeLists.txt b/Tests/FindCURL/Test/CMakeLists.txt index c3c719b..cbf2866 100644 --- a/Tests/FindCURL/Test/CMakeLists.txt +++ b/Tests/FindCURL/Test/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10) project(TestFindCURL C) include(CTest) -find_package(CURL REQUIRED) +find_package(CURL REQUIRED COMPONENTS HTTP) add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}") diff --git a/Tests/FindOctave/CMakeLists.txt b/Tests/FindOctave/CMakeLists.txt new file mode 100644 index 0000000..1acc966 --- /dev/null +++ b/Tests/FindOctave/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindOctave.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindOctave/Test" + "${CMake_BINARY_DIR}/Tests/FindOctave/Test" + ${build_generator_args} + --build-project TestFindOctave + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindOctave/Test/CMakeLists.txt b/Tests/FindOctave/Test/CMakeLists.txt new file mode 100644 index 0000000..ce33fcd --- /dev/null +++ b/Tests/FindOctave/Test/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.3) +project(TestFindOctave CXX) +enable_testing() + +find_package(Octave REQUIRED COMPONENTS Development Interpreter) + +add_definitions(-DCMAKE_EXPECTED_Octave_VERSION=${Octave_VERSION}) + +add_executable(test_tgt main.cpp) +target_link_libraries(test_tgt Octave::Octave) +add_test(NAME test_tgt COMMAND test_tgt) + +add_test(NAME test_tgt_exe + COMMAND Octave::Interpreter -q --eval "runtests('.')" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_executable(test_var main.cpp) +target_include_directories(test_var PRIVATE ${Octave_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${Octave_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindOctave/Test/main.cpp b/Tests/FindOctave/Test/main.cpp new file mode 100644 index 0000000..68270b1 --- /dev/null +++ b/Tests/FindOctave/Test/main.cpp @@ -0,0 +1,18 @@ +#include <iostream> +#include <oct.h> + +// http://www.dm.unibo.it/~achilles/calc/octave.html/Standalone-Programs.html +int main(void) +{ + int n = 2; + Matrix a_matrix = Matrix(n, n); + for (octave_idx_type i = 0; i < n; i++) { + for (octave_idx_type j = 0; j < n; j++) { + a_matrix(i, j) = (i + 1) * 10 + (j + 1); + } + } + + std::cout << a_matrix << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Tests/FindOctave/Test/testtrue.m b/Tests/FindOctave/Test/testtrue.m new file mode 100644 index 0000000..0c28a9e --- /dev/null +++ b/Tests/FindOctave/Test/testtrue.m @@ -0,0 +1 @@ +%!assert(true) diff --git a/Tests/FindThreads/C-only/CMakeLists.txt b/Tests/FindThreads/C-only/CMakeLists.txt index ab4ca0d..ee2a5f9 100644 --- a/Tests/FindThreads/C-only/CMakeLists.txt +++ b/Tests/FindThreads/C-only/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR) project(FindThreads_C-only C) -set(CMAKE_THREAD_PREFER_PTHREAD On) find_package(Threads REQUIRED) if (NOT WIN32) diff --git a/Tests/FindThreads/CXX-only/CMakeLists.txt b/Tests/FindThreads/CXX-only/CMakeLists.txt index 9993123..3c6cc1e 100644 --- a/Tests/FindThreads/CXX-only/CMakeLists.txt +++ b/Tests/FindThreads/CXX-only/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR) project(FindThreads_CXX-only CXX) -set(CMAKE_THREAD_PREFER_PTHREAD On) find_package(Threads REQUIRED) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake index 096d5e3..c53fb4f 100644 --- a/Tests/QtAutogen/Tests.cmake +++ b/Tests/QtAutogen/Tests.cmake @@ -39,7 +39,8 @@ endif() # Qt5 only tests if(QT_TEST_VERSION GREATER 4) ADD_AUTOGEN_TEST(MocMacroName mocMacroName) - ADD_AUTOGEN_TEST(MocOsMacros) + # Disabled for issue #18669 + #ADD_AUTOGEN_TEST(MocOsMacros) ADD_AUTOGEN_TEST(RerunMocPlugin) if(APPLE) ADD_AUTOGEN_TEST(MacOsFW) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b044757..67fd65a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -66,6 +66,9 @@ function(add_RunCMake_test_group test types) endforeach() endfunction() +# Some tests use python for extra checks. +find_package(PythonInterp QUIET) + if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1) set(Swift_ARGS -DXCODE_BELOW_6_1=1) endif() @@ -155,11 +158,12 @@ add_RunCMake_test(DisallowedCommands) add_RunCMake_test(ExternalData) add_RunCMake_test(FeatureSummary) add_RunCMake_test(FPHSA) +add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}) add_RunCMake_test(FindBoost) add_RunCMake_test(FindLua) add_RunCMake_test(FindOpenGL) if(CMake_TEST_UseSWIG) - add_RunCMake_test(UseSWIG) + add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython}) endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") add_RunCMake_test(GenerateExportHeader) diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake index e308ccb..2d7f993 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake @@ -22,3 +22,5 @@ expect_file(${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt) + +message(STATUS "This status message is expected to be visible") diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt new file mode 100644 index 0000000..37d635f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt @@ -0,0 +1 @@ +-- This status message is expected to be visible diff --git a/Tests/RunCMake/FileAPI/CMakeLists.txt b/Tests/RunCMake/FileAPI/CMakeLists.txt new file mode 100644 index 0000000..44025d3 --- /dev/null +++ b/Tests/RunCMake/FileAPI/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.12) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake new file mode 100644 index 0000000..1e9aab6 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake @@ -0,0 +1,68 @@ +set(expect + query + query/client-client-member + query/client-client-member/query.json + query/client-empty-array + query/client-empty-array/query.json + query/client-empty-object + query/client-empty-object/query.json + query/client-json-bad-root + query/client-json-bad-root/query.json + query/client-json-empty + query/client-json-empty/query.json + query/client-json-extra + query/client-json-extra/query.json + query/client-not-file + query/client-not-file/query.json + query/client-request-array-negative-major-version + query/client-request-array-negative-major-version/query.json + query/client-request-array-negative-minor-version + query/client-request-array-negative-minor-version/query.json + query/client-request-array-negative-version + query/client-request-array-negative-version/query.json + query/client-request-array-no-major-version + query/client-request-array-no-major-version/query.json + query/client-request-array-no-supported-version + query/client-request-array-no-supported-version-among + query/client-request-array-no-supported-version-among/query.json + query/client-request-array-no-supported-version/query.json + query/client-request-array-version-1 + query/client-request-array-version-1-1 + query/client-request-array-version-1-1/query.json + query/client-request-array-version-1/query.json + query/client-request-array-version-2 + query/client-request-array-version-2/query.json + query/client-request-negative-major-version + query/client-request-negative-major-version/query.json + query/client-request-negative-minor-version + query/client-request-negative-minor-version/query.json + query/client-request-negative-version + query/client-request-negative-version/query.json + query/client-request-no-major-version + query/client-request-no-major-version/query.json + query/client-request-no-version + query/client-request-no-version/query.json + query/client-request-version-1 + query/client-request-version-1-1 + query/client-request-version-1-1/query.json + query/client-request-version-1/query.json + query/client-request-version-2 + query/client-request-version-2/query.json + query/client-requests-bad + query/client-requests-bad/query.json + query/client-requests-empty + query/client-requests-empty/query.json + query/client-requests-not-kinded + query/client-requests-not-kinded/query.json + query/client-requests-not-objects + query/client-requests-not-objects/query.json + query/client-requests-unknown + query/client-requests-unknown/query.json + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(ClientStateful) diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.py b/Tests/RunCMake/FileAPI/ClientStateful-check.py new file mode 100644 index 0000000..f3d20d1 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful-check.py @@ -0,0 +1,258 @@ +from check_index import * + +def check_reply(q): + assert is_dict(q) + assert sorted(q.keys()) == [ + "client-client-member", + "client-empty-array", + "client-empty-object", + "client-json-bad-root", + "client-json-empty", + "client-json-extra", + "client-not-file", + "client-request-array-negative-major-version", + "client-request-array-negative-minor-version", + "client-request-array-negative-version", + "client-request-array-no-major-version", + "client-request-array-no-supported-version", + "client-request-array-no-supported-version-among", + "client-request-array-version-1", + "client-request-array-version-1-1", + "client-request-array-version-2", + "client-request-negative-major-version", + "client-request-negative-minor-version", + "client-request-negative-version", + "client-request-no-major-version", + "client-request-no-version", + "client-request-version-1", + "client-request-version-1-1", + "client-request-version-2", + "client-requests-bad", + "client-requests-empty", + "client-requests-not-kinded", + "client-requests-not-objects", + "client-requests-unknown", + ] + expected = [ + (check_query_client_member, "client-client-member"), + (check_query_empty_array, "client-empty-array"), + (check_query_empty_object, "client-empty-object"), + (check_query_json_bad_root, "client-json-bad-root"), + (check_query_json_empty, "client-json-empty"), + (check_query_json_extra, "client-json-extra"), + (check_query_not_file, "client-not-file"), + (check_query_requests_bad, "client-requests-bad"), + (check_query_requests_empty, "client-requests-empty"), + (check_query_requests_not_kinded, "client-requests-not-kinded"), + (check_query_requests_not_objects, "client-requests-not-objects"), + (check_query_requests_unknown, "client-requests-unknown"), + ] + for (f, k) in expected: + assert is_dict(q[k]) + assert sorted(q[k].keys()) == ["query.json"] + f(q[k]["query.json"]) + expected = [ + (check_query_response_array_negative_major_version, "client-request-array-negative-major-version"), + (check_query_response_array_negative_minor_version, "client-request-array-negative-minor-version"), + (check_query_response_array_negative_version, "client-request-array-negative-version"), + (check_query_response_array_no_major_version, "client-request-array-no-major-version"), + (check_query_response_array_no_supported_version, "client-request-array-no-supported-version"), + (check_query_response_array_no_supported_version_among, "client-request-array-no-supported-version-among"), + (check_query_response_array_version_1, "client-request-array-version-1"), + (check_query_response_array_version_1_1, "client-request-array-version-1-1"), + (check_query_response_array_version_2, "client-request-array-version-2"), + (check_query_response_negative_major_version, "client-request-negative-major-version"), + (check_query_response_negative_minor_version, "client-request-negative-minor-version"), + (check_query_response_negative_version, "client-request-negative-version"), + (check_query_response_no_major_version, "client-request-no-major-version"), + (check_query_response_no_version, "client-request-no-version"), + (check_query_response_version_1, "client-request-version-1"), + (check_query_response_version_1_1, "client-request-version-1-1"), + (check_query_response_version_2, "client-request-version-2"), + ] + for (f, k) in expected: + assert is_dict(q[k]) + assert sorted(q[k].keys()) == ["query.json"] + assert is_dict(q[k]["query.json"]) + assert sorted(q[k]["query.json"].keys()) == ["requests", "responses"] + r = q[k]["query.json"]["requests"] + assert is_list(r) + assert len(r) == 1 + assert is_dict(r[0]) + assert r[0]["kind"] == "__test" + r = q[k]["query.json"]["responses"] + assert is_list(r) + assert len(r) == 1 + assert is_dict(r[0]) + f(r[0]) + +def check_query_client_member(q): + assert is_dict(q) + assert sorted(q.keys()) == ["client", "responses"] + assert is_dict(q["client"]) + assert sorted(q["client"].keys()) == [] + check_error(q["responses"], "'requests' member missing") + +def check_query_empty_array(q): + check_error(q, "query root is not an object") + +def check_query_empty_object(q): + assert is_dict(q) + assert sorted(q.keys()) == ["responses"] + check_error(q["responses"], "'requests' member missing") + +def check_query_json_bad_root(q): + check_error_re(q, "A valid JSON document must be either an array or an object value") + +def check_query_json_empty(q): + check_error_re(q, "value, object or array expected") + +def check_query_json_extra(q): + check_error_re(q, "Extra non-whitespace after JSON value") + +def check_query_not_file(q): + check_error_re(q, "failed to read from file") + +def check_query_requests_bad(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_dict(r) + assert sorted(r.keys()) == [] + check_error(q["responses"], "'requests' member is not an array") + +def check_query_requests_empty(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 0 + r = q["responses"] + assert is_list(r) + assert len(r) == 0 + +def check_query_requests_not_kinded(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 4 + assert is_dict(r[0]) + assert sorted(r[0].keys()) == [] + assert is_dict(r[1]) + assert sorted(r[1].keys()) == ["kind"] + assert is_dict(r[1]["kind"]) + assert is_dict(r[2]) + assert sorted(r[2].keys()) == ["kind"] + assert is_list(r[2]["kind"]) + assert is_dict(r[3]) + assert sorted(r[3].keys()) == ["kind"] + assert is_int(r[3]["kind"]) + r = q["responses"] + assert is_list(r) + assert len(r) == 4 + check_error(r[0], "'kind' member missing") + check_error(r[1], "'kind' member is not a string") + check_error(r[2], "'kind' member is not a string") + check_error(r[3], "'kind' member is not a string") + +def check_query_requests_not_objects(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 3 + assert is_int(r[0]) + assert is_string(r[1]) + assert is_list(r[2]) + r = q["responses"] + assert is_list(r) + assert len(r) == 3 + check_error(r[0], "request is not an object") + check_error(r[1], "request is not an object") + check_error(r[2], "request is not an object") + +def check_query_requests_unknown(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 3 + assert is_dict(r[0]) + assert sorted(r[0].keys()) == ["kind"] + assert r[0]["kind"] == "unknownC" + assert is_dict(r[1]) + assert sorted(r[1].keys()) == ["kind"] + assert r[1]["kind"] == "unknownB" + assert is_dict(r[2]) + assert sorted(r[2].keys()) == ["kind"] + assert r[2]["kind"] == "unknownA" + r = q["responses"] + assert is_list(r) + assert len(r) == 3 + check_error(r[0], "unknown request kind 'unknownC'") + check_error(r[1], "unknown request kind 'unknownB'") + check_error(r[2], "unknown request kind 'unknownA'") + +def check_query_response_array_negative_major_version(r): + check_error(r, "'version' object 'major' member is not a non-negative integer") + +def check_query_response_array_negative_minor_version(r): + check_error(r, "'version' object 'minor' member is not a non-negative integer") + +def check_query_response_array_negative_version(r): + check_error(r, "'version' array entry is not a non-negative integer or object") + +def check_query_response_array_no_major_version(r): + check_error(r, "'version' object 'major' member missing") + +def check_query_response_array_no_supported_version(r): + check_error(r, "no supported version specified") + +def check_query_response_array_no_supported_version_among(r): + check_error(r, "no supported version specified among: 4.0 3.0") + +def check_query_response_array_version_1(r): + check_index__test(r, 1, 3) + +def check_query_response_array_version_1_1(r): + check_index__test(r, 1, 3) # always uses latest minor version + +def check_query_response_array_version_2(r): + check_index__test(r, 2, 0) + +def check_query_response_negative_major_version(r): + check_error(r, "'version' object 'major' member is not a non-negative integer") + +def check_query_response_negative_minor_version(r): + check_error(r, "'version' object 'minor' member is not a non-negative integer") + +def check_query_response_negative_version(r): + check_error(r, "'version' member is not a non-negative integer, object, or array") + +def check_query_response_no_major_version(r): + check_error(r, "'version' object 'major' member missing") + +def check_query_response_no_version(r): + check_error(r, "'version' member missing") + +def check_query_response_version_1(r): + check_index__test(r, 1, 3) + +def check_query_response_version_1_1(r): + check_index__test(r, 1, 3) # always uses latest minor version + +def check_query_response_version_2(r): + check_index__test(r, 2, 0) + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake new file mode 100644 index 0000000..5b41d7a --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake @@ -0,0 +1,73 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-client-member/query.json" [[{ "client": {} }]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-array/query.json" "[]") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-object/query.json" "{}") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-bad-root/query.json" [["invalid root"]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-empty/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-extra/query.json" "{}x") +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-not-file/query.json") + +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-bad/query.json" [[{ "requests": {} }]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-empty/query.json" [[{ "requests": [] }]]) + +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-not-objects/query.json" [[ +{ "requests": [ 0, "", [] ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-not-kinded/query.json" [[ +{ "requests": [ {}, { "kind": {} }, { "kind": [] }, { "kind": 0 } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-unknown/query.json" [[ +{ "requests": [ { "kind": "unknownC" }, { "kind": "unknownB" }, { "kind": "unknownA" } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-no-version/query.json" [[ +{ "requests": [ { "kind": "__test" } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : -1 } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-no-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : {} } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": -1 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-minor-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": 0, "minor": -1 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, -1 ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, {} ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, { "major": -1 } ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-minor-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, { "major": 0, "minor": -1 } ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-supported-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-supported-version-among/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [4, 3] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : 1 } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-1-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": 1, "minor": 1 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-2/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": 2 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [3, 1] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-1-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [3, { "major": 1, "minor": 1 }, 2 ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-2/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [3, { "major": 2 } ] } ] } +]]) + +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/ClientStateful.cmake b/Tests/RunCMake/FileAPI/ClientStateful.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful.cmake diff --git a/Tests/RunCMake/FileAPI/ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/ClientStateless-check.cmake new file mode 100644 index 0000000..955d9be --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless-check.cmake @@ -0,0 +1,15 @@ +set(expect + query + query/client-foo + query/client-foo/__test-v1 + query/client-foo/__test-v2 + query/client-foo/__test-v3 + query/client-foo/unknown + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(ClientStateless) diff --git a/Tests/RunCMake/FileAPI/ClientStateless-check.py b/Tests/RunCMake/FileAPI/ClientStateless-check.py new file mode 100644 index 0000000..b7da314 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless-check.py @@ -0,0 +1,26 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["client-foo"] + check_reply_client_foo(r["client-foo"]) + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake new file mode 100644 index 0000000..1b8d772 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake @@ -0,0 +1,5 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/ClientStateless.cmake b/Tests/RunCMake/FileAPI/ClientStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless.cmake diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake new file mode 100644 index 0000000..4959c1e --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake @@ -0,0 +1,20 @@ +set(expect + query + query/__test-v1 + query/__test-v2 + query/__test-v3 + query/client-foo + query/client-foo/__test-v1 + query/client-foo/__test-v2 + query/client-foo/__test-v3 + query/client-foo/unknown + query/query.json + query/unknown + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(DuplicateStateless) diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-check.py b/Tests/RunCMake/FileAPI/DuplicateStateless-check.py new file mode 100644 index 0000000..3335479 --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless-check.py @@ -0,0 +1,31 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "client-foo", "query.json", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_reply_client_foo(r["client-foo"]) + check_error(r["query.json"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake new file mode 100644 index 0000000..51b9852 --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake @@ -0,0 +1,10 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless.cmake diff --git a/Tests/RunCMake/FileAPI/Empty-check.cmake b/Tests/RunCMake/FileAPI/Empty-check.cmake new file mode 100644 index 0000000..2764b42 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty-check.cmake @@ -0,0 +1,8 @@ +set(expect + query + reply + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(Empty) diff --git a/Tests/RunCMake/FileAPI/Empty-check.py b/Tests/RunCMake/FileAPI/Empty-check.py new file mode 100644 index 0000000..75bf096 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty-check.py @@ -0,0 +1,15 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == [] + +def check_objects(o): + assert is_list(o) + assert len(o) == 0 + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/Empty-prep.cmake b/Tests/RunCMake/FileAPI/Empty-prep.cmake new file mode 100644 index 0000000..1d1f69e --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty-prep.cmake @@ -0,0 +1 @@ +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query") diff --git a/Tests/RunCMake/FileAPI/Empty.cmake b/Tests/RunCMake/FileAPI/Empty.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty.cmake diff --git a/Tests/RunCMake/FileAPI/EmptyClient-check.cmake b/Tests/RunCMake/FileAPI/EmptyClient-check.cmake new file mode 100644 index 0000000..4e5745c --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient-check.cmake @@ -0,0 +1,9 @@ +set(expect + query + query/client-foo + reply + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(EmptyClient) diff --git a/Tests/RunCMake/FileAPI/EmptyClient-check.py b/Tests/RunCMake/FileAPI/EmptyClient-check.py new file mode 100644 index 0000000..f887908 --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient-check.py @@ -0,0 +1,20 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["client-foo"] + check_reply_client_foo(r["client-foo"]) + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == [] + +def check_objects(o): + assert is_list(o) + assert len(o) == 0 + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake b/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake new file mode 100644 index 0000000..31512fd --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake @@ -0,0 +1,2 @@ +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/EmptyClient.cmake b/Tests/RunCMake/FileAPI/EmptyClient.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient.cmake diff --git a/Tests/RunCMake/FileAPI/MixedStateless-check.cmake b/Tests/RunCMake/FileAPI/MixedStateless-check.cmake new file mode 100644 index 0000000..5795614 --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless-check.cmake @@ -0,0 +1,16 @@ +set(expect + query + query/__test-v1 + query/__test-v3 + query/client-foo + query/client-foo/__test-v2 + query/client-foo/unknown + query/query.json + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(MixedStateless) diff --git a/Tests/RunCMake/FileAPI/MixedStateless-check.py b/Tests/RunCMake/FileAPI/MixedStateless-check.py new file mode 100644 index 0000000..be019ab --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless-check.py @@ -0,0 +1,27 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v3", "client-foo", "query.json"] + check_index__test(r["__test-v1"], 1, 3) + check_error(r["__test-v3"], "unknown query file") + check_reply_client_foo(r["client-foo"]) + check_error(r["query.json"], "unknown query file") + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v2", "unknown"] + check_index__test(r["__test-v2"], 2, 0) + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake b/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake new file mode 100644 index 0000000..030baac --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake @@ -0,0 +1,6 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/MixedStateless.cmake b/Tests/RunCMake/FileAPI/MixedStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless.cmake diff --git a/Tests/RunCMake/FileAPI/Nothing-check.cmake b/Tests/RunCMake/FileAPI/Nothing-check.cmake new file mode 100644 index 0000000..cd4f42e --- /dev/null +++ b/Tests/RunCMake/FileAPI/Nothing-check.cmake @@ -0,0 +1 @@ +check_api("^$") diff --git a/Tests/RunCMake/FileAPI/Nothing-prep.cmake b/Tests/RunCMake/FileAPI/Nothing-prep.cmake new file mode 100644 index 0000000..b850d47 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Nothing-prep.cmake @@ -0,0 +1 @@ +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1") diff --git a/Tests/RunCMake/FileAPI/Nothing.cmake b/Tests/RunCMake/FileAPI/Nothing.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Nothing.cmake diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake new file mode 100644 index 0000000..f8adb64 --- /dev/null +++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake @@ -0,0 +1,58 @@ +include(RunCMake) + +# Function called in *-check.cmake scripts to check api files. +function(check_api expect) + file(GLOB_RECURSE actual + LIST_DIRECTORIES TRUE + RELATIVE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1 + ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/* + ) + if(NOT "${actual}" MATCHES "${expect}") + set(RunCMake_TEST_FAILED "API files: + ${actual} +do not match what we expected: + ${expect} +in directory: + ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1" PARENT_SCOPE) + endif() +endfunction() + +function(check_python case) + if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE) + return() + endif() + file(GLOB index ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/index-*.json) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + ) + if(NOT result EQUAL 0) + string(REPLACE "\n" "\n " output " ${output}") + set(RunCMake_TEST_FAILED "Unexpected index:\n${output}" PARENT_SCOPE) + endif() +endfunction() + +run_cmake(Nothing) +run_cmake(Empty) +run_cmake(EmptyClient) +run_cmake(Stale) +run_cmake(SharedStateless) +run_cmake(ClientStateless) +run_cmake(MixedStateless) +run_cmake(DuplicateStateless) +run_cmake(ClientStateful) + +function(run_object object) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${object}-build) + run_cmake(${object}) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${object}-SharedStateless ${CMAKE_COMMAND} .) + run_cmake_command(${object}-ClientStateless ${CMAKE_COMMAND} .) + run_cmake_command(${object}-ClientStateful ${CMAKE_COMMAND} .) +endfunction() + +run_object(codemodel-v2) +run_object(cache-v2) +run_object(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/SharedStateless-check.cmake new file mode 100644 index 0000000..7f3bb23 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless-check.cmake @@ -0,0 +1,15 @@ +set(expect + query + query/__test-v1 + query/__test-v2 + query/__test-v3 + query/query.json + query/unknown + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(SharedStateless) diff --git a/Tests/RunCMake/FileAPI/SharedStateless-check.py b/Tests/RunCMake/FileAPI/SharedStateless-check.py new file mode 100644 index 0000000..79f52d7 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless-check.py @@ -0,0 +1,22 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "query.json", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_error(r["query.json"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake new file mode 100644 index 0000000..b280414 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake @@ -0,0 +1,6 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/SharedStateless.cmake b/Tests/RunCMake/FileAPI/SharedStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless.cmake diff --git a/Tests/RunCMake/FileAPI/Stale-check.cmake b/Tests/RunCMake/FileAPI/Stale-check.cmake new file mode 100644 index 0000000..7ee2c9e --- /dev/null +++ b/Tests/RunCMake/FileAPI/Stale-check.cmake @@ -0,0 +1,4 @@ +set(expect + reply + ) +check_api("^${expect}$") diff --git a/Tests/RunCMake/FileAPI/Stale-prep.cmake b/Tests/RunCMake/FileAPI/Stale-prep.cmake new file mode 100644 index 0000000..e920925 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Stale-prep.cmake @@ -0,0 +1 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/Stale.cmake b/Tests/RunCMake/FileAPI/Stale.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Stale.cmake diff --git a/Tests/RunCMake/FileAPI/alias/CMakeLists.txt b/Tests/RunCMake/FileAPI/alias/CMakeLists.txt new file mode 100644 index 0000000..549307d --- /dev/null +++ b/Tests/RunCMake/FileAPI/alias/CMakeLists.txt @@ -0,0 +1,10 @@ +project(Alias) +enable_language(CXX) + +add_library(c_alias_lib ALIAS c_lib) +add_executable(c_alias_exe ../empty.c) +target_link_libraries(c_alias_exe PRIVATE c_alias_lib) + +add_library(cxx_alias_lib ALIAS cxx_lib) +add_executable(cxx_alias_exe ../empty.cxx) +target_link_libraries(cxx_alias_exe PRIVATE cxx_alias_lib) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake new file mode 100644 index 0000000..0f5ef28 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake new file mode 100644 index 0000000..9329280 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ +{ "requests": [ { "kind": "cache", "version" : 2 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake new file mode 100644 index 0000000..c406ec8 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/cache-v2 + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake new file mode 100644 index 0000000..dccafa5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/cache-v2" "") diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake new file mode 100644 index 0000000..f8337eb --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake @@ -0,0 +1,10 @@ +set(expect + query + query/cache-v2 + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake new file mode 100644 index 0000000..ee5ac57 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/cache-v2" "") diff --git a/Tests/RunCMake/FileAPI/cache-v2-check.py b/Tests/RunCMake/FileAPI/cache-v2-check.py new file mode 100644 index 0000000..756ef80 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-check.py @@ -0,0 +1,134 @@ +from check_index import * + +def check_objects(o): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "cache", 2, 0, check_object_cache) + +def check_cache_entry(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["name", "properties", "type", "value"] + + assert is_string(actual["type"], expected["type"]) + assert is_string(actual["value"], expected["value"]) + + def check_property(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["name", "value"] + assert is_string(actual["value"], expected["value"]) + + check_list_match(lambda a, e: is_string(a["name"], e["name"]), actual["properties"], expected["properties"], check=check_property) + +def check_object_cache(o): + assert sorted(o.keys()) == ["entries", "kind", "version"] + # The "kind" and "version" members are handled by check_index_object. + check_list_match(lambda a, e: is_string(a["name"], e["name"]), o["entries"], [ + { + "name": "CM_OPTION_BOOL", + "type": "BOOL", + "value": "OFF", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing option()", + }, + ], + }, + { + "name": "CM_SET_BOOL", + "type": "BOOL", + "value": "ON", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE BOOL)", + }, + { + "name": "ADVANCED", + "value": "1", + }, + ], + }, + { + "name": "CM_SET_FILEPATH", + "type": "FILEPATH", + "value": "dir1/dir2/empty.txt", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE FILEPATH)", + }, + ], + }, + { + "name": "CM_SET_PATH", + "type": "PATH", + "value": "dir1/dir2", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE PATH)", + }, + { + "name": "ADVANCED", + "value": "ON", + }, + ], + }, + { + "name": "CM_SET_STRING", + "type": "STRING", + "value": "test", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE STRING)", + }, + ], + }, + { + "name": "CM_SET_STRINGS", + "type": "STRING", + "value": "1", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE STRING) with STRINGS", + }, + { + "name": "STRINGS", + "value": "1;2;3;4", + }, + ], + }, + { + "name": "CM_SET_INTERNAL", + "type": "INTERNAL", + "value": "int2", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE INTERNAL)", + }, + ], + }, + { + "name": "CM_SET_TYPE", + "type": "STRING", + "value": "1", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE INTERNAL) with set_property(TYPE)", + }, + { + "name": "ADVANCED", + "value": "0", + }, + ], + }, + ], check=check_cache_entry, allow_extra=True) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/cache-v2.cmake b/Tests/RunCMake/FileAPI/cache-v2.cmake new file mode 100644 index 0000000..45b402d --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2.cmake @@ -0,0 +1,14 @@ +option(CM_OPTION_BOOL "Testing option()" "OFF") +set(CM_SET_BOOL "ON" CACHE BOOL "Testing set(CACHE BOOL)") +mark_as_advanced(CM_SET_BOOL) +set(CM_SET_FILEPATH "dir1/dir2/empty.txt" CACHE FILEPATH "Testing set(CACHE FILEPATH)") +set(CM_SET_PATH "dir1/dir2" CACHE PATH "Testing set(CACHE PATH)") +set_property(CACHE CM_SET_PATH PROPERTY ADVANCED ON) +set(CM_SET_STRING "test" CACHE STRING "Testing set(CACHE STRING)") +set(CM_SET_STRINGS "1" CACHE STRING "Testing set(CACHE STRING) with STRINGS") +set_property(CACHE CM_SET_STRINGS PROPERTY STRINGS "1;2;3;4") +set(CM_SET_INTERNAL "int" CACHE INTERNAL "Testing set(CACHE INTERNAL)") +set_property(CACHE CM_SET_INTERNAL PROPERTY VALUE "int2") +set(CM_SET_TYPE "1" CACHE INTERNAL "Testing set(CACHE INTERNAL) with set_property(TYPE)") +set_property(CACHE CM_SET_TYPE PROPERTY TYPE "STRING") +set_property(CACHE CM_SET_TYPE PROPERTY ADVANCED "0") diff --git a/Tests/RunCMake/FileAPI/check_index.py b/Tests/RunCMake/FileAPI/check_index.py new file mode 100644 index 0000000..cda7234 --- /dev/null +++ b/Tests/RunCMake/FileAPI/check_index.py @@ -0,0 +1,163 @@ +import sys +import os +import json +import re + +if sys.version_info[0] >= 3: + unicode = str + +def is_bool(x, val=None): + return isinstance(x, bool) and (val is None or x == val) + +def is_dict(x): + return isinstance(x, dict) + +def is_list(x): + return isinstance(x, list) + +def is_int(x, val=None): + return (isinstance(x, int) or isinstance(x, long)) and (val is None or x == val) + +def is_string(x, val=None): + return (isinstance(x, str) or isinstance(x, unicode)) and (val is None or x == val) + +def matches(s, pattern): + return is_string(s) and bool(re.search(pattern, s)) + +def check_list_match(match, actual, expected, check=None, check_exception=None, missing_exception=None, extra_exception=None, allow_extra=False): + """ + Handle the common pattern of making sure every actual item "matches" some + item in the expected list, and that neither list has extra items after + matching is completed. + + @param match: Callback to check if an actual item matches an expected + item. Return True if the item matches, return False if the item doesn't + match. + @param actual: List of actual items to search. + @param expected: List of expected items to match. + @param check: Optional function to check that the actual item is valid by + comparing it to the expected item. + @param check_exception: Optional function that returns an argument to + append to any exception thrown by the check function. + @param missing_exception: Optional function that returns an argument to + append to the exception thrown when an item is not found. + @param extra_exception: Optional function that returns an argument to + append to the exception thrown when an extra item is found. + @param allow_extra: Optional parameter allowing there to be extra actual + items after all the expected items have been found. + """ + assert is_list(actual) + _actual = actual[:] + for expected_item in expected: + found = False + for i, actual_item in enumerate(_actual): + if match(actual_item, expected_item): + if check: + try: + check(actual_item, expected_item) + except BaseException as e: + if check_exception: + e.args += (check_exception(actual_item, expected_item),) + raise + found = True + del _actual[i] + break + if missing_exception: + assert found, missing_exception(expected_item) + else: + assert found + if not allow_extra: + if extra_exception: + assert len(_actual) == 0, [extra_exception(a) for a in _actual] + else: + assert len(_actual) == 0 + +def filter_list(f, l): + if l is not None: + l = list(filter(f, l)) + if l == []: + l = None + return l + +def check_cmake(cmake): + assert is_dict(cmake) + assert sorted(cmake.keys()) == ["generator", "paths", "version"] + check_cmake_version(cmake["version"]) + check_cmake_paths(cmake["paths"]) + check_cmake_generator(cmake["generator"]) + +def check_cmake_version(v): + assert is_dict(v) + assert sorted(v.keys()) == ["isDirty", "major", "minor", "patch", "string", "suffix"] + assert is_string(v["string"]) + assert is_int(v["major"]) + assert is_int(v["minor"]) + assert is_int(v["patch"]) + assert is_string(v["suffix"]) + assert is_bool(v["isDirty"]) + +def check_cmake_paths(v): + assert is_dict(v) + assert sorted(v.keys()) == ["cmake", "cpack", "ctest", "root"] + assert is_string(v["cmake"]) + assert is_string(v["cpack"]) + assert is_string(v["ctest"]) + assert is_string(v["root"]) + +def check_cmake_generator(g): + assert is_dict(g) + name = g.get("name", None) + assert is_string(name) + if name.startswith("Visual Studio"): + assert sorted(g.keys()) == ["name", "platform"] + assert is_string(g["platform"]) + else: + assert sorted(g.keys()) == ["name"] + +def check_index_object(indexEntry, kind, major, minor, check): + assert is_dict(indexEntry) + assert sorted(indexEntry.keys()) == ["jsonFile", "kind", "version"] + assert is_string(indexEntry["kind"]) + assert indexEntry["kind"] == kind + assert is_dict(indexEntry["version"]) + assert sorted(indexEntry["version"].keys()) == ["major", "minor"] + assert indexEntry["version"]["major"] == major + assert indexEntry["version"]["minor"] == minor + assert is_string(indexEntry["jsonFile"]) + filepath = os.path.join(reply_dir, indexEntry["jsonFile"]) + with open(filepath) as f: + object = json.load(f) + assert is_dict(object) + assert "kind" in object + assert is_string(object["kind"]) + assert object["kind"] == kind + assert "version" in object + assert is_dict(object["version"]) + assert sorted(object["version"].keys()) == ["major", "minor"] + assert object["version"]["major"] == major + assert object["version"]["minor"] == minor + if check: + check(object) + +def check_index__test(indexEntry, major, minor): + def check(object): + assert sorted(object.keys()) == ["kind", "version"] + check_index_object(indexEntry, "__test", major, minor, check) + +def check_error(value, error): + assert is_dict(value) + assert sorted(value.keys()) == ["error"] + assert is_string(value["error"]) + assert value["error"] == error + +def check_error_re(value, error): + assert is_dict(value) + assert sorted(value.keys()) == ["error"] + assert is_string(value["error"]) + assert re.search(error, value["error"]) + +reply_index = sys.argv[1] +reply_dir = os.path.dirname(reply_index) + +with open(reply_index) as f: + index = json.load(f) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake new file mode 100644 index 0000000..21e931e --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/cmakeFiles-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake new file mode 100644 index 0000000..7a72696 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ +{ "requests": [ { "kind": "cmakeFiles", "version" : 1 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake new file mode 100644 index 0000000..2ce2e79 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/cmakeFiles-v1 + reply + reply/cmakeFiles-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake new file mode 100644 index 0000000..eb96491 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/cmakeFiles-v1" "") diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake new file mode 100644 index 0000000..6e3b49a --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake @@ -0,0 +1,10 @@ +set(expect + query + query/cmakeFiles-v1 + reply + reply/cmakeFiles-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake new file mode 100644 index 0000000..8c8bdef --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/cmakeFiles-v1" "") diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py new file mode 100644 index 0000000..49dfe87 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py @@ -0,0 +1,94 @@ +from check_index import * + +def check_objects(o): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "cmakeFiles", 1, 0, check_object_cmakeFiles) + +def check_input(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["isGenerated"] is not None: + expected_keys.append("isGenerated") + assert is_bool(actual["isGenerated"], expected["isGenerated"]) + + if expected["isExternal"] is not None: + expected_keys.append("isExternal") + assert is_bool(actual["isExternal"], expected["isExternal"]) + + if expected["isCMake"] is not None: + expected_keys.append("isCMake") + assert is_bool(actual["isCMake"], expected["isCMake"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + +def check_object_cmakeFiles(o): + assert sorted(o.keys()) == ["inputs", "kind", "paths", "version"] + # The "kind" and "version" members are handled by check_index_object. + assert is_dict(o["paths"]) + assert sorted(o["paths"].keys()) == ["build", "source"] + assert matches(o["paths"]["build"], "^.*/Tests/RunCMake/FileAPI/cmakeFiles-v1-build$") + assert matches(o["paths"]["source"], "^.*/Tests/RunCMake/FileAPI$") + + expected = [ + { + "path": "^CMakeLists\\.txt$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^cmakeFiles-v1\\.cmake$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^dir/CMakeLists\\.txt$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^dir/dir/CMakeLists\\.txt$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^dir/dirtest\\.cmake$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^.*/Tests/RunCMake/FileAPIDummyFile\\.cmake$", + "isGenerated": None, + "isExternal": True, + "isCMake": None, + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/cmakeFiles-v1-build/generated\\.cmake", + "isGenerated": True, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^.*/Modules/CMakeParseArguments\\.cmake$", + "isGenerated": None, + "isExternal": True, + "isCMake": True, + }, + ] + + inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"] + if inSource: + for e in expected: + e["path"] = e["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), o["inputs"], expected, check=check_input, allow_extra=True) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake new file mode 100644 index 0000000..4d4d757 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake @@ -0,0 +1,8 @@ +include("${CMAKE_CURRENT_LIST_DIR}/dir/dirtest.cmake") +include(CMakeParseArguments) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cmake" "") +include("${CMAKE_CURRENT_BINARY_DIR}/generated.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../FileAPIDummyFile.cmake") + +add_subdirectory(dir) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake new file mode 100644 index 0000000..fb78e87 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake @@ -0,0 +1,12 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/codemodel-v2-[0-9a-f]+\\.json + reply/index-[0-9.T-]+\\.json + .* + ) +check_api("^${expect}$") + +check_python(codemodel-v2) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake new file mode 100644 index 0000000..e2b38ff --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ +{ "requests": [ { "kind": "codemodel", "version" : 2 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake new file mode 100644 index 0000000..7c6a35a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake @@ -0,0 +1,12 @@ +set(expect + query + query/client-foo + query/client-foo/codemodel-v2 + reply + reply/codemodel-v2-[0-9a-f]+\\.json + reply/index-[0-9.T-]+\\.json + .* + ) +check_api("^${expect}$") + +check_python(codemodel-v2) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake new file mode 100644 index 0000000..d1ce292 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/codemodel-v2" "") diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake new file mode 100644 index 0000000..cc2f31b --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/codemodel-v2 + reply + reply/codemodel-v2-[0-9a-f]+\\.json + reply/index-[0-9.T-]+\\.json + .* + ) +check_api("^${expect}$") + +check_python(codemodel-v2) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake new file mode 100644 index 0000000..8a519d5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/codemodel-v2" "") diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py new file mode 100644 index 0000000..18b9347 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -0,0 +1,5085 @@ +from check_index import * + +import sys +import os + +def check_objects(o, g): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "codemodel", 2, 0, check_object_codemodel(g)) + +def check_backtrace(t, b, backtrace): + btg = t["backtraceGraph"] + for expected in backtrace: + assert is_int(b) + node = btg["nodes"][b] + expected_keys = ["file"] + assert matches(btg["files"][node["file"]], expected["file"]) + + if expected["line"] is not None: + expected_keys.append("line") + assert is_int(node["line"], expected["line"]) + + if expected["command"] is not None: + expected_keys.append("command") + assert is_int(node["command"]) + assert is_string(btg["commands"][node["command"]], expected["command"]) + + if expected["hasParent"]: + expected_keys.append("parent") + assert is_int(node["parent"]) + b = node["parent"] + else: + b = None + + assert sorted(node.keys()) == sorted(expected_keys) + + assert b is None + +def check_directory(c): + def _check(actual, expected): + assert is_dict(actual) + expected_keys = ["build", "source", "projectIndex"] + assert matches(actual["build"], expected["build"]) + + assert is_int(actual["projectIndex"]) + assert is_string(c["projects"][actual["projectIndex"]]["name"], expected["projectName"]) + + if expected["parentSource"] is not None: + expected_keys.append("parentIndex") + assert is_int(actual["parentIndex"]) + assert matches(c["directories"][actual["parentIndex"]]["source"], expected["parentSource"]) + + if expected["childSources"] is not None: + expected_keys.append("childIndexes") + check_list_match(lambda a, e: matches(c["directories"][a]["source"], e), + actual["childIndexes"], expected["childSources"], + missing_exception=lambda e: "Child source: %s" % e, + extra_exception=lambda a: "Child source: %s" % a["source"]) + + if expected["targetIds"] is not None: + expected_keys.append("targetIndexes") + check_list_match(lambda a, e: matches(c["targets"][a]["id"], e), + actual["targetIndexes"], expected["targetIds"], + missing_exception=lambda e: "Target ID: %s" % e, + extra_exception=lambda a: "Target ID: %s" % c["targets"][a]["id"]) + + if expected["minimumCMakeVersion"] is not None: + expected_keys.append("minimumCMakeVersion") + assert is_dict(actual["minimumCMakeVersion"]) + assert sorted(actual["minimumCMakeVersion"].keys()) == ["string"] + assert is_string(actual["minimumCMakeVersion"]["string"], expected["minimumCMakeVersion"]) + + if expected["hasInstallRule"] is not None: + expected_keys.append("hasInstallRule") + assert is_bool(actual["hasInstallRule"], expected["hasInstallRule"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + return _check + +def check_target_backtrace_graph(t): + btg = t["backtraceGraph"] + assert is_dict(btg) + assert sorted(btg.keys()) == ["commands", "files", "nodes"] + assert is_list(btg["commands"]) + + for c in btg["commands"]: + assert is_string(c) + + for f in btg["files"]: + assert is_string(f) + + for n in btg["nodes"]: + expected_keys = ["file"] + assert is_dict(n) + assert is_int(n["file"]) + assert 0 <= n["file"] < len(btg["files"]) + + if "line" in n: + expected_keys.append("line") + assert is_int(n["line"]) + + if "command" in n: + expected_keys.append("command") + assert is_int(n["command"]) + assert 0 <= n["command"] < len(btg["commands"]) + + if "parent" in n: + expected_keys.append("parent") + assert is_int(n["parent"]) + assert 0 <= n["parent"] < len(btg["nodes"]) + + assert sorted(n.keys()) == sorted(expected_keys) + +def check_target(c): + def _check(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["directoryIndex", "id", "jsonFile", "name", "projectIndex"] + assert is_int(actual["directoryIndex"]) + assert matches(c["directories"][actual["directoryIndex"]]["source"], expected["directorySource"]) + assert is_string(actual["name"], expected["name"]) + assert is_string(actual["jsonFile"]) + assert is_int(actual["projectIndex"]) + assert is_string(c["projects"][actual["projectIndex"]]["name"], expected["projectName"]) + + filepath = os.path.join(reply_dir, actual["jsonFile"]) + with open(filepath) as f: + obj = json.load(f) + + expected_keys = ["name", "id", "type", "backtraceGraph", "paths", "sources"] + assert is_dict(obj) + assert is_string(obj["name"], expected["name"]) + assert matches(obj["id"], expected["id"]) + assert is_string(obj["type"], expected["type"]) + check_target_backtrace_graph(obj) + + assert is_dict(obj["paths"]) + assert sorted(obj["paths"].keys()) == ["build", "source"] + assert matches(obj["paths"]["build"], expected["build"]) + assert matches(obj["paths"]["source"], expected["source"]) + + def check_source(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["compileGroupLanguage"] is not None: + expected_keys.append("compileGroupIndex") + assert is_string(obj["compileGroups"][actual["compileGroupIndex"]]["language"], expected["compileGroupLanguage"]) + + if expected["sourceGroupName"] is not None: + expected_keys.append("sourceGroupIndex") + assert is_string(obj["sourceGroups"][actual["sourceGroupIndex"]]["name"], expected["sourceGroupName"]) + + if expected["isGenerated"] is not None: + expected_keys.append("isGenerated") + assert is_bool(actual["isGenerated"], expected["isGenerated"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), obj["sources"], + expected["sources"], check=check_source, + check_exception=lambda a, e: "Source file: %s" % a["path"], + missing_exception=lambda e: "Source file: %s" % e["path"], + extra_exception=lambda a: "Source file: %s" % a["path"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, obj["backtrace"], expected["backtrace"]) + + if expected["folder"] is not None: + expected_keys.append("folder") + assert is_dict(obj["folder"]) + assert sorted(obj["folder"].keys()) == ["name"] + assert is_string(obj["folder"]["name"], expected["folder"]) + + if expected["nameOnDisk"] is not None: + expected_keys.append("nameOnDisk") + assert matches(obj["nameOnDisk"], expected["nameOnDisk"]) + + if expected["artifacts"] is not None: + expected_keys.append("artifacts") + + def check_artifact(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["path"] + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + obj["artifacts"], expected["artifacts"], + check=check_artifact, + check_exception=lambda a, e: "Artifact: %s" % a["path"], + missing_exception=lambda e: "Artifact: %s" % e["path"], + extra_exception=lambda a: "Artifact: %s" % a["path"]) + + if expected["isGeneratorProvided"] is not None: + expected_keys.append("isGeneratorProvided") + assert is_bool(obj["isGeneratorProvided"], expected["isGeneratorProvided"]) + + if expected["install"] is not None: + expected_keys.append("install") + assert is_dict(obj["install"]) + assert sorted(obj["install"].keys()) == ["destinations", "prefix"] + + assert is_dict(obj["install"]["prefix"]) + assert sorted(obj["install"]["prefix"].keys()) == ["path"] + assert matches(obj["install"]["prefix"]["path"], expected["install"]["prefix"]) + + def check_install_destination(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + obj["install"]["destinations"], expected["install"]["destinations"], + check=check_install_destination, + check_exception=lambda a, e: "Install path: %s" % a["path"], + missing_exception=lambda e: "Install path: %s" % e["path"], + extra_exception=lambda a: "Install path: %s" % a["path"]) + + if expected["link"] is not None: + expected_keys.append("link") + assert is_dict(obj["link"]) + link_keys = ["language"] + + assert is_string(obj["link"]["language"], expected["link"]["language"]) + + # FIXME: Properly test commandFragments + if "commandFragments" in obj["link"]: + link_keys.append("commandFragments") + assert is_list(obj["link"]["commandFragments"]) + for f in obj["link"]["commandFragments"]: + assert is_dict(f) + assert sorted(f.keys()) == ["fragment", "role"] + assert is_string(f["fragment"]) + assert is_string(f["role"]) + assert f["role"] in ("flags", "libraries", "libraryPath", "frameworkPath") + + if expected["link"]["lto"] is not None: + link_keys.append("lto") + assert is_bool(obj["link"]["lto"], expected["link"]["lto"]) + + # FIXME: Properly test sysroot + if "sysroot" in obj["link"]: + link_keys.append("sysroot") + assert is_string(obj["link"]["sysroot"]) + + assert sorted(obj["link"].keys()) == sorted(link_keys) + + if expected["archive"] is not None: + expected_keys.append("archive") + assert is_dict(obj["archive"]) + archive_keys = [] + + # FIXME: Properly test commandFragments + if "commandFragments" in obj["archive"]: + archive_keys.append("commandFragments") + assert is_list(obj["archive"]["commandFragments"]) + for f in obj["archive"]["commandFragments"]: + assert is_dict(f) + assert sorted(f.keys()) == ["fragment", "role"] + assert is_string(f["fragment"]) + assert is_string(f["role"]) + assert f["role"] in ("flags") + + if expected["archive"]["lto"] is not None: + archive_keys.append("lto") + assert is_bool(obj["archive"]["lto"], expected["archive"]["lto"]) + + assert sorted(obj["archive"].keys()) == sorted(archive_keys) + + if expected["dependencies"] is not None: + expected_keys.append("dependencies") + + def check_dependency(actual, expected): + assert is_dict(actual) + expected_keys = ["id"] + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["id"], e["id"]), + obj["dependencies"], expected["dependencies"], + check=check_dependency, + check_exception=lambda a, e: "Dependency ID: %s" % a["id"], + missing_exception=lambda e: "Dependency ID: %s" % e["id"], + extra_exception=lambda a: "Dependency ID: %s" % a["id"]) + + if expected["sourceGroups"] is not None: + expected_keys.append("sourceGroups") + + def check_source_group(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["name", "sourceIndexes"] + + check_list_match(lambda a, e: matches(obj["sources"][a]["path"], e), + actual["sourceIndexes"], expected["sourcePaths"], + missing_exception=lambda e: "Source path: %s" % e, + extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"]) + + check_list_match(lambda a, e: is_string(a["name"], e["name"]), + obj["sourceGroups"], expected["sourceGroups"], + check=check_source_group, + check_exception=lambda a, e: "Source group: %s" % a["name"], + missing_exception=lambda e: "Source group: %s" % e["name"], + extra_exception=lambda a: "Source group: %s" % a["name"]) + + if expected["compileGroups"] is not None: + expected_keys.append("compileGroups") + + def check_compile_group(actual, expected): + assert is_dict(actual) + expected_keys = ["sourceIndexes", "language"] + + check_list_match(lambda a, e: matches(obj["sources"][a]["path"], e), + actual["sourceIndexes"], expected["sourcePaths"], + missing_exception=lambda e: "Source path: %s" % e, + extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"]) + + # FIXME: Properly test compileCommandFragments + if "compileCommandFragments" in actual: + expected_keys.append("compileCommandFragments") + assert is_list(actual["compileCommandFragments"]) + for f in actual["compileCommandFragments"]: + assert is_dict(f) + assert sorted(f.keys()) == ["fragment"] + assert is_string(f["fragment"]) + + if expected["includes"] is not None: + expected_keys.append("includes") + + def check_include(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["isSystem"] is not None: + expected_keys.append("isSystem") + assert is_bool(actual["isSystem"], expected["isSystem"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + actual["includes"], expected["includes"], + check=check_include, + check_exception=lambda a, e: "Include path: %s" % a["path"], + missing_exception=lambda e: "Include path: %s" % e["path"], + extra_exception=lambda a: "Include path: %s" % a["path"]) + + if expected["defines"] is not None: + expected_keys.append("defines") + + def check_define(actual, expected): + assert is_dict(actual) + expected_keys = ["define"] + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: is_string(a["define"], e["define"]), + actual["defines"], expected["defines"], + check=check_define, + check_exception=lambda a, e: "Define: %s" % a["define"], + missing_exception=lambda e: "Define: %s" % e["define"], + extra_exception=lambda a: "Define: %s" % a["define"]) + + # FIXME: Properly test sysroot + if "sysroot" in actual: + expected_keys.append("sysroot") + assert is_string(actual["sysroot"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: is_string(a["language"], e["language"]), + obj["compileGroups"], expected["compileGroups"], + check=check_compile_group, + check_exception=lambda a, e: "Compile group: %s" % a["language"], + missing_exception=lambda e: "Compile group: %s" % e["language"], + extra_exception=lambda a: "Compile group: %s" % a["language"]) + + assert sorted(obj.keys()) == sorted(expected_keys) + + return _check + +def check_project(c): + def _check(actual, expected): + assert is_dict(actual) + expected_keys = ["name", "directoryIndexes"] + + check_list_match(lambda a, e: matches(c["directories"][a]["source"], e), + actual["directoryIndexes"], expected["directorySources"], + missing_exception=lambda e: "Directory source: %s" % e, + extra_exception=lambda a: "Directory source: %s" % c["directories"][a]["source"]) + + if expected["parentName"] is not None: + expected_keys.append("parentIndex") + assert is_int(actual["parentIndex"]) + assert is_string(c["projects"][actual["parentIndex"]]["name"], expected["parentName"]) + + if expected["childNames"] is not None: + expected_keys.append("childIndexes") + check_list_match(lambda a, e: is_string(c["projects"][a]["name"], e), + actual["childIndexes"], expected["childNames"], + missing_exception=lambda e: "Child name: %s" % e, + extra_exception=lambda a: "Child name: %s" % c["projects"][a]["name"]) + + if expected["targetIds"] is not None: + expected_keys.append("targetIndexes") + check_list_match(lambda a, e: matches(c["targets"][a]["id"], e), + actual["targetIndexes"], expected["targetIds"], + missing_exception=lambda e: "Target ID: %s" % e, + extra_exception=lambda a: "Target ID: %s" % c["targets"][a]["id"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + return _check + +def gen_check_directories(c, g): + expected = [ + { + "source": "^\\.$", + "build": "^\\.$", + "parentSource": None, + "childSources": [ + "^alias$", + "^custom$", + "^cxx$", + "^imported$", + "^object$", + "^.*/Tests/RunCMake/FileAPIExternalSource$", + "^dir$", + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$", + ], + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": True, + }, + { + "source": "^alias$", + "build": "^alias$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$", + ], + "projectName": "Alias", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^custom$", + "build": "^custom$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$", + ], + "projectName": "Custom", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^cxx$", + "build": "^cxx$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$", + ], + "projectName": "Cxx", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^imported$", + "build": "^imported$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + ], + "projectName": "Imported", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^object$", + "build": "^object$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + ], + "projectName": "Object", + "minimumCMakeVersion": "3.13", + "hasInstallRule": True, + }, + { + "source": "^dir$", + "build": "^dir$", + "parentSource": "^\\.$", + "childSources": [ + "^dir/dir$", + ], + "targetIds": None, + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^dir/dir$", + "build": "^dir/dir$", + "parentSource": "^dir$", + "childSources": None, + "targetIds": None, + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$", + ], + "projectName": "External", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + ] + + if matches(g, "^Visual Studio "): + for e in expected: + if e["parentSource"] is not None: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"]) + + elif g == "Xcode": + if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""): + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"]) + + else: + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(ALL_BUILD|ZERO_CHECK)"), e["targetIds"]) + + return expected + +def check_directories(c, g): + check_list_match(lambda a, e: matches(a["source"], e["source"]), c["directories"], gen_check_directories(c, g), + check=check_directory(c), + check_exception=lambda a, e: "Directory source: %s" % a["source"], + missing_exception=lambda e: "Directory source: %s" % e["source"], + extra_exception=lambda a: "Directory source: %s" % a["source"]) + +def gen_check_targets(c, g, inSource): + expected = [ + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^interface_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_static_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^custom_exe::@c11385ffed57b860da63$", + "backtrace": None, + }, + { + "id": "^generated_exe::@[0-9a-f]+$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "interface_exe", + "id": "^interface_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^include_test\\.cmake$", + "line": 3, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^include_test\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": [ + { + "define": "interface_exe_EXPORTS", + "backtrace": None, + }, + ], + }, + ], + "backtrace": [ + { + "file": "^include_test\\.cmake$", + "line": 3, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^include_test\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^my_interface_exe\\.myexe$", + "artifacts": [ + { + "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$", + "_dllExtra": False, + }, + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$", + "_dllExtra": True, + }, + { + "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_lib", + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": { + "lto": None, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_exe", + "id": "^c_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 7, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_shared_lib", + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": [ + { + "define": "c_shared_lib_EXPORTS", + "backtrace": None, + }, + ], + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$", + "_dllExtra": True, + }, + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": True, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_shared_exe", + "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": True, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 11, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_static_lib", + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": { + "lto": True, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_static_exe", + "id": "^c_static_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 15, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "cxx_lib", + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": { + "lto": None, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_exe", + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": "bin", + "nameOnDisk": "^cxx_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_shared_lib", + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": [ + { + "define": "cxx_shared_lib_EXPORTS", + "backtrace": None, + }, + ], + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$", + "_dllExtra": True, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_shared_exe", + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_static_lib", + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": { + "lto": None, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_static_exe", + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 15, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^c_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "c_alias_exe", + "id": "^c_alias_exe::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_alias_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_alias_exe", + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_alias_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 10, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "c_object_lib", + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "OBJECT_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": [ + { + "path": "^object/.*/empty(\\.c)?\\.o(bj)?$", + "_dllExtra": False, + }, + ], + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "c_object_exe", + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", + "isGenerated": True, + "sourceGroupName": "Object Libraries", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 7, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + { + "name": "Object Libraries", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^object$", + "source": "^object$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + # FIXME: Add a backtrace here when it becomes available. + # You'll know when it's available, because this test will + # fail. + "backtrace": None, + }, + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_object_lib", + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "OBJECT_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": [ + { + "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$", + "_dllExtra": False, + }, + ], + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_object_exe", + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", + "isGenerated": True, + "sourceGroupName": "Object Libraries", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + { + "name": "Object Libraries", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^object$", + "source": "^object$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + # FIXME: Add a backtrace here when it becomes available. + # You'll know when it's available, because this test will + # fail. + "backtrace": None, + }, + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "link_imported_exe", + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_shared_exe", + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_static_exe", + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 13, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 13, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_object_exe", + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 18, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 18, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_interface_exe", + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": None, + }, + { + "id": "^custom_exe::@c11385ffed57b860da63$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "custom_tgt", + "id": "^custom_tgt::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 3, + "command": "add_custom_target", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 3, + "command": "add_custom_target", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": None, + }, + ], + }, + { + "name": "custom_exe", + "id": "^custom_exe::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 4, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 4, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^custom_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^custom_tgt::@c11385ffed57b860da63$", + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 5, + "command": "add_dependencies", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "backtrace": None, + }, + { + "id": "^generated_exe::@[0-9a-f]+$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "generated_exe", + "id": "^generated_exe::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + "isGenerated": True, + "sourceGroupName": "Generated Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 6, + "command": "target_sources", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + ], + }, + { + "name": "Generated Source Files", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "isSystem": None, + "backtrace": None, + }, + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "isSystem": True, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 11, + "command": "target_include_directories", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "defines": [ + { + "define": "EMPTY_C=1", + "backtrace": None, + }, + { + "define": "SRC_DUMMY", + "backtrace": None, + }, + { + "define": "GENERATED_EXE=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "define": "TGT_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + { + "language": "CXX", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "isSystem": True, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 11, + "command": "target_include_directories", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "defines": [ + { + "define": "GENERATED_EXE=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "define": "TGT_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + ], + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^generated_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "backtrace": None, + }, + ], + }, + ] + + if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")): + for e in expected: + try: + e["link"]["lto"] = None + except TypeError: # "link" is not a dict, no problem. + pass + try: + e["archive"]["lto"] = None + except TypeError: # "archive" is not a dict, no problem. + pass + + if inSource: + for e in expected: + if e["sources"] is not None: + for s in e["sources"]: + s["path"] = s["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) + if e["sourceGroups"] is not None: + for g in e["sourceGroups"]: + g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]] + if e["compileGroups"] is not None: + for g in e["compileGroups"]: + g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]] + + if matches(g, "^Visual Studio "): + expected = filter_list(lambda e: e["name"] not in ("ZERO_CHECK") or e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$", expected) + for e in expected: + if e["type"] == "UTILITY": + if e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$": + e["sources"] = [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ] + e["sourceGroups"] = [ + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", + ], + }, + ] + elif e["name"] in ("ALL_BUILD"): + e["sources"] = [] + e["sourceGroups"] = None + if e["dependencies"] is not None: + for d in e["dependencies"]: + if matches(d["id"], "^\\^ZERO_CHECK::@"): + d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$" + + elif g == "Xcode": + if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""): + expected = filter_list(lambda e: e["name"] not in ("link_imported_object_exe"), expected) + for e in expected: + e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^link_imported_object_exe::@"), e["dependencies"]) + if e["name"] in ("c_object_lib", "cxx_object_lib"): + e["artifacts"] = None + + else: + for e in expected: + e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^ZERO_CHECK::@"), e["dependencies"]) + + expected = filter_list(lambda t: t["name"] not in ("ALL_BUILD", "ZERO_CHECK"), expected) + + if sys.platform not in ("win32", "cygwin", "msys"): + for e in expected: + e["artifacts"] = filter_list(lambda a: not a["_dllExtra"], e["artifacts"]) + + return expected + +def check_targets(c, g, inSource): + check_list_match(lambda a, e: matches(a["id"], e["id"]), + c["targets"], gen_check_targets(c, g, inSource), + check=check_target(c), + check_exception=lambda a, e: "Target ID: %s" % a["id"], + missing_exception=lambda e: "Target ID: %s" % e["id"], + extra_exception=lambda a: "Target ID: %s" % a["id"]) + +def gen_check_projects(c, g): + expected = [ + { + "name": "codemodel-v2", + "parentName": None, + "childNames": [ + "Alias", + "Custom", + "Cxx", + "Imported", + "Object", + "External", + ], + "directorySources": [ + "^\\.$", + "^dir$", + "^dir/dir$", + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$", + ], + }, + { + "name": "Cxx", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^cxx$", + ], + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$", + ], + }, + { + "name": "Alias", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^alias$", + ], + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$", + ], + }, + { + "name": "Object", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^object$", + ], + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + ], + }, + { + "name": "Imported", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^imported$", + ], + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + ], + }, + { + "name": "Custom", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^custom$", + ], + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$", + ], + }, + { + "name": "External", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^.*/Tests/RunCMake/FileAPIExternalSource$", + ], + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$", + ], + }, + ] + + if matches(g, "^Visual Studio "): + for e in expected: + if e["parentName"] is not None: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"]) + + elif g == "Xcode": + if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""): + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"]) + + else: + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(ALL_BUILD|ZERO_CHECK)"), e["targetIds"]) + + return expected + +def check_projects(c, g): + check_list_match(lambda a, e: is_string(a["name"], e["name"]), c["projects"], gen_check_projects(c, g), + check=check_project(c), + check_exception=lambda a, e: "Project name: %s" % a["name"], + missing_exception=lambda e: "Project name: %s" % e["name"], + extra_exception=lambda a: "Project name: %s" % a["name"]) + +def check_object_codemodel_configuration(c, g, inSource): + assert sorted(c.keys()) == ["directories", "name", "projects", "targets"] + assert is_string(c["name"]) + check_directories(c, g) + check_targets(c, g, inSource) + check_projects(c, g) + +def check_object_codemodel(g): + def _check(o): + assert sorted(o.keys()) == ["configurations", "kind", "paths", "version"] + # The "kind" and "version" members are handled by check_index_object. + assert is_dict(o["paths"]) + assert sorted(o["paths"].keys()) == ["build", "source"] + assert matches(o["paths"]["build"], "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build$") + assert matches(o["paths"]["source"], "^.*/Tests/RunCMake/FileAPI$") + + inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"] + + if matches(g, "^(Visual Studio |Xcode$)"): + assert sorted([c["name"] for c in o["configurations"]]) == ["Debug", "MinSizeRel", "RelWithDebInfo", "Release"] + else: + assert len(o["configurations"]) == 1 + assert o["configurations"][0]["name"] in ("", "Debug", "Release", "RelWithDebInfo", "MinSizeRel") + + for c in o["configurations"]: + check_object_codemodel_configuration(c, g, inSource) + return _check + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"], index["cmake"]["generator"]["name"]) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake new file mode 100644 index 0000000..72073d5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake @@ -0,0 +1,35 @@ +enable_language(C) + +include("${CMAKE_CURRENT_LIST_DIR}/include_test.cmake") + +add_library(c_lib empty.c) +add_executable(c_exe empty.c) +target_link_libraries(c_exe PRIVATE c_lib) + +add_library(c_shared_lib SHARED empty.c) +add_executable(c_shared_exe empty.c) +target_link_libraries(c_shared_exe PRIVATE c_shared_lib) + +add_library(c_static_lib STATIC empty.c) +add_executable(c_static_exe empty.c) +target_link_libraries(c_static_exe PRIVATE c_static_lib) + +add_subdirectory(cxx) +add_subdirectory(alias) +add_subdirectory(object) +add_subdirectory(imported) +add_subdirectory(custom) +add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild") +add_subdirectory(dir) + +set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) +set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib) + +include(CheckIPOSupported) +check_ipo_supported(RESULT _ipo LANGUAGES C) +if(_ipo) + set_property(TARGET c_shared_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) + set_property(TARGET c_shared_exe PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) + set_property(TARGET c_static_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) + file(WRITE "${CMAKE_BINARY_DIR}/ipo_enabled.txt" "") +endif() diff --git a/Tests/RunCMake/FileAPI/custom/CMakeLists.txt b/Tests/RunCMake/FileAPI/custom/CMakeLists.txt new file mode 100644 index 0000000..1cdf5c2 --- /dev/null +++ b/Tests/RunCMake/FileAPI/custom/CMakeLists.txt @@ -0,0 +1,5 @@ +project(Custom) + +add_custom_target(custom_tgt COMMAND ${CMAKE_COMMAND} -E echo "Building custom_tgt") +add_executable(custom_exe ../empty.c) +add_dependencies(custom_exe custom_tgt) diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt new file mode 100644 index 0000000..29b61b8 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt @@ -0,0 +1,15 @@ +project(Cxx) +enable_language(CXX) + +add_library(cxx_lib ../empty.cxx) +add_executable(cxx_exe ../empty.cxx) +target_link_libraries(cxx_exe PRIVATE cxx_lib) +set_property(TARGET cxx_exe PROPERTY FOLDER bin) + +add_library(cxx_shared_lib SHARED ../empty.cxx) +add_executable(cxx_shared_exe ../empty.cxx) +target_link_libraries(cxx_shared_exe PRIVATE cxx_shared_lib) + +add_library(cxx_static_lib STATIC ../empty.cxx) +add_executable(cxx_static_exe ../empty.cxx) +target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib) diff --git a/Tests/RunCMake/FileAPI/dir/CMakeLists.txt b/Tests/RunCMake/FileAPI/dir/CMakeLists.txt new file mode 100644 index 0000000..780445d --- /dev/null +++ b/Tests/RunCMake/FileAPI/dir/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(dir) diff --git a/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt b/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt diff --git a/Tests/RunCMake/FileAPI/dir/dirtest.cmake b/Tests/RunCMake/FileAPI/dir/dirtest.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/dir/dirtest.cmake diff --git a/Tests/RunCMake/FileAPI/empty.c b/Tests/RunCMake/FileAPI/empty.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/empty.c diff --git a/Tests/RunCMake/FileAPI/empty.cxx b/Tests/RunCMake/FileAPI/empty.cxx new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/empty.cxx diff --git a/Tests/RunCMake/FileAPI/imported/CMakeLists.txt b/Tests/RunCMake/FileAPI/imported/CMakeLists.txt new file mode 100644 index 0000000..d36d88b --- /dev/null +++ b/Tests/RunCMake/FileAPI/imported/CMakeLists.txt @@ -0,0 +1,24 @@ +project(Imported) + +add_library(imported_lib UNKNOWN IMPORTED) +add_executable(imported_exe IMPORTED) +add_executable(link_imported_exe ../empty.c) +target_link_libraries(link_imported_exe PRIVATE imported_lib) + +add_library(imported_shared_lib SHARED IMPORTED) +add_executable(link_imported_shared_exe ../empty.c) +target_link_libraries(link_imported_shared_exe PRIVATE imported_shared_lib) + +add_library(imported_static_lib STATIC IMPORTED) +add_executable(link_imported_static_exe ../empty.c) +target_link_libraries(link_imported_static_exe PRIVATE imported_static_lib) + +if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]") + add_library(imported_object_lib OBJECT IMPORTED) + add_executable(link_imported_object_exe ../empty.c) + target_link_libraries(link_imported_object_exe PRIVATE imported_object_lib) +endif() + +add_library(imported_interface_lib INTERFACE IMPORTED) +add_executable(link_imported_interface_exe ../empty.c) +target_link_libraries(link_imported_interface_exe PRIVATE imported_interface_lib) diff --git a/Tests/RunCMake/FileAPI/include_test.cmake b/Tests/RunCMake/FileAPI/include_test.cmake new file mode 100644 index 0000000..c74d264 --- /dev/null +++ b/Tests/RunCMake/FileAPI/include_test.cmake @@ -0,0 +1,9 @@ +add_library(interface_lib INTERFACE) +target_compile_definitions(interface_lib INTERFACE COMPILED_WITH_INTERFACE_LIB) +add_executable(interface_exe empty.c) +target_link_libraries(interface_exe PRIVATE inteface_lib) +set_property(TARGET interface_exe PROPERTY ENABLE_EXPORTS ON) +set_property(TARGET interface_exe PROPERTY RUNTIME_OUTPUT_DIRECTORY bin) +set_property(TARGET interface_exe PROPERTY ARCHIVE_OUTPUT_DIRECTORY lib) +set_property(TARGET interface_exe PROPERTY OUTPUT_NAME my_interface_exe) +set_property(TARGET interface_exe PROPERTY SUFFIX .myexe) diff --git a/Tests/RunCMake/FileAPI/object/CMakeLists.txt b/Tests/RunCMake/FileAPI/object/CMakeLists.txt new file mode 100644 index 0000000..9773b81 --- /dev/null +++ b/Tests/RunCMake/FileAPI/object/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.13) +project(Object) +enable_language(CXX) + +add_library(c_object_lib OBJECT ../empty.c) +add_executable(c_object_exe ../empty.c) +target_link_libraries(c_object_exe PRIVATE c_object_lib) + +add_library(cxx_object_lib OBJECT ../empty.cxx) +add_executable(cxx_object_exe ../empty.cxx) +target_link_libraries(cxx_object_exe PRIVATE cxx_object_lib) + +install(TARGETS c_object_exe cxx_object_exe DESTINATION bin) diff --git a/Tests/RunCMake/FileAPIDummyFile.cmake b/Tests/RunCMake/FileAPIDummyFile.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPIDummyFile.cmake diff --git a/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt new file mode 100644 index 0000000..f5670a7 --- /dev/null +++ b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt @@ -0,0 +1,12 @@ +project(External) +enable_language(CXX) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" "") +add_executable(generated_exe empty.c) +target_sources(generated_exe PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx") +source_group("Generated Source Files" FILES "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx") +set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" PROPERTY GENERATED ON) +set_property(SOURCE empty.c PROPERTY COMPILE_DEFINITIONS EMPTY_C=1 SRC_DUMMY) +set_property(SOURCE empty.c PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}") +target_include_directories(generated_exe SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_compile_definitions(generated_exe PRIVATE GENERATED_EXE=1 -DTGT_DUMMY) diff --git a/Tests/RunCMake/FileAPIExternalSource/empty.c b/Tests/RunCMake/FileAPIExternalSource/empty.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPIExternalSource/empty.c diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake index c73732f..6ca33b8 100644 --- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake +++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake @@ -45,6 +45,7 @@ run_object_lib_build2(LinkObjRHSObject) run_object_lib_build(LinkObjRHSShared2) run_object_lib_build(LinkObjRHSStatic2) run_object_lib_build2(LinkObjRHSObject2) +run_object_lib_build(TransitiveDependencies) run_cmake(MissingSource) run_cmake(ObjWithObj) diff --git a/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake new file mode 100644 index 0000000..e41cf2e --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake @@ -0,0 +1,7 @@ +add_library(lib1 STATIC depends_obj0.c) +add_library(lib2 OBJECT a.c) +target_link_libraries(lib2 PRIVATE lib1) + +add_executable(test exe2.c) + +target_link_libraries(test PUBLIC lib2) diff --git a/Tests/RunCMake/ObjectLibrary/exe2.c b/Tests/RunCMake/ObjectLibrary/exe2.c new file mode 100644 index 0000000..66e0caf --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/exe2.c @@ -0,0 +1,6 @@ +extern int myobj_foo(void); + +int main(void) +{ + return myobj_foo(); +} diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index c076ad9..4bacd96 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -45,6 +45,11 @@ function(run_cmake test) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") endif() file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + if(RunCMake-prep-file AND EXISTS ${top_src}/${RunCMake-prep-file}) + include(${top_src}/${RunCMake-prep-file}) + else() + include(${top_src}/${test}-prep.cmake OPTIONAL) + endif() if(NOT DEFINED RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS "") endif() diff --git a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt index f0ed577..d89d174 100644 --- a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt +++ b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt @@ -4,7 +4,7 @@ CMake Warning \(dev\) at .*/Modules/UseSWIG\.cmake:[0-9]+ \(message\): command to set the policy and suppress this warning\. Call Stack \(most recent call first\): - CMP0078-common\.cmake:6 \(swig_add_library\) + CMP0078-common\.cmake:8 \(swig_add_library\) CMP0078-WARN\.cmake:1 \(include\) CMakeLists\.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/UseSWIG/CMP0078-common.cmake b/Tests/RunCMake/UseSWIG/CMP0078-common.cmake index 6cf39dc..b13796b 100644 --- a/Tests/RunCMake/UseSWIG/CMP0078-common.cmake +++ b/Tests/RunCMake/UseSWIG/CMP0078-common.cmake @@ -1,4 +1,6 @@ +cmake_policy(SET CMP0086 NEW) + set(SWIG_EXECUTABLE "swig") set(SWIG_DIR "/swig") include(UseSWIG) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake b/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake new file mode 100644 index 0000000..ea8b2cd --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake @@ -0,0 +1,4 @@ + +if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/new_example.py") + set (RunCMake_TEST_FAILED "Not found expected file: '${RunCMake_TEST_BINARY_DIR}/new_example.py'.") +endif() diff --git a/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake b/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake new file mode 100644 index 0000000..b54338d --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0086 NEW) +include(CMP0086-common.cmake) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake b/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake new file mode 100644 index 0000000..96b5295 --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake @@ -0,0 +1,4 @@ + +if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/example.py") + set (RunCMake_TEST_FAILED "Not found expected file: '${RunCMake_TEST_BINARY_DIR}/example.py'.") +endif() diff --git a/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake b/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake new file mode 100644 index 0000000..6a63d4c --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0086 OLD) +include(CMP0086-common.cmake) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt new file mode 100644 index 0000000..af41021 --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt @@ -0,0 +1,11 @@ +CMake Warning \(dev\) at .*/Modules/UseSWIG.cmake:[0-9]+ \(message\): + Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module + flag. Run "cmake --help-policy CMP0086" for policy details\. Use the + cmake_policy command to set the policy and suppress this warning\. + +Call Stack \(most recent call first\): + .*/Modules/UseSWIG.cmake:[0-9]+ \(SWIG_ADD_SOURCE_TO_MODULE\) + CMP0086-common\.cmake:[0-9]+ \(swig_add_library\) + CMP0086-WARN\.cmake:1 \(include\) + CMakeLists\.txt:3 \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake b/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake new file mode 100644 index 0000000..69c2d9d --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake @@ -0,0 +1 @@ +include(CMP0086-common.cmake) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-common.cmake b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake new file mode 100644 index 0000000..c02592a --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake @@ -0,0 +1,11 @@ + +cmake_policy(SET CMP0078 NEW) + +find_package(Python REQUIRED COMPONENTS Development) +find_package (SWIG REQUIRED) +include(UseSWIG) + +set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example") + +swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i) +target_link_libraries(example PRIVATE Python::Python) diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake index b96622a..6acf719 100644 --- a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake +++ b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake @@ -3,3 +3,23 @@ include(RunCMake) run_cmake(CMP0078-WARN) run_cmake(CMP0078-OLD) run_cmake(CMP0078-NEW) + +run_cmake(CMP0086-WARN) + +if (CMake_TEST_FindPython) + + macro(run_cmake_target test subtest target) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN}) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + endmacro() + + run_cmake(CMP0086-OLD) + run_cmake_target(CMP0086-OLD build example) + run_cmake(CMP0086-NEW) + run_cmake_target(CMP0086-NEW build example) + +endif() diff --git a/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in b/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in index fe6f6ce..53bdd20 100644 --- a/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in +++ b/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in @@ -1,8 +1,6 @@ set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) @CTEST_EXTRA_CONFIG@ diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt deleted file mode 100644 index 00a60ac..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -Missing arguments for submit via cp: -.* - Problems when submitting via CP diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt deleted file mode 100644 index fa6e004..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using cp\) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt deleted file mode 100644 index b9d9394..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*) - Problems when submitting via FTP diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt deleted file mode 100644 index 345bb62..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -Submit files \(using ftp\) - Using FTP submit method - Drop site: ftp:// diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt deleted file mode 100644 index ef67149..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt +++ /dev/null @@ -1 +0,0 @@ - Problems when submitting via SCP diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt deleted file mode 100644 index ec2ce92..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using scp\) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt deleted file mode 100644 index c0f718e..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt +++ /dev/null @@ -1 +0,0 @@ - (Problems when submitting via XML-RPC|Submission method "xmlrpc" not compiled into CTest!) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt deleted file mode 100644 index ed2acb5..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using xmlrpc\) diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index 178f0cb..4d7d29b 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -49,9 +49,5 @@ function(run_ctest_submit_FailDrop CASE_DROP_METHOD) run_ctest(FailDrop-${CASE_DROP_METHOD}) endfunction() -run_ctest_submit_FailDrop(cp) -run_ctest_submit_FailDrop(ftp) run_ctest_submit_FailDrop(http) run_ctest_submit_FailDrop(https) -run_ctest_submit_FailDrop(scp) -run_ctest_submit_FailDrop(xmlrpc) diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt b/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt b/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt new file mode 100644 index 0000000..32b3e85 --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at READ_SYMLINK-noexist\.cmake:[0-9]+ \(file\): + file READ_SYMLINK requested of path that is not a symlink: + + .*/Tests/RunCMake/file/READ_SYMLINK-noexist-build/rel\.sym +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake b/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake new file mode 100644 index 0000000..9e57e4b --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake @@ -0,0 +1 @@ +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result) diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt new file mode 100644 index 0000000..63e32ed --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at READ_SYMLINK-notsymlink\.cmake:[0-9]+ \(file\): + file READ_SYMLINK requested of path that is not a symlink: + + .*/Tests/RunCMake/file/READ_SYMLINK-notsymlink-build/rel\.sym +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake b/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake new file mode 100644 index 0000000..a9798b6 --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake @@ -0,0 +1,2 @@ +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" "") +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result) diff --git a/Tests/RunCMake/file/READ_SYMLINK.cmake b/Tests/RunCMake/file/READ_SYMLINK.cmake new file mode 100644 index 0000000..865a2e9 --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK.cmake @@ -0,0 +1,13 @@ +execute_process(COMMAND + ${CMAKE_COMMAND} -E create_symlink "test.txt" "${CMAKE_CURRENT_BINARY_DIR}/rel.sym") +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result) +if(NOT result STREQUAL "test.txt") + message(SEND_ERROR "Relative symlink is \"${result}\", should be \"test.txt\"") +endif() + +execute_process(COMMAND + ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_BINARY_DIR}/test.txt" "${CMAKE_CURRENT_BINARY_DIR}/abs.sym") +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/abs.sym" result) +if(NOT result MATCHES "^.*/Tests/RunCMake/file/READ_SYMLINK-build/test\\.txt$") + message(SEND_ERROR "Absolute symlink is \"${result}\", should be \"*/Tests/RunCMake/file/READ_SYMLINK-build/test.txt\"") +endif() diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index b9d76bf..b872824 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -55,6 +55,9 @@ run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P if(NOT WIN32 OR CYGWIN) run_cmake(GLOB_RECURSE-cyclic-recursion) run_cmake(INSTALL-SYMLINK) + run_cmake(READ_SYMLINK) + run_cmake(READ_SYMLINK-noexist) + run_cmake(READ_SYMLINK-notsymlink) endif() if(RunCMake_GENERATOR STREQUAL "Ninja") diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt b/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt index b797a41..842cf89 100644 --- a/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt +++ b/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt @@ -1,5 +1,6 @@ ^CMake Error at SIZE-error-does-not-exist.cmake:[0-9]+ \(file\): - file SIZE requested of path that is not readable - /a/file/that/does-not-exist + file SIZE requested of path that is not readable: + + .*/Tests/RunCMake/file/SIZE-error-does-not-exist-build/does-not-exist Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake b/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake index edcc222..ebac737 100644 --- a/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake +++ b/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake @@ -1,3 +1,3 @@ -set(file "/a/file/that/does-not-exist") +set(file "${CMAKE_CURRENT_BINARY_DIR}/does-not-exist") file(SIZE "${file}" CALCULATED_SIZE) diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt index 4c3d901..f79cda6 100644 --- a/Tests/UseSWIG/CMakeLists.txt +++ b/Tests/UseSWIG/CMakeLists.txt @@ -96,6 +96,18 @@ add_test(NAME UseSWIG.UseTargetINCLUDE_DIRECTORIES COMMAND "${CMake_SOURCE_DIR}/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES" "${CMake_BINARY_DIR}/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES" ${build_generator_args} - --build-project TestModuleVersion2 + --build-project TestUseTargetINCLUDE_DIRECTORIES --build-options ${build_options} ) + + +add_test(NAME UseSWIG.ModuleName COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleName" + "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleName" + ${build_generator_args} + --build-project TestModuleName + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/UseSWIG/ModuleName/CMakeLists.txt b/Tests/UseSWIG/ModuleName/CMakeLists.txt new file mode 100644 index 0000000..de63883 --- /dev/null +++ b/Tests/UseSWIG/ModuleName/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.1...3.14) + +project(TestModuleName CXX) + +include(CTest) + +find_package(SWIG REQUIRED) +cmake_policy(SET CMP0086 NEW) +include(${SWIG_USE_FILE}) + +find_package(Python2 REQUIRED COMPONENTS Interpreter Development) + +# Path separator +if (WIN32) + set (PS "$<SEMICOLON>") +else() + set (PS ":") +endif() + +unset(CMAKE_SWIG_FLAGS) + +set_property(SOURCE "example.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "example.i" PROPERTY COMPILE_OPTIONS -includeall) +set_property(SOURCE "example.i" PROPERTY SWIG_MODULE_NAME new_example) + +swig_add_library(example1 + LANGUAGE python + OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/example1" + SOURCES example.i ../example.cxx) +set_target_properties (example1 PROPERTIES + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/.." + SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE + OUTPUT_NAME new_example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") +target_link_libraries(example1 PRIVATE Python2::Python) + + +add_test (NAME ModuleName.example1 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/Python2${PS}$<TARGET_FILE_DIR:example1>" + "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py") diff --git a/Tests/UseSWIG/ModuleName/example.i b/Tests/UseSWIG/ModuleName/example.i new file mode 100644 index 0000000..fbdf724 --- /dev/null +++ b/Tests/UseSWIG/ModuleName/example.i @@ -0,0 +1,9 @@ +/* File : example.i */ +%module example + +%{ +#include "example.h" +%} + +/* Let's just grab the original header file here */ +%include "example.h" diff --git a/Tests/UseSWIG/ModuleName/runme.py b/Tests/UseSWIG/ModuleName/runme.py new file mode 100644 index 0000000..c37e4a7 --- /dev/null +++ b/Tests/UseSWIG/ModuleName/runme.py @@ -0,0 +1,52 @@ +# file: runme.py + +# This file illustrates the shadow-class C++ interface generated +# by SWIG. + +from __future__ import print_function + +import new_example + +# ----- Object creation ----- + +print ("Creating some objects:") +c = new_example.Circle(10) +print (" Created circle", c) +s = new_example.Square(10) +print (" Created square", s) + +# ----- Access a static member ----- + +print ("\nA total of", new_example.cvar.Shape_nshapes,"shapes were created") + +# ----- Member data access ----- + +# Set the location of the object + +c.x = 20 +c.y = 30 + +s.x = -10 +s.y = 5 + +print ("\nHere is their current position:") +print (" Circle = (%f, %f)" % (c.x,c.y)) +print (" Square = (%f, %f)" % (s.x,s.y)) + +# ----- Call some methods ----- + +print ("\nHere are some properties of the shapes:") +for o in [c,s]: + print (" ", o) + print (" area = ", o.area()) + print (" perimeter = ", o.perimeter()) + +print ("\nGuess I'll clean up now") + +# Note: this invokes the virtual destructor +del c +del s + +s = 3 +print (new_example.cvar.Shape_nshapes,"shapes remain") +print ("Goodbye") |