Skip to content

Commit

Permalink
WIP: Add skeleton and failing test for building CDash build URL (TriB…
Browse files Browse the repository at this point in the history
…ITSPub#154)

I will amend/squash this commit with the full implementation.
  • Loading branch information
bartlettroscoe committed Jul 29, 2021
1 parent dba542b commit 04c2390
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 3 deletions.
30 changes: 27 additions & 3 deletions test/ctest_driver/CTestDriverUnitTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()")
Expand All @@ -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
#
Expand All @@ -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")
Expand Down
47 changes: 47 additions & 0 deletions tribits/ctest_driver/TribitsGetCDashUrlFromTagFile.cmake
Original file line number Diff line number Diff line change
@@ -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 <indexPhpUrl>
# PROJECT_NAME <projectName>
# SITE_NAME <siteName>
# BUILD_NAME <buildName>
# TAG_FILE <tagFile>
# CDASH_BUILD_URL_OUT <cdashBuildUrlOut>
# )
#
# Note that spaces are allowed ``<siteName>`` or ``<buildName>`` 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 <indexPhpUrl>
# PROJECT_NAME <projectName>
# SITE_NAME <siteName>
# BUILD_NAME <buildName>
# BUILD_STAMP <buildStamp>
# CDASH_BUILD_URL_OUT <cdashBuildUrlOut>
# )
#
# Note that spaces are allowed ``<siteName>``, ``<buildName>`` or
# ``<buildStamp>`` and those will be handled correctly to produce a valid URL.
#
function(tribits_get_cdash_build_url_from_parts)
# ToDo: Implement!
endfunction()

0 comments on commit 04c2390

Please sign in to comment.