From e5e9be8a73d69ab7c70b14900b5d1467f0e6cda9 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Sun, 5 Jun 2022 08:18:29 -0600 Subject: [PATCH] Have 'dashboard' target set CTEST_UPDATE_VERSION_ONLY=TRUE This will post the base repo version info to CDash which provides more info right on CDash on the main index.php page. However, it will set CTEST_DO_UPDATES=OFF unless the base repo is a Git repo and we can extract the SHA1 from the repo with tribits_git_repo_sha1() (which is a very robust function). --- test/ctest_driver/TribitsExampleProject/CMakeLists.txt | 4 ++-- tribits/ctest_driver/TribitsAddDashboardTarget.cmake | 10 ++++++++++ tribits/ctest_driver/experimental_build_test.cmake | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/ctest_driver/TribitsExampleProject/CMakeLists.txt b/test/ctest_driver/TribitsExampleProject/CMakeLists.txt index 420e11581..1201b75c4 100644 --- a/test/ctest_driver/TribitsExampleProject/CMakeLists.txt +++ b/test/ctest_driver/TribitsExampleProject/CMakeLists.txt @@ -704,7 +704,7 @@ tribits_add_advanced_test( CTestDriver_PBP_Dashboard_ST_ALL_PASS "Running package-by-package experimental dashboard" "A[)] Clean out the list of packages" "B[)] Run the dashboard command setting the list of packages" - "Running: env TRIBITS_PROJECT_ROOT=.*/tribits/examples/TribitsExampleProject TribitsExProj_TRIBITS_DIR=.*/tribits TribitsExProj_WARNINGS_AS_ERRORS_FLAGS='' TribitsExProj_ENABLE_SECONDARY_TESTED_CODE=ON TribitsExProj_CTEST_DO_ALL_AT_ONCE=FALSE CTEST_DO_COVERAGE_TESTING=OFF CTEST_DO_SUBMIT=.* CTEST_DROP_METHOD=.* CTEST_DROP_SITE=.* CTEST_DROP_LOCATION=.* TribitsExProj_EXTRAREPOS_FILE=.*/tribits/examples/TribitsExampleProject/cmake/ExtraRepositoriesList.cmake TribitsExProj_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE= TribitsExProj_IGNORE_MISSING_EXTRA_REPOSITORIES=FALSE TribitsExProj_EXTRA_REPOSITORIES= TribitsExProj_PACKAGES=SimpleCxx[;]MixedLang[;]WithSubpackagesA[;]WithSubpackagesB[;]WithSubpackagesC[;]WithSubpackages[;]WrapExternal PROJECT_SOURCE_DIR=.*/tribits/examples/TribitsExampleProject .*/bin/ctest -V -S .*/tribits/ctest_driver/experimental_build_test.cmake" + "Running: env TRIBITS_PROJECT_ROOT=.*/tribits/examples/TribitsExampleProject TribitsExProj_TRIBITS_DIR=.*/tribits TribitsExProj_WARNINGS_AS_ERRORS_FLAGS='' TribitsExProj_ENABLE_SECONDARY_TESTED_CODE=ON CTEST_DO_UPDATES=OFF TribitsExProj_CTEST_DO_ALL_AT_ONCE=FALSE CTEST_DO_COVERAGE_TESTING=OFF CTEST_DO_SUBMIT=.* CTEST_DROP_METHOD=.* CTEST_DROP_SITE=.* CTEST_DROP_LOCATION=.* TribitsExProj_EXTRAREPOS_FILE=.*/tribits/examples/TribitsExampleProject/cmake/ExtraRepositoriesList.cmake TribitsExProj_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE= TribitsExProj_IGNORE_MISSING_EXTRA_REPOSITORIES=FALSE TribitsExProj_EXTRA_REPOSITORIES= TribitsExProj_PACKAGES=SimpleCxx[;]MixedLang[;]WithSubpackagesA[;]WithSubpackagesB[;]WithSubpackagesC[;]WithSubpackages[;]WrapExternal PROJECT_SOURCE_DIR=.*/tribits/examples/TribitsExampleProject .*/bin/ctest -V -S .*/tribits/ctest_driver/experimental_build_test.cmake" "-- ENV_TribitsExProj_ENABLE_SECONDARY_TESTED_CODE='ON'" "TribitsExProj_ENABLE_SECONDARY_TESTED_CODE='ON'" "Final set of packages to be explicitly processed by CTest/CDash: SimpleCxx MixedLang WithSubpackages WrapExternal 4" @@ -785,7 +785,7 @@ tribits_add_advanced_test( CTestDriver_AAO_Dashboard_ForwardArgs CTEST_DASHBOARD_ROOT= make dashboard PASS_REGULAR_EXPRESSION_ALL - "Running: env TRIBITS_PROJECT_ROOT=.*/tribits/examples/TribitsExampleProject TribitsExProj_TRIBITS_DIR=.*/tribits TribitsExProj_WARNINGS_AS_ERRORS_FLAGS='' TribitsExProj_ENABLE_SECONDARY_TESTED_CODE=OFF TribitsExProj_CTEST_DO_ALL_AT_ONCE=TRUE CTEST_BUILD_NAME=MyCustomBuildName CTEST_DO_COVERAGE_TESTING=FALSE CTEST_BUILD_FLAGS='-j6' CTEST_PARALLEL_LEVEL=10 CTEST_DO_SUBMIT=FALSE CTEST_DROP_METHOD=OFF CTEST_DROP_SITE=OFF CTEST_DROP_LOCATION=OFF CTEST_DROP_SITE_COVERAGE=FALSE CTEST_DROP_LOCATION_COVERAGE=FALSE TRIBITS_2ND_CTEST_DROP_LOCATION=FALSE TRIBITS_2ND_CTEST_DROP_SITE=FALSE TribitsExProj_EXTRAREPOS_FILE=FALSE TribitsExProj_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=NONE TribitsExProj_IGNORE_MISSING_EXTRA_REPOSITORIES=TRUE TribitsExProj_EXTRA_REPOSITORIES=DummyRepo1,DummyRepo2,DummyRepo3 TribitsExProj_PACKAGES=${TribitsExProj_PACKAGES_list} PROJECT_SOURCE_DIR=.*/tribits/examples/TribitsExampleProject .*/ctest -VV -S .*/tribits/ctest_driver/experimental_build_test.cmake" + "Running: env TRIBITS_PROJECT_ROOT=.*/tribits/examples/TribitsExampleProject TribitsExProj_TRIBITS_DIR=.*/tribits TribitsExProj_WARNINGS_AS_ERRORS_FLAGS='' TribitsExProj_ENABLE_SECONDARY_TESTED_CODE=OFF CTEST_DO_UPDATES=OFF TribitsExProj_CTEST_DO_ALL_AT_ONCE=TRUE CTEST_BUILD_NAME=MyCustomBuildName CTEST_DO_COVERAGE_TESTING=FALSE CTEST_BUILD_FLAGS='-j6' CTEST_PARALLEL_LEVEL=10 CTEST_DO_SUBMIT=FALSE CTEST_DROP_METHOD=OFF CTEST_DROP_SITE=OFF CTEST_DROP_LOCATION=OFF CTEST_DROP_SITE_COVERAGE=FALSE CTEST_DROP_LOCATION_COVERAGE=FALSE TRIBITS_2ND_CTEST_DROP_LOCATION=FALSE TRIBITS_2ND_CTEST_DROP_SITE=FALSE TribitsExProj_EXTRAREPOS_FILE=FALSE TribitsExProj_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=NONE TribitsExProj_IGNORE_MISSING_EXTRA_REPOSITORIES=TRUE TribitsExProj_EXTRA_REPOSITORIES=DummyRepo1,DummyRepo2,DummyRepo3 TribitsExProj_PACKAGES=${TribitsExProj_PACKAGES_list} PROJECT_SOURCE_DIR=.*/tribits/examples/TribitsExampleProject .*/ctest -VV -S .*/tribits/ctest_driver/experimental_build_test.cmake" "ENV_PROJECT_SOURCE_DIR='.*/tribits/examples/TribitsExampleProject'" "ENV_CTEST_BUILD_NAME='MyCustomBuildName'" diff --git a/tribits/ctest_driver/TribitsAddDashboardTarget.cmake b/tribits/ctest_driver/TribitsAddDashboardTarget.cmake index 3e7b85dcd..a9a8b6992 100644 --- a/tribits/ctest_driver/TribitsAddDashboardTarget.cmake +++ b/tribits/ctest_driver/TribitsAddDashboardTarget.cmake @@ -38,11 +38,14 @@ # @HEADER +################################################################################ # # This file gets included in the main TriBITS framework. It is put here to # reduce the size of the tribits/core/ directory. # +################################################################################ +include(TribitsGitRepoVersionInfo) # # Macro that drives a experimental 'dashboard' target @@ -95,6 +98,13 @@ macro(tribits_add_dashboard_target) append_set(EXPR_CMND_ARGS "${PROJECT_NAME}_WARNINGS_AS_ERRORS_FLAGS='${${PROJECT_NAME}_WARNINGS_AS_ERRORS_FLAGS}'") append_set(EXPR_CMND_ARGS "${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE}") + # Determine if base repo is a git repo (by seeing if SHA1 can be extracted) + tribits_git_repo_sha1("${PROJECT_SOURCE_DIR}" projectGitRepoSha1 + FAILURE_MESSAGE_OUT projectGitRepoSha1FailureMsg) + if (projectGitRepoSha1 STREQUAL "") + append_set(EXPR_CMND_ARGS "CTEST_DO_UPDATES=OFF") + endif() + # Conditionally override options used only for the 'dashboard' target. # These options have no use in a a basic build/test so we don't want to # interfere with options users might set on the env. diff --git a/tribits/ctest_driver/experimental_build_test.cmake b/tribits/ctest_driver/experimental_build_test.cmake index 0b36b05e8..0c70ab4a7 100644 --- a/tribits/ctest_driver/experimental_build_test.cmake +++ b/tribits/ctest_driver/experimental_build_test.cmake @@ -100,7 +100,7 @@ include(SetDefaultAndFromEnv) # All these can be changed by env vars set(CTEST_TEST_TYPE Experimental) -set(CTEST_DO_UPDATES FALSE) +set(CTEST_UPDATE_VERSION_ONLY TRUE) set(${PROJECT_NAME}_WARNINGS_AS_ERRORS_FLAGS "-Werror") # Don't change these in the env!