Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tribits_ctest_driver() package-by-package mode for CMake 3.19+ (#363, #394) #406

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ set_test_disables(
TriBITS_CTestDriver_PBP_ST_BreakBuildAllOptionalPkg
TriBITS_CTestDriver_PBP_ST_BreakBuildLibOptionalPkg
TriBITS_CTestDriver_PBP_ST_BreakConfigureOptionalPkg
TriBITS_CTestDriver_PBP_ST_BreakConfigureRequiredPkg
TriBITS_CTestDriver_PBP_ST_BreakTestPkg
)
8 changes: 3 additions & 5 deletions test/ctest_driver/MockCTestDriver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ create_ctest_dependency_handling_test_case(
"Final set of enabled packages: Teuchos 1"
"Final set of non-enabled packages: TrilinosFramework RTOp Epetra Zoltan Shards Triutils Tpetra EpetraExt Stokhos Sacado Thyra Isorropia AztecOO Galeri Amesos Intrepid Ifpack ML Belos Stratimikos RBGen Phalanx Panzer 23"
"Processing current package Teuchos: libs='ON', tests='ON'"
"CONFIGURE_OPTIONS = '-DTrilinos_TRIBITS_DIR=.+.-DCTEST_USE_LAUNCHERS:BOOL=1.-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON.-DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=-DummyErrFlags.-DTrilinos_ALLOW_NO_PACKAGES:BOOL=ON.-DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON.-DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF.-DTrilinos_EXTRAREPOS_FILE:STRING=.*./MockTrilinos/cmake.ExtraRepositoriesList.cmake.-DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES:BOOL=ON.-DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE:STRING=Experimental.-DTrilinos_ENABLE_TESTS:BOOL=ON.-DTrilinos_ENABLE_Teuchos:BOOL=ON'"
"CONFIGURE_OPTIONS = '-DTrilinos_TRIBITS_DIR=.+[;]-DCTEST_USE_LAUNCHERS:BOOL=1[;]-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON[;]-DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=-DummyErrFlags[;]-DTrilinos_ALLOW_NO_PACKAGES:BOOL=ON[;]-DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON[;]-DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF[;]-DTrilinos_EXTRAREPOS_FILE:STRING=.*./MockTrilinos/cmake.ExtraRepositoriesList.cmake[;]-DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES:BOOL=ON[;]-DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE:STRING=Experimental[;]-DTrilinos_ENABLE_TESTS:BOOL=ON[;]-DTrilinos_DEFINE_MISSING_PACKAGE_LIBS_TARGETS=ON[;]-DTrilinos_ENABLE_Teuchos:BOOL=ON'"
)
# NOTE: The above test pins down the form of the configure options passed to
# different package configures to make sure everything in there.
Expand Down Expand Up @@ -245,10 +245,10 @@ create_ctest_dependency_handling_test_case(
"Final set of enabled packages: Teuchos RTOp Epetra Zoltan Triutils Tpetra EpetraExt Thyra 8"
"Final set of non-enabled packages: TrilinosFramework Shards Stokhos Sacado Isorropia AztecOO Galeri Amesos Intrepid Ifpack ML Belos Stratimikos RBGen Phalanx Panzer 16"
"Processing current package Teuchos: libs='ON', tests=''"
"CONFIGURE_OPTIONS = '-DTrilinos_TRIBITS_DIR=.+-DCTEST_USE_LAUNCHERS:BOOL=1.-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON.-DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=-DummyErrFlags.-DTrilinos_ALLOW_NO_PACKAGES:BOOL=ON.-DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON.-DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF.-DTrilinos_EXTRAREPOS_FILE:STRING=.+/examples/MockTrilinos/cmake/ExtraRepositoriesList.cmake.-DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES:BOOL=ON.-DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE:STRING=Experimental.-DTrilinos_ENABLE_TESTS:BOOL=.-DTrilinos_ENABLE_Teuchos:BOOL=ON'"
"CONFIGURE_OPTIONS = '-DTrilinos_TRIBITS_DIR=.+-DCTEST_USE_LAUNCHERS:BOOL=1[;]-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON[;]-DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=-DummyErrFlags[;]-DTrilinos_ALLOW_NO_PACKAGES:BOOL=ON[;]-DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON[;]-DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF[;]-DTrilinos_EXTRAREPOS_FILE:STRING=.+/examples/MockTrilinos/cmake/ExtraRepositoriesList.cmake[;]-DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES:BOOL=ON[;]-DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE:STRING=Experimental[;]-DTrilinos_ENABLE_TESTS:BOOL=[;]-DTrilinos_DEFINE_MISSING_PACKAGE_LIBS_TARGETS=ON[;]-DTrilinos_ENABLE_Teuchos:BOOL=ON'"
"Processing current package Epetra: libs='ON', tests=''"
"Processing current package Thyra: libs='ON', tests='ON'"
"CONFIGURE_OPTIONS = '-DTrilinos_TRIBITS_DIR=.+-DCTEST_USE_LAUNCHERS:BOOL=1.-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON.-DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=-DummyErrFlags.-DTrilinos_ALLOW_NO_PACKAGES:BOOL=ON.-DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON.-DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF.-DTrilinos_EXTRAREPOS_FILE:STRING=.+/examples/MockTrilinos/cmake/ExtraRepositoriesList.cmake.-DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES:BOOL=ON.-DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE:STRING=Experimental.-DTrilinos_ENABLE_TESTS:BOOL=ON.-DTrilinos_ENABLE_EpetraExt:BOOL=.-DTrilinos_ENABLE_Thyra:BOOL=ON'"
"CONFIGURE_OPTIONS = '-DTrilinos_TRIBITS_DIR=.+-DCTEST_USE_LAUNCHERS:BOOL=1[;]-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON[;]-DTrilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=-DummyErrFlags[;]-DTrilinos_ALLOW_NO_PACKAGES:BOOL=ON[;]-DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON[;]-DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF[;]-DTrilinos_EXTRAREPOS_FILE:STRING=.+/examples/MockTrilinos/cmake/ExtraRepositoriesList.cmake[;]-DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES:BOOL=ON[;]-DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE:STRING=Experimental[;]-DTrilinos_ENABLE_TESTS:BOOL=ON[;]-DTrilinos_ENABLE_EpetraExt:BOOL=[;]-DTrilinos_DEFINE_MISSING_PACKAGE_LIBS_TARGETS=ON[;]-DTrilinos_ENABLE_Thyra:BOOL=ON'"
)
# NOTE: The above test pins down the form of the configure options passed to
# different package configures to make sure everything in there.
Expand Down Expand Up @@ -1162,5 +1162,3 @@ tribits_add_advanced_test( CTestDriver_tribits_ctest_update_commands_wrapper_def
"Git Update PASSED!"

)


61 changes: 59 additions & 2 deletions test/ctest_driver/TribitsExampleProject/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ tribits_add_advanced_test( CTestDriver_PBP_ST_BreakConfigureRequiredPkg
CMND cp
ARGS -r ${TribitsExProj_DIR} .
TEST_1
MESSAGE "Break the confgiure for just the required SimpleCxx package"
MESSAGE "Break the configure for just the required SimpleCxx package"
CMND ${CMAKE_CURRENT_SOURCE_DIR}/append_file_with_line.sh
ARGS TribitsExampleProject/packages/simple_cxx/CMakeLists.txt
"Configure of SimpleCxx is broken!"
Expand Down Expand Up @@ -542,7 +542,64 @@ tribits_add_advanced_test( CTestDriver_PBP_ST_BreakConfigureRequiredPkg
# NOTE: The above test ensures that the configure failure of an upstream
# optional package does not break the configure, build, or tests of
# downstream packages. It only disables the broken upstream package in
# downstream packages.
# downstream packages. This provides a robust package-by-package mode where
# configure errors in required upstream packages result in the graceful
# disable of downstream packages so that they don't report errors for those
# packages when the problem is really in upstream packages. See the var
# ${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES that is passed
# through in package-by-package mode and GitHub PR TriBITSPub/TriBITS#394.


tribits_add_advanced_test( CTestDriver_PBP_ST_BreakBuildLibRequiredPkg
OVERALL_WORKING_DIRECTORY TEST_NAME
OVERALL_NUM_MPI_PROCS 1
EXCLUDE_IF_NOT_TRUE ${PROJECT_NAME}_ENABLE_Fortran
TEST_0
MESSAGE "Copy the project dir so I can break it!"
CMND cp
ARGS -r ${TribitsExProj_DIR} .
TEST_1
MESSAGE "Break the build of a lib for the required SimpleCxx package"
CMND ${CMAKE_CURRENT_SOURCE_DIR}/append_file_with_line.sh
ARGS TribitsExampleProject/packages/simple_cxx/src/SimpleCxx_HelloWorld.cpp
"Build of the SimpleCxx library is broken!"
TEST_2
MESSAGE "Run ctest driver which should show a failed lib build for just the SimpleCxx package!"
CMND env
ARGS
CTEST_DASHBOARD_ROOT=PWD
${PBP_COMMON_ENV_ARGS}
TribitsExProj_ENABLE_SECONDARY_TESTED_CODE=TRUE
${CTEST_DROP_SITE_ENV_ARGS}
CTEST_BUILD_NAME=${PACKAGE_NAME}_CTestDriver_PBP_ST_BreakBuildLibRequiredPkg
${CTEST_S_SCRIPT_ARGS}
PASS_REGULAR_EXPRESSION_ALL
"Final set of enabled SE packages: SimpleCxx MixedLang WithSubpackagesA WithSubpackagesB WithSubpackagesC WithSubpackages WrapExternal 7"
"SimpleCxx: Configure passed"
"FAILED library build for package 'SimpleCxx'"
"SimpleCxx: Skipping tests since libray build failed"
"CONFIGURE_OPTIONS = '.*[;]-DTribitsExProj_ENABLE_SimpleCxx:BOOL=OFF[;].*[;]-DTribitsExProj_ENABLE_MixedLang:BOOL=ON'"
"MixedLang: Configure passed"
"MixedLang: Libs build passed"
"MixedLang_RayTracerTests [.]+ +Passed"
"CONFIGURE_OPTIONS = '.*[;]-DTribitsExProj_ENABLE_SimpleCxx:BOOL=OFF[;].*[;]-DTribitsExProj_ENABLE_WithSubpackages:BOOL=ON'"
"WithSubpackages: Configure passed"
"WithSubpackages: Libs build passed"
"WithSubpackages: All build passed"
"No tests were found" # Can't tell which package :-(
"CONFIGURE_OPTIONS = '.*[;]-DTribitsExProj_ENABLE_SimpleCxx:BOOL=OFF[;].*[;]-DTribitsExProj_ENABLE_WrapExternal:BOOL=ON'"
"WrapExternal: Configure passed"
"WrapExternal: All build passed"
"Final set packages that failed to configure or have the libraries build: 'SimpleCxx'"
"Final set of packages that had any failures: 'SimpleCxx'"
"TRIBITS_CTEST_DRIVER: OVERALL: ALL FAILED"
ALWAYS_FAIL_ON_ZERO_RETURN
)
# NOTE: The above test is similar to the test
# CTestDriver_PBP_ST_BreakConfigureRequiredPkg except the above test is for
# the case where a library in a required upstream package does not build and
# we want those downstream packages with a required dependency on that
# package to be gracefully disabled.


tribits_add_advanced_test( CTestDriver_PBP_ST_ALL_COVERAGE
Expand Down
Loading