From 548a0b96f14393465179d50e1295dbd1a6b388bf Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 24 Jan 2024 16:28:36 -0700 Subject: [PATCH] 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