From 04c23902735ecb1955233de5cf3c97641f190bf0 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 28 Jul 2021 18:59:40 -0600 Subject: [PATCH] WIP: Add skeleton and failing test for building CDash build URL (#154) I will amend/squash this commit with the full implementation. --- test/ctest_driver/CTestDriverUnitTests.cmake | 30 ++++++++++-- .../TribitsGetCDashUrlFromTagFile.cmake | 47 +++++++++++++++++++ 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 tribits/ctest_driver/TribitsGetCDashUrlFromTagFile.cmake diff --git a/test/ctest_driver/CTestDriverUnitTests.cmake b/test/ctest_driver/CTestDriverUnitTests.cmake index 2189bd2d7..71ad20b2f 100644 --- a/test/ctest_driver/CTestDriverUnitTests.cmake +++ b/test/ctest_driver/CTestDriverUnitTests.cmake @@ -47,11 +47,13 @@ set( CMAKE_MODULE_PATH ) include(GlobalSet) -include(TribitsReadTagFile) include(UnitTestHelpers) +include(TribitsReadTagFile) +include(TribitsGetCDashUrlFromTagFile) + -function(unittest_read_ctest_tag_file) +function(unittest_tribits_read_ctest_tag_file) message("\n***") message("*** Testing tribits_read_ctest_tag_file()") @@ -71,6 +73,27 @@ function(unittest_read_ctest_tag_file) endfunction() +function(unittest_tribits_get_cdash_build_url_from_parts) + + message("\n***") + message("*** Testing tribits_get_cdash_build_url_from_parts()") + message("***\n") + + tribits_get_cdash_build_url_from_parts( + INDEX_PHP_URL "mycdash/index.php" + PROJECT_NAME "myproject" + SITE_NAME "my site" + BUILD_NAME "my buildname g++-2.5" + BUILD_STAMP "20210729-0024-My Group" + CDASH_BUILD_URL_OUT cdashBuildUrlOut + ) + + unittest_compare_const(cdashBuildUrlOut + "mycdash/index.php?project=myproject&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=20210729-0024-My%20Group") + +endfunction() + + # # Execute the unit tests # @@ -81,7 +104,8 @@ global_set(UNITTEST_OVERALL_NUMPASSED 0) global_set(UNITTEST_OVERALL_NUMRUN 0) # Run the unit test functions -unittest_read_ctest_tag_file() +unittest_tribits_read_ctest_tag_file() +unittest_tribits_get_cdash_build_url_from_parts() message("\n***") message("*** Determine final result of all unit tests") diff --git a/tribits/ctest_driver/TribitsGetCDashUrlFromTagFile.cmake b/tribits/ctest_driver/TribitsGetCDashUrlFromTagFile.cmake new file mode 100644 index 000000000..8ba7703bd --- /dev/null +++ b/tribits/ctest_driver/TribitsGetCDashUrlFromTagFile.cmake @@ -0,0 +1,47 @@ +include(TribitsReadTagFile) + + +# @FUNCTION: tribits_get_cdash_build_url_from_tag_file() +# +# Create CDash index.php URL from the build parts. +# +# Usage:: +# +# tribits_get_cdash_build_url_from_tag_file( +# INDEX_PHP_URL +# PROJECT_NAME +# SITE_NAME +# BUILD_NAME +# TAG_FILE +# CDASH_BUILD_URL_OUT +# ) +# +# Note that spaces are allowed ```` or ```` and those +# will be handled correctly to produce a valid URL. +# +function(tribits_get_cdash_build_url_from_tag_file) + # ToDo: Implement! +endfunction() + + +# @FUNCTION: tribits_get_cdash_build_url_from_parts() +# +# Create CDash index.php URL from the build parts. +# +# Usage:: +# +# tribits_get_cdash_build_url_from_parts( +# INDEX_PHP_URL +# PROJECT_NAME +# SITE_NAME +# BUILD_NAME +# BUILD_STAMP +# CDASH_BUILD_URL_OUT +# ) +# +# Note that spaces are allowed ````, ```` or +# ```` and those will be handled correctly to produce a valid URL. +# +function(tribits_get_cdash_build_url_from_parts) + # ToDo: Implement! +endfunction()