|
| 1 | +# @HEADER |
| 2 | +# ************************************************************************ |
| 3 | +# |
| 4 | +# TriBITS: Tribal Build, Integrate, and Test System |
| 5 | +# Copyright 2013 Sandia Corporation |
| 6 | +# |
| 7 | +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, |
| 8 | +# the U.S. Government retains certain rights in this software. |
| 9 | +# |
| 10 | +# Redistribution and use in source and binary forms, with or without |
| 11 | +# modification, are permitted provided that the following conditions are |
| 12 | +# met: |
| 13 | +# |
| 14 | +# 1. Redistributions of source code must retain the above copyright |
| 15 | +# notice, this list of conditions and the following disclaimer. |
| 16 | +# |
| 17 | +# 2. Redistributions in binary form must reproduce the above copyright |
| 18 | +# notice, this list of conditions and the following disclaimer in the |
| 19 | +# documentation and/or other materials provided with the distribution. |
| 20 | +# |
| 21 | +# 3. Neither the name of the Corporation nor the names of the |
| 22 | +# contributors may be used to endorse or promote products derived from |
| 23 | +# this software without specific prior written permission. |
| 24 | +# |
| 25 | +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY |
| 26 | +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 27 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 28 | +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE |
| 29 | +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 30 | +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 31 | +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 32 | +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 33 | +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 34 | +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 35 | +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 36 | +# |
| 37 | +# ************************************************************************ |
| 38 | +# @HEADER |
| 39 | + |
| 40 | + |
| 41 | +include(PrintVar) |
| 42 | +include(TribitsParseArgumentsHelpers) |
1 | 43 | include(TribitsReadTagFile) |
2 | 44 |
|
3 | 45 |
|
@@ -45,7 +87,7 @@ function(tribits_get_build_url_and_write_to_file cdashBuildUrlOut cdashBuildUr |
45 | 87 | TAG_FILE "${CTEST_BINARY_DIRECTORY}/Testing/TAG" |
46 | 88 | CDASH_BUILD_URL_OUT cdashBuildUrl |
47 | 89 | ) |
48 | | - set(cdashBuildUrl "https://${cdashBuildUrl}") |
| 90 | + set(cdashBuildUrl "${cdashBuildUrl}") |
49 | 91 | if (cdashBuildUrlFile) |
50 | 92 | file(WRITE "${cdashBuildUrlFile}" "${cdashBuildUrl}") |
51 | 93 | endif() |
@@ -125,11 +167,45 @@ function(tribits_get_cdash_index_php_from_drop_site_and_location) |
125 | 167 | "" #multi_value_keywords |
126 | 168 | ${ARGN} |
127 | 169 | ) |
| 170 | + tribits_get_cdash_site_from_drop_site_and_location( |
| 171 | + CTEST_DROP_SITE ${PREFIX_CTEST_DROP_SITE} |
| 172 | + CTEST_DROP_LOCATION ${PREFIX_CTEST_DROP_LOCATION} |
| 173 | + CDASH_SITE_URL_OUT cdashSiteUrl ) |
| 174 | + SET(${PREFIX_INDEX_PHP_URL_OUT} "${cdashSiteUrl}/index.php" PARENT_SCOPE) |
| 175 | +endfunction() |
| 176 | + |
| 177 | + |
| 178 | +# @FUNCTION: tribits_get_cdash_site_from_drop_site_and_location() |
| 179 | +# |
| 180 | +# Get the full CDash site base URL from the input CTEST_DROP_SITE and |
| 181 | +# CTEST_DROP_LOCATION vars used in a ctest -S script. |
| 182 | +# |
| 183 | +# Usage:: |
| 184 | +# |
| 185 | +# tribits_get_cdash_site_from_drop_site_and_location( |
| 186 | +# CTEST_DROP_SITE <ctestDropSite> |
| 187 | +# CTEST_DROP_LOCATION <ctestDropLocation> |
| 188 | +# CDASH_SITE_URL_OUT <cdashSiteUrlOut> |
| 189 | +# ) |
| 190 | +# |
| 191 | +function(tribits_get_cdash_site_from_drop_site_and_location) |
| 192 | + # Parse args |
| 193 | + cmake_parse_arguments(PARSE_ARGV 0 |
| 194 | + PREFIX #prefix |
| 195 | + "" #options |
| 196 | + "CTEST_DROP_SITE;CTEST_DROP_LOCATION;CDASH_SITE_URL_OUT" #one_value_keywords |
| 197 | + "" #multi_value_keywords |
| 198 | + ) |
| 199 | + tribits_check_for_unparsed_arguments(PREFIX) |
| 200 | + tribits_assert_parse_arg_one_value(PREFIX CTEST_DROP_SITE) |
| 201 | + tribits_assert_parse_arg_one_value(PREFIX CTEST_DROP_LOCATION) |
| 202 | + tribits_assert_parse_arg_one_value(PREFIX CDASH_SITE_URL_OUT) |
| 203 | + # Get the full CDash site from parts |
128 | 204 | string(FIND "${PREFIX_CTEST_DROP_LOCATION}" "?" endOfSubmitPhpIdx) |
129 | 205 | string(SUBSTRING "${PREFIX_CTEST_DROP_LOCATION}" 0 ${endOfSubmitPhpIdx} submitPhpPart) |
130 | | - string(REPLACE "submit.php" "index.php" indexPhpPart "${submitPhpPart}") |
131 | | - set(indexPhpUrl "${PREFIX_CTEST_DROP_SITE}${indexPhpPart}") |
132 | | - SET(${PREFIX_INDEX_PHP_URL_OUT} "${indexPhpUrl}" PARENT_SCOPE) |
| 206 | + string(REPLACE "/submit.php" "" endCDashUrl "${submitPhpPart}") |
| 207 | + set(cdashSiteUrl "${PREFIX_CTEST_DROP_SITE}${endCDashUrl}") |
| 208 | + set(${PREFIX_CDASH_SITE_URL_OUT} "https://${cdashSiteUrl}" PARENT_SCOPE) |
133 | 209 | endfunction() |
134 | 210 |
|
135 | 211 |
|
|
0 commit comments