Skip to content

Commit

Permalink
Implement tribits_get_cdash_build_url_from_tag_file() (TriBITSPub#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlettroscoe committed Aug 10, 2021
1 parent bef125a commit f3ffa30
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/ctest_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tribits_add_advanced_test( CTestDriverUnitTests
-D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-P "${CMAKE_CURRENT_SOURCE_DIR}/CTestDriverUnitTests.cmake"
PASS_REGULAR_EXPRESSION_ALL
"Final UnitTests Result: num_run = 4"
"Final UnitTests Result: num_run = 5"
"Final UnitTests Result: PASSED"
)

Expand Down
26 changes: 25 additions & 1 deletion test/ctest_driver/CTestDriverUnitTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,29 @@ function(unittest_tribits_get_cdash_build_url_from_parts)
endfunction()


function(unittest_tribits_get_cdash_build_url_from_tag_file)

message("\n***")
message("*** Testing tribits_get_cdash_build_url_from_tag_file()")
message("***\n")

set(TAG_FILE "${CMAKE_CURRENT_LIST_DIR}/data/dummy_build_dir/Testing/TAG")

tribits_get_cdash_build_url_from_tag_file(
INDEX_PHP_URL "mycdash/index.php"
PROJECT_NAME "my project"
SITE_NAME "my site"
BUILD_NAME "my buildname g++-2.5"
TAG_FILE "${TAG_FILE}"
CDASH_BUILD_URL_OUT cdashBuildUrl
)

unittest_compare_const(cdashBuildUrl
"mycdash/index.php?project=my%20project&filtercount=3&showfilters=1&filtercombine=and&field1=site&compare1=61&value1=my%20site&field2=buildname&compare2=61&value2=my%20buildname%20g%2B%2B-2.5&field3=buildstamp&compare3=61&value3=20101015-1112-My%20CDash%20Group")

endfunction()


#
# Execute the unit tests
#
Expand All @@ -106,10 +129,11 @@ global_set(UNITTEST_OVERALL_NUMRUN 0)
# Run the unit test functions
unittest_tribits_read_ctest_tag_file()
unittest_tribits_get_cdash_build_url_from_parts()
unittest_tribits_get_cdash_build_url_from_tag_file()

message("\n***")
message("*** Determine final result of all unit tests")
message("***\n")

# Pass in the number of expected tests that must pass!
unittest_final_result(4)
unittest_final_result(5)
22 changes: 21 additions & 1 deletion tribits/ctest_driver/TribitsGetCDashUrlFromTagFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,27 @@ include(TribitsReadTagFile)
# will be handled correctly to produce a valid URL.
#
function(tribits_get_cdash_build_url_from_tag_file)
# ToDo: Implement!
# Get arguments
cmake_parse_arguments(
PREFIX #prefix
"" #options
"INDEX_PHP_URL;PROJECT_NAME;SITE_NAME;BUILD_NAME;TAG_FILE;CDASH_BUILD_URL_OUT" #one_value_keywords
"" #multi_value_keytowrds
${ARGN}
)
# Read in the tag file and get the build stamp from that
tribits_read_ctest_tag_file(${PREFIX_TAG_FILE} buildStartTime cdashGroup cdashModel)
set(buildstamp "${buildStartTime}-${cdashGroup}")
# Build the URL and return it
tribits_get_cdash_build_url_from_parts(
INDEX_PHP_URL "${PREFIX_INDEX_PHP_URL}"
PROJECT_NAME "${PREFIX_PROJECT_NAME}"
SITE_NAME "${PREFIX_SITE_NAME}"
BUILD_NAME "${PREFIX_BUILD_NAME}"
BUILD_STAMP "${buildstamp}"
CDASH_BUILD_URL_OUT cdashBuildUrl
)
set(${PREFIX_CDASH_BUILD_URL_OUT} "${cdashBuildUrl}" PARENT_SCOPE)
endfunction()


Expand Down

0 comments on commit f3ffa30

Please sign in to comment.