-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from TriBITSPub/597-config-git-version-info
Add git version info for parent commits (#597)
- Loading branch information
Showing
13 changed files
with
366 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ set(TribitsHelloWorld_COMMON_CONFIG_ARGS | |
${SERIAL_PASSTHROUGH_CONFIGURE_ARGS} | ||
) | ||
|
||
|
||
tribits_add_advanced_test( TribitsHelloWorld | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
OVERALL_NUM_MPI_PROCS 1 | ||
|
@@ -36,6 +37,115 @@ tribits_add_advanced_test( TribitsHelloWorld | |
) | ||
|
||
|
||
tribits_add_advanced_test( TribitsHelloWorld_config_git_version_single_repo_one_parent | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
OVERALL_NUM_MPI_PROCS 1 | ||
XHOST Windows # We use the 'diff' command below :-( | ||
|
||
TEST_0 | ||
MESSAGE "Copy the project source so we can copy files into it." | ||
CMND ${CMAKE_COMMAND} | ||
ARGS -E copy_directory | ||
${${PROJECT_NAME}_TRIBITS_DIR}/examples/TribitsHelloWorld | ||
TribitsHelloWorld | ||
|
||
TEST_1 | ||
MESSAGE "Create a dummy .git directory so it will run git commands" | ||
CMND ${CMAKE_COMMAND} ARGS -E make_directory TribitsHelloWorld/.git | ||
|
||
TEST_2 | ||
CMND ${CMAKE_COMMAND} ARGS -E copy | ||
${CMAKE_CURRENT_SOURCE_DIR}/configure_git_mockprogram_files/mockprogram_inout.single_repo_one_parent_version.txt | ||
TribitsHelloWorld/.mockprogram_inout.txt | ||
|
||
TEST_3 | ||
WORKING_DIRECTORY BUILD | ||
CMND ${CMAKE_COMMAND} | ||
ARGS | ||
${TribitsHelloWorld_COMMON_CONFIG_ARGS} | ||
-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 | ||
"a1234tgb .Thu Sep 21 19:19:18 2023 -0400. <[email protected]>" | ||
"This is the HEAD commit summary line" | ||
ALWAYS_FAIL_ON_NONZERO_RETURN | ||
|
||
TEST_4 | ||
CMND diff ARGS | ||
${CMAKE_CURRENT_SOURCE_DIR}/configure_git_mockprogram_files/TribitsHelloWorldRepoVersion.single_repo_one_parent_version.txt | ||
BUILD/TribitsHelloWorldRepoVersion.txt | ||
|
||
) | ||
# NOTES: | ||
# | ||
# * The above directory structure is: | ||
# | ||
# TribitsHelloWorld_config_git_version_single_repo_one_parent/ | ||
# TribitsHelloWorld/ | ||
# .git/ | ||
# .mockprogram_inout.txt | ||
# BUILD/ | ||
# | ||
# * We don't use cmake -E compare_files because it does not print the diff, | ||
# just gives a non-zero error code. | ||
|
||
|
||
tribits_add_advanced_test( TribitsHelloWorld_config_git_version_single_repo_two_parents | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
OVERALL_NUM_MPI_PROCS 1 | ||
XHOST Windows # We use the 'diff' command below :-( | ||
|
||
TEST_0 | ||
MESSAGE "Copy the project source so we can copy files into it." | ||
CMND ${CMAKE_COMMAND} | ||
ARGS -E copy_directory | ||
${${PROJECT_NAME}_TRIBITS_DIR}/examples/TribitsHelloWorld | ||
TribitsHelloWorld | ||
|
||
TEST_1 | ||
MESSAGE "Create a dummy .git directory so it will run git commands" | ||
CMND ${CMAKE_COMMAND} ARGS -E make_directory TribitsHelloWorld/.git | ||
|
||
TEST_2 | ||
CMND ${CMAKE_COMMAND} ARGS -E copy | ||
${CMAKE_CURRENT_SOURCE_DIR}/configure_git_mockprogram_files/mockprogram_inout.single_repo_two_parents_version.txt | ||
TribitsHelloWorld/.mockprogram_inout.txt | ||
|
||
TEST_3 | ||
WORKING_DIRECTORY BUILD | ||
CMND ${CMAKE_COMMAND} | ||
ARGS | ||
${TribitsHelloWorld_COMMON_CONFIG_ARGS} | ||
-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 | ||
PASS_REGULAR_EXPRESSION_ALL | ||
"a1234tgb .Thu Sep 21 19:19:18 2023 -0400. <[email protected]>" | ||
"This is the HEAD commit summary line" | ||
"Parent 1:" | ||
"b5678aop .Thu Sep 20 19:19:18 2023 -0400. <[email protected]>" | ||
"This is parent 1 commit summary line" | ||
"Parent 2:" | ||
"c9101hah .Thu Sep 19 19:19:18 2023 -0400. <[email protected]>" | ||
"This is parent 2 commit summary line" | ||
ALWAYS_FAIL_ON_NONZERO_RETURN | ||
|
||
TEST_4 | ||
CMND diff ARGS | ||
${CMAKE_CURRENT_SOURCE_DIR}/configure_git_mockprogram_files/TribitsHelloWorldRepoVersion.single_repo_two_parents_version.txt | ||
BUILD/TribitsHelloWorldRepoVersion.txt | ||
|
||
) | ||
|
||
|
||
tribits_add_advanced_test( TribitsHelloWorld_EXE_DISABLE | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
OVERALL_NUM_MPI_PROCS 1 | ||
|
3 changes: 3 additions & 0 deletions
3
...ure_git_mockprogram_files/TribitsHelloWorldRepoVersion.single_repo_one_parent_version.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*** Base Git Repo: TribitsHelloWorld | ||
a1234tgb [Thu Sep 21 19:19:18 2023 -0400] <[email protected]> | ||
This is the HEAD commit summary line |
9 changes: 9 additions & 0 deletions
9
...re_git_mockprogram_files/TribitsHelloWorldRepoVersion.single_repo_two_parents_version.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*** Base Git Repo: TribitsHelloWorld | ||
a1234tgb [Thu Sep 21 19:19:18 2023 -0400] <[email protected]> | ||
This is the HEAD commit summary line | ||
*** Parent 1: | ||
b5678aop [Thu Sep 20 19:19:18 2023 -0400] <[email protected]> | ||
This is parent 1 commit summary line | ||
*** Parent 2: | ||
c9101hah [Thu Sep 19 19:19:18 2023 -0400] <[email protected]> | ||
This is parent 2 commit summary line |
9 changes: 9 additions & 0 deletions
9
...ests/configure_git_mockprogram_files/mockprogram_inout.single_repo_one_parent_version.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> HEAD | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: a1234tgb [Thu Sep 21 19:19:18 2023 -0400] <[email protected]> | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s HEAD | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: This is the HEAD commit summary line | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%p HEAD | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: b5678aop |
21 changes: 21 additions & 0 deletions
21
...sts/configure_git_mockprogram_files/mockprogram_inout.single_repo_two_parents_version.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> HEAD | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: a1234tgb [Thu Sep 21 19:19:18 2023 -0400] <[email protected]> | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s HEAD | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: This is the HEAD commit summary line | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%p HEAD | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: b5678aop c9101hah | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> b5678aop | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: b5678aop [Thu Sep 20 19:19:18 2023 -0400] <[email protected]> | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s b5678aop | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: This is parent 1 commit summary line | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> c9101hah | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: c9101hah [Thu Sep 19 19:19:18 2023 -0400] <[email protected]> | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s c9101hah | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: This is parent 2 commit summary line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../TribitsExampleMetaProject/data/TribitsExMetaProjRepoVersion.for-testing.with-parents.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
*** Base Git Repo: TribitsExMetaProj | ||
863461e [Tue Sep 14 15:05:31 2021 -0600] <[email protected]> | ||
Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#299) | ||
*** Parent 1: | ||
e12aad9 [Fri Dec 11 16:17:18 2020 -0700] <[email protected]> | ||
Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#309) | ||
*** Parent 2: | ||
ed38a1f [Tue Sep 14 15:04:06 2021 -0600] <[email protected]> | ||
Automatic snapshot commit from TribitsExampleMetaProject at d1e4913 | ||
*** Git Repo: TribitsExampleProject | ||
94c2b12 [Tue Sep 14 15:18:55 2021 -0600] <[email protected]> | ||
Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#299) | ||
*** Parent 1: | ||
59c7057 [Fri Dec 11 16:23:46 2020 -0700] <[email protected]> | ||
Merge branch 'tribits-github-snapshot' | ||
*** Parent 2: | ||
da4197f [Tue Sep 14 15:11:39 2021 -0600] <[email protected]> | ||
Automatic snapshot commit from TribitsExampleProject at d95ddbd | ||
*** Git Repo: TribitsExampleProjectAddons | ||
d846ae1 [Tue Sep 14 15:23:39 2021 -0600] <[email protected]> | ||
Merge branch 'tribits-github-snapshot' (TriBITSPub/TriBITS#299) | ||
*** Parent 1: | ||
226a17e [Tue Feb 19 06:33:23 2019 -0700] <[email protected]> | ||
Update README file (tribitspub/tribits#278) | ||
*** Parent 2: | ||
08f06bb [Tue Sep 14 15:20:24 2021 -0600] <[email protected]> | ||
Automatic snapshot commit from TribitsExampleProjectAddons at abb6694 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.