-
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.
Add test TribitsHelloWorld_config_git_version (#597)
Added test TribitsHelloWorld_config_git_version that uses mockprogram.py as git to generate and check git version info. ToDo: We should also check the generated TribitsHelloWorldRepoVersion.txt file
- Loading branch information
1 parent
685c8d5
commit 00b3c6f
Showing
2 changed files
with
52 additions
and
0 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,51 @@ tribits_add_advanced_test( TribitsHelloWorld | |
) | ||
|
||
|
||
tribits_add_advanced_test( TribitsHelloWorld_config_git_version | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
OVERALL_NUM_MPI_PROCS 1 | ||
|
||
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_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 | ||
-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 git commit summary line" | ||
ALWAYS_FAIL_ON_NONZERO_RETURN | ||
|
||
) | ||
# The above directory structure is: | ||
# | ||
# TribitsHelloWorld_config_git_version/ | ||
# TribitsHelloWorld/ | ||
# .git/ | ||
# .mockprogram_inout.txt | ||
# BUILD/ | ||
|
||
|
||
tribits_add_advanced_test( TribitsHelloWorld_EXE_DISABLE | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
OVERALL_NUM_MPI_PROCS 1 | ||
|
6 changes: 6 additions & 0 deletions
6
...re/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_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,6 @@ | ||
MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> | ||
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 | ||
MOCK_PROGRAM_RETURN: 0 | ||
MOCK_PROGRAM_OUTPUT: This is the git commit summary line |