From 628b27e11ba1264cfc7b7e37b3850c55e6926fc9 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 17:34:28 -0700 Subject: [PATCH 01/10] Add missing () on function block doc (#597) --- tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake b/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake index 588ee720b..8681324c9 100644 --- a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake +++ b/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake @@ -106,7 +106,7 @@ function(tribits_git_repo_sha1 gitRepoDir gitRepoSha1Out) endfunction() -# @FUNCTION: tribits_generate_single_repo_version_string +# @FUNCTION: tribits_generate_single_repo_version_string() # # Get the formatted string containing the current git repo version. # From ce4728b0ac85189f0176b8bf0d234984f436314a Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 17:51:35 -0700 Subject: [PATCH 02/10] Switch to one_value_keywords for INCLUDE_COMMIT_PARENTS (#597) This allows the calling code to be more compact. Since this function is not really called by any external users (perhaps ever), this seems like a good trade-off. --- .../package_arch/TribitsGitRepoVersionInfo.cmake | 8 ++++---- .../core/package_arch/TribitsGlobalMacros.cmake | 15 +++++---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake b/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake index 8681324c9..f7b20ff5b 100644 --- a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake +++ b/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake @@ -113,9 +113,9 @@ endfunction() # Usage: # # tribits_generate_single_repo_version_string( -# INCLUDE_PARENT_COMMITS [ON|OFF]) +# [INCLUDE_PARENT_COMMITS ON|OFF]) # -# If the optional argument ``INCLUDE_PARENT_COMMITS`` is passed, +# If the optional argument ``INCLUDE_PARENT_COMMITS `` is passed, # then the head commit's parent(s) info will be be included in # the repo version output string formatted. # @@ -124,8 +124,8 @@ function(tribits_generate_single_repo_version_string gitRepoDir ) cmake_parse_arguments( PARSE_ARGV 2 - PARSE "INCLUDE_COMMIT_PARENTS" # prefix, optional - "" "" # one_value_keywords, multi_value_keyword + PARSE "" # prefix, optional + "INCLUDE_COMMIT_PARENTS" "" # one_value_keywords, multi_value_keyword ) tribits_check_for_unparsed_arguments() tribits_assert_parse_arg_zero_or_one_value(PARSE INCLUDE_COMMIT_PARENTS) diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 739d1a53d..aeecaaf72 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -1219,14 +1219,9 @@ function(tribits_generate_repo_version_file_string PROJECT_REPO_VERSION_FILE_ST set(REPO_VERSION_FILE_STR "") - if (${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) - tribits_generate_single_repo_version_string( - ${CMAKE_CURRENT_SOURCE_DIR} - SINGLE_REPO_VERSION INCLUDE_COMMIT_PARENTS) - else() - tribits_generate_single_repo_version_string( - ${CMAKE_CURRENT_SOURCE_DIR} SINGLE_REPO_VERSION) - endif() + tribits_generate_single_repo_version_string( + ${CMAKE_CURRENT_SOURCE_DIR} SINGLE_REPO_VERSION + INCLUDE_COMMIT_PARENTS ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) string(APPEND REPO_VERSION_FILE_STR "*** Base Git Repo: ${PROJECT_NAME}\n" "${SINGLE_REPO_VERSION}\n" ) @@ -1249,8 +1244,8 @@ function(tribits_generate_repo_version_file_string PROJECT_REPO_VERSION_FILE_ST #print_var(EXTRAREPO_DIR) tribits_generate_single_repo_version_string( - "${CMAKE_CURRENT_SOURCE_DIR}/${EXTRAREPO_DIR}" - SINGLE_REPO_VERSION) + "${CMAKE_CURRENT_SOURCE_DIR}/${EXTRAREPO_DIR}" SINGLE_REPO_VERSION + INCLUDE_COMMIT_PARENTS ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) string(APPEND REPO_VERSION_FILE_STR "*** Git Repo: ${EXTRAREPO_DIR}\n" "${SINGLE_REPO_VERSION}\n" ) From 1548b6f34c9125e503bcbf34bd28685967fe2341 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 18:06:11 -0700 Subject: [PATCH 03/10] Speed up Git version info test by setting _TRACE_DEPENDENCY_HANDLING_ONLY=ON (#597) This spead up these tests on my machine 'crf450' from about 3.4 sec to about 0.45 sec. We don't need to enable the compilers and process the package CMakeLists.txt files to test this version info. --- test/core/ExamplesUnitTests/TribitsHelloWorld_Tests.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/core/ExamplesUnitTests/TribitsHelloWorld_Tests.cmake b/test/core/ExamplesUnitTests/TribitsHelloWorld_Tests.cmake index 1da097ed0..cc20316c8 100644 --- a/test/core/ExamplesUnitTests/TribitsHelloWorld_Tests.cmake +++ b/test/core/ExamplesUnitTests/TribitsHelloWorld_Tests.cmake @@ -66,6 +66,7 @@ tribits_add_advanced_test( TribitsHelloWorld_config_git_version_single_repo_one_ -DTribitsHelloWorld_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} -DTribitsHelloWorld_ENABLE_TESTS=ON -DTribitsHelloWorld_GENERATE_REPO_VERSION_FILE=ON + -DTribitsHelloWorld_TRACE_DEPENDENCY_HANDLING_ONLY=ON -DGIT_EXECUTABLE=${${PROJECT_NAME}_TRIBITS_DIR}/python_utils/mockprogram.py ../TribitsHelloWorld PASS_REGULAR_EXPRESSION_ALL @@ -122,6 +123,7 @@ tribits_add_advanced_test( TribitsHelloWorld_config_git_version_single_repo_two_ -DTribitsHelloWorld_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} -DTribitsHelloWorld_ENABLE_TESTS=ON -DTribitsHelloWorld_GENERATE_REPO_VERSION_FILE=ON + -DTribitsHelloWorld_TRACE_DEPENDENCY_HANDLING_ONLY=ON -DTribitsHelloWorld_SHOW_GIT_COMMIT_PARENTS=ON -DGIT_EXECUTABLE=${${PROJECT_NAME}_TRIBITS_DIR}/python_utils/mockprogram.py ../TribitsHelloWorld From 3aa1ea841f1f75f23eed8417c899e04620fd78e6 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 18:26:42 -0700 Subject: [PATCH 04/10] Document _TRACE_DEPENDENCY_HANDLING_ONLY (#597) This is a variable that project developers and users should know about. --- .../doc/build_ref/TribitsBuildReferenceBody.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index 92817594c..3ab4ce13f 100644 --- a/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/tribits/doc/build_ref/TribitsBuildReferenceBody.rst @@ -376,6 +376,7 @@ See the following use cases: * `Enable all packages (and optionally all tests)`_ * `Disable a package and all its dependencies`_ * `Remove all package enables in the cache`_ +* `Speed up debugging dependency handling`_ Determine the list of packages that can be enabled @@ -656,6 +657,22 @@ For example, one would want to do this to avoid more expensive compiler and TPL checks. +Speed up debugging dependency handling ++++++++++++++++++++++++++++++++++++++++ + +To speed up debugging the package enable/disable dependency handling, set the +cache variable:: + + -D _TRACE_DEPENDENCY_HANDLING_ONLY=ON + +This will result in only performing the package enable/disable dependency +handling logic and tracing what would be done to configure the compilers and +configure the various enabled packages but not actually do that work. This +can greatly speed up the time to complete the ``cmake`` configure command when +debugging the dependency handling (or when creating tests that check that +behavior). + + Selecting compiler and linker options ------------------------------------- From b9e7d10618bd0fdc6dc6afdf485221be00eff318 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 18:36:45 -0700 Subject: [PATCH 05/10] Refactor tribits_generate_repo_version_file_string() naming and cleanup (#597) Using camelCase for local vars helps to differentiate from UPPER_CACHE vars for function argument keywords and global vars. I figured I would clean this function up while I was working on it. Now this fits in one screen-shot for me. --- .../package_arch/TribitsGlobalMacros.cmake | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index aeecaaf72..60eb5ba10 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -1215,48 +1215,41 @@ endmacro() # Get the versions of all the git repos # -function(tribits_generate_repo_version_file_string PROJECT_REPO_VERSION_FILE_STRING_OUT) +function(tribits_generate_repo_version_file_string projectRepoVersionFileStrOut) - set(REPO_VERSION_FILE_STR "") + set(projectRepoVersionFileStr "") tribits_generate_single_repo_version_string( - ${CMAKE_CURRENT_SOURCE_DIR} SINGLE_REPO_VERSION + ${CMAKE_CURRENT_SOURCE_DIR} singleRepoVersionStr INCLUDE_COMMIT_PARENTS ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) - string(APPEND REPO_VERSION_FILE_STR + string(APPEND projectRepoVersionFileStr "*** Base Git Repo: ${PROJECT_NAME}\n" - "${SINGLE_REPO_VERSION}\n" ) + "${singleRepoVersionStr}\n" ) - set(EXTRAREPO_IDX 0) - foreach(EXTRA_REPO ${${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES}) - - #print_var(EXTRA_REPO) - #print_var(EXTRAREPO_IDX) - #print_var(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS) + set(extraRepoIdx 0) + foreach(extraRepo ${${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES}) if (${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS) # Read from an extra repo file with potentially different dir. - list(GET ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS ${EXTRAREPO_IDX} - EXTRAREPO_DIR ) + list(GET ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS ${extraRepoIdx} + extraRepoDir ) else() # Not read from extra repo file so dir is same as name - set(EXTRAREPO_DIR ${EXTRA_REPO}) + set(extraRepoDir ${extraRepo}) endif() - #print_var(EXTRAREPO_DIR) tribits_generate_single_repo_version_string( - "${CMAKE_CURRENT_SOURCE_DIR}/${EXTRAREPO_DIR}" SINGLE_REPO_VERSION + "${CMAKE_CURRENT_SOURCE_DIR}/${extraRepoDir}" singleRepoVersionStr INCLUDE_COMMIT_PARENTS ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) - string(APPEND REPO_VERSION_FILE_STR - "*** Git Repo: ${EXTRAREPO_DIR}\n" - "${SINGLE_REPO_VERSION}\n" ) - - #print_var(REPO_VERSION_FILE_STR) + string(APPEND projectRepoVersionFileStr + "*** Git Repo: ${extraRepoDir}\n" + "${singleRepoVersionStr}\n" ) - math(EXPR EXTRAREPO_IDX "${EXTRAREPO_IDX}+1") + math(EXPR extraRepoIdx "${extraRepoIdx}+1") endforeach() - set(${PROJECT_REPO_VERSION_FILE_STRING_OUT} ${REPO_VERSION_FILE_STR} PARENT_SCOPE) + set(${projectRepoVersionFileStrOut} ${projectRepoVersionFileStr} PARENT_SCOPE) endfunction() @@ -1268,17 +1261,17 @@ endfunction() # function(tribits_generate_repo_version_output_and_file) # Get the repos versions - tribits_generate_repo_version_file_string(PROJECT_REPO_VERSION_FILE_STRING) + tribits_generate_repo_version_file_string(projectRepoVersionFileStr) # Print the versions message("\n${PROJECT_NAME} repos versions:\n" "--------------------------------------------------------------------------------\n" - "${PROJECT_REPO_VERSION_FILE_STRING}" + "${projectRepoVersionFileStr}" " --------------------------------------------------------------------------------\n" ) #) Write out the version file file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_REPO_VERSION_FILE_NAME}" - "${PROJECT_REPO_VERSION_FILE_STRING}") + "${projectRepoVersionFileStr}") endfunction() From e30b76e49b5ce275fe2ecb9b62387b25695d91a5 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 18:44:13 -0700 Subject: [PATCH 06/10] Move TribitsGitRepoVersionInfo.cmake from core/package_arch/ to core/utils/ (#597) I noticed that this module does not depend on the TriBITS framework in any way so it should live under the core/utils/ directory to make that clear and to allow easy reuse in non-TriBITS projects that would like to use it. --- tribits/core/package_arch/TribitsGlobalMacros.cmake | 3 ++- .../{package_arch => utils}/TribitsGitRepoVersionInfo.cmake | 0 tribits/ctest_driver/TribitsAddDashboardTarget.cmake | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename tribits/core/{package_arch => utils}/TribitsGitRepoVersionInfo.cmake (100%) diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 60eb5ba10..1830ef076 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -39,6 +39,8 @@ # Standard TriBITS system includes +include("${CMAKE_CURRENT_LIST_DIR}/../utils/TribitsGitRepoVersionInfo.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsConstants.cmake") include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsTestCategories.cmake") @@ -53,7 +55,6 @@ include(TribitsGetVersionDate) include(TribitsReportInvalidTribitsUsage) include(TribitsReadAllProjectDepsFilesCreateDepsGraph) include(TribitsAdjustPackageEnables) -include(TribitsGitRepoVersionInfo) include(TribitsSetUpEnabledOnlyDependencies) include(TribitsConfigureTiming) diff --git a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake b/tribits/core/utils/TribitsGitRepoVersionInfo.cmake similarity index 100% rename from tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake rename to tribits/core/utils/TribitsGitRepoVersionInfo.cmake diff --git a/tribits/ctest_driver/TribitsAddDashboardTarget.cmake b/tribits/ctest_driver/TribitsAddDashboardTarget.cmake index 52851ce3c..6b60d3912 100644 --- a/tribits/ctest_driver/TribitsAddDashboardTarget.cmake +++ b/tribits/ctest_driver/TribitsAddDashboardTarget.cmake @@ -45,7 +45,7 @@ # ################################################################################ -include(TribitsGitRepoVersionInfo) +include("${CMAKE_CURRENT_LIST_DIR}/../core/utils/TribitsGitRepoVersionInfo.cmake") # # Macro that drives a experimental 'dashboard' target From 3bed1f945b5b419d5a5587e2ac28a6d836a8595c Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 23 Jan 2024 18:53:12 -0700 Subject: [PATCH 07/10] Use tribits_advanced_set_cache_var_and_default() for _SHOW_GIT_COMMIT_PARENTS (#597) We eventually need to use this for all of those vars to make that code more compact. --- tribits/core/package_arch/TribitsGlobalMacros.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 1830ef076..83c60cd5b 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -686,13 +686,8 @@ macro(tribits_define_global_options_and_define_extra_repos) CACHE BOOL "Generate the ${PROJECT_NAME}RepoVersion.txt file.") - if ("${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS_DEFAULT}" STREQUAL "") - set(${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS_DEFAULT OFF) - endif() - advanced_set(${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS - ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS_DEFAULT} - CACHE BOOL - "Show parents' commit info in the repo version output.") + tribits_advanced_set_cache_var_and_default(${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS + BOOL OFF "Show parents' commit info in the repo version output.") if ("${${PROJECT_NAME}_GENERATE_VERSION_DATE_FILES_DEFAULT}" STREQUAL "") set(${PROJECT_NAME}_GENERATE_VERSION_DATE_FILES_DEFAULT OFF) From ba27309789ce35ad74654a1302aed4b7b9fef1aa Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 24 Jan 2024 10:03:46 -0700 Subject: [PATCH 08/10] Document setting _SHOW_GIT_COMMIT_PARENTS_DEFAULT in users/maintainers guide (#597) --- .../doc/guides/TribitsCoreDetailedReference.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tribits/doc/guides/TribitsCoreDetailedReference.rst b/tribits/doc/guides/TribitsCoreDetailedReference.rst index 7fbad8103..aa443415c 100644 --- a/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -88,6 +88,7 @@ a given TriBITS project are: * `${PROJECT_NAME}_MUST_FIND_ALL_TPL_LIBS`_ * `${PROJECT_NAME}_REQUIRES_PYTHON`_ * `${PROJECT_NAME}_SET_INSTALL_RPATH`_ +* `${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS`_ * `${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME`_ * `${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES`_ * `${PROJECT_NAME}_TEST_CATEGORIES`_ @@ -651,6 +652,21 @@ These options are described below. Handling`_). +.. _${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS: + +**${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS** + + The cache variable ``${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS`` results in + the repo version file showing the parent commits for each repo commit. By + default, this variable is set to ``OFF`` but projects can set to to ``ON`` + by default by setting:: + + set(${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS_DEFAULT ON) + + in the project's ``ProjectName.cmake`` file. (That way, it will also impact + ``cmake -P`` scripts don't configure the project itself to be built.) + + .. _${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME: **${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME** From 731841e7a8d3d64b8091e8ac6acca80a9e1fcdda Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 24 Jan 2024 16:24:51 -0700 Subject: [PATCH 09/10] Fix some typos in tribits_ctest_driver() (#597) I noticed this while looking at the documentation while working on #597. --- tribits/ctest_driver/TribitsCTestDriverCore.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tribits/ctest_driver/TribitsCTestDriverCore.cmake b/tribits/ctest_driver/TribitsCTestDriverCore.cmake index 1666f5755..8e6ecfde5 100644 --- a/tribits/ctest_driver/TribitsCTestDriverCore.cmake +++ b/tribits/ctest_driver/TribitsCTestDriverCore.cmake @@ -669,11 +669,11 @@ include(TribitsCTestDriverCoreHelpers) # **Setting variables in the inner CMake configure:** # # It is important to understand that none of the CMake vars that get set in -# the other CTest -S program that calls ``tribits_ctest_driver()`` +# the outer CTest -S program that calls ``tribits_ctest_driver()`` # automatically get passed into the inner configure of the TriBITS CMake # project using the ``ctest_configure()`` command by CMake. From the # perspective of raw CTest and CMake, these are completely separate programs. -# However, the ``tribits_ctest_driver()`` function will forward subset of +# However, the ``tribits_ctest_driver()`` function will forward subset a of # variables documented below into the inner CMake configure. The following # variables that are set in the outer CTest -S program will be passed into the # inner CMake configure by default (but their values they can be overridden by @@ -684,7 +684,7 @@ include(TribitsCTestDriverCoreHelpers) # # Missing extra repos are always ignored in the inner CMake configure. # This is because any problems reading an extra repo will be caught in the -# outer CTest -S drivers script. +# outer CTest -S driver script. # # ``-D${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON`` # @@ -699,7 +699,7 @@ include(TribitsCTestDriverCoreHelpers) # may be disabled. (This set may be removed in the future for the # all-at-once mode.) # -# The following variables set in the CTest -S driver script will be passed +# The following variables set in the outer CTest -S driver script will be passed # down into the inner CMake configure through the ``OPTIONS`` variable to the # ``ctest_configure()`` command: # @@ -758,7 +758,7 @@ include(TribitsCTestDriverCoreHelpers) # These configure options are passed into the ``ctest_configure()`` command in # the order:: # -# ${EXTRA_SYSTEM_CONFIGURE_OPTIONS}} \ +# ${EXTRA_SYSTEM_CONFIGURE_OPTIONS}} \ # ${EXTRA_CONFIGURE_OPTIONS} ${${PROJECT_NAME}_EXTRA_CONFIGURE_OPTIONS} # # **WARNING:** The options listed in ``EXTRA_SYSTEM_CONFIGURE_OPTIONS``, From 548a0b96f14393465179d50e1295dbd1a6b388bf Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 24 Jan 2024 16:28:36 -0700 Subject: [PATCH 10/10] Set -DTribitsExMetaProj_SHOW_GIT_COMMIT_PARENTS=ON for multi-repo test (#597) This sets the option: -DTribitsExMetaProj_SHOW_GIT_COMMIT_PARENTS=ON in the inner CMake configuration with a multi-repo setup so we can test the extraction and printing of the parent commit info. This tests a call of the function tribits_generate_single_repo_version_string() for extra repos from the function tribits_generate_repo_version_file_string(). This test also validates that the correct Git commands are called since this uses real Git on a Git repos. The downside of this updated test is that it makes it a little more difficult to maintain these tests when we have to update these snapshotted Git repos. --- .../TribitsExampleMetaProject/CMakeLists.txt | 5 ++-- ...ojRepoVersion.for-testing.with-parents.txt | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 test/ctest_driver/TribitsExampleMetaProject/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt diff --git a/test/ctest_driver/TribitsExampleMetaProject/CMakeLists.txt b/test/ctest_driver/TribitsExampleMetaProject/CMakeLists.txt index b07cf610e..d2e02af84 100644 --- a/test/ctest_driver/TribitsExampleMetaProject/CMakeLists.txt +++ b/test/ctest_driver/TribitsExampleMetaProject/CMakeLists.txt @@ -124,6 +124,7 @@ tribits_add_advanced_test( CTestDriver_TribitsExMetaProj_clone_default_branch_re ${COMMON_ENV_ARGS} TribitsExMetaProj_ENABLE_SECONDARY_TESTED_CODE=TRUE CTEST_BUILD_NAME=CTestDriver_TribitsExMetaProj_clone_default_branch_remote + TribitsExMetaProj_EXTRA_CONFIGURE_OPTIONS=-DTribitsExMetaProj_SHOW_GIT_COMMIT_PARENTS=ON CTEST_SITE=CustomSite ${CTEST_S_SCRIPT_ARGS} PASS_REGULAR_EXPRESSION_ALL @@ -262,7 +263,7 @@ tribits_add_advanced_test( CTestDriver_TribitsExMetaProj_clone_default_branch_re TEST_8 MESSAGE "Make sure that the file TribitsExMetaProjRepoVersion.txt is correct" CMND diff ARGS - "${CMAKE_CURRENT_LIST_DIR}/data/TribitsExMetaProjRepoVersion.for-testing.txt" + "${CMAKE_CURRENT_LIST_DIR}/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt" BUILD/TribitsExMetaProjRepoVersion.txt ALWAYS_FAIL_ON_NONZERO_RETURN @@ -320,7 +321,7 @@ tribits_add_advanced_test( CTestDriver_TribitsExMetaProj_clone_default_branch_re TEST_12 MESSAGE "Make sure that the file TribitsExMetaProjRepoVersion.txt is correct" CMND diff ARGS - "${CMAKE_CURRENT_LIST_DIR}/data/TribitsExMetaProjRepoVersion.for-testing.txt" + "${CMAKE_CURRENT_LIST_DIR}/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt" BUILD/TribitsExMetaProjRepoVersion.txt ALWAYS_FAIL_ON_NONZERO_RETURN diff --git a/test/ctest_driver/TribitsExampleMetaProject/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt b/test/ctest_driver/TribitsExampleMetaProject/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt new file mode 100644 index 000000000..7876d61b3 --- /dev/null +++ b/test/ctest_driver/TribitsExampleMetaProject/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt @@ -0,0 +1,27 @@ +*** Base Git Repo: TribitsExMetaProj +863461e [Tue Sep 14 15:05:31 2021 -0600] +Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#299) + *** Parent 1: + e12aad9 [Fri Dec 11 16:17:18 2020 -0700] + Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#309) + *** Parent 2: + ed38a1f [Tue Sep 14 15:04:06 2021 -0600] + Automatic snapshot commit from TribitsExampleMetaProject at d1e4913 +*** Git Repo: TribitsExampleProject +94c2b12 [Tue Sep 14 15:18:55 2021 -0600] +Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#299) + *** Parent 1: + 59c7057 [Fri Dec 11 16:23:46 2020 -0700] + Merge branch 'tribits-github-snapshot' + *** Parent 2: + da4197f [Tue Sep 14 15:11:39 2021 -0600] + Automatic snapshot commit from TribitsExampleProject at d95ddbd +*** Git Repo: TribitsExampleProjectAddons +d846ae1 [Tue Sep 14 15:23:39 2021 -0600] +Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#299) + *** Parent 1: + 226a17e [Tue Feb 19 06:33:23 2019 -0700] + Update README file (tribitspub/tribits#278) + *** Parent 2: + 08f06bb [Tue Sep 14 15:20:24 2021 -0600] + Automatic snapshot commit from TribitsExampleProjectAddons at abb6694