diff --git a/test/core/ExamplesUnitTests/CMakeLists.txt b/test/core/ExamplesUnitTests/CMakeLists.txt index 49f86a736..fc53f8014 100644 --- a/test/core/ExamplesUnitTests/CMakeLists.txt +++ b/test/core/ExamplesUnitTests/CMakeLists.txt @@ -3360,6 +3360,105 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_PACKAGE_INIT ) +TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_PACKAGE_DECL + OVERALL_WORKING_DIRECTORY TEST_NAME + OVERALL_NUM_MPI_PROCS 1 + + TEST_0 + MESSAGE "Copy TribitsExampleProject so that we can copy in PkgWithUserErrors." + CMND cp + ARGS -r ${${PROJECT_NAME}_TRIBITS_DIR}/examples/TribitsExampleProject . + + TEST_1 + MESSAGE "Copy PkgWithUserErrors to base dir." + CMND cp + ARGS -r ${CMAKE_CURRENT_SOURCE_DIR}/PkgWithUserErrors + TribitsExampleProject/. + + TEST_2 + CMND ${CMAKE_COMMAND} + ARGS + ${TribitsExampleProject_COMMON_CONFIG_ARGS} + -DTribitsExProj_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} + -DTribitsExProj_ENABLE_Fortran=OFF + -DTribitsExProj_EXTRA_REPOSITORIES=PkgWithUserErrors + -DTribitsExProj_ENABLE_PkgWithUserErrors=ON + -DTribitsExProj_ENABLE_TESTS=ON + -DPkgWithUserErrors_turn_off_passing_call_order=TRUE + -DPkgWithUserErrors_Package_decl_called_then_add_library=TRUE + TribitsExampleProject + PASS_REGULAR_EXPRESSION_ALL + "Explicitly enabled packages on input [(]by user[)]: PkgWithUserErrors 1" + "Final set of enabled packages: PkgWithUserErrors 1" + "Processing enabled package: PkgWithUserErrors [(]Libs, Tests, Examples[)]" + "Configuring done" + "Generating done" + ALWAYS_FAIL_ON_NONZERO_RETURN + + TEST_3 + CMND ${CMAKE_COMMAND} + ARGS + ${TribitsExampleProject_COMMON_CONFIG_ARGS} + -DTribitsExProj_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} + -DTribitsExProj_ENABLE_Fortran=OFF + -DTribitsExProj_EXTRA_REPOSITORIES=PkgWithUserErrors + -DTribitsExProj_ENABLE_PkgWithUserErrors=ON + -DTribitsExProj_ENABLE_TESTS=ON + -DPkgWithUserErrors_turn_off_passing_call_order=TRUE + -DPkgWithUserErrors_Package_decl_called_then_add_library=FALSE + -DPkgWithUserErrors_Package_decl_called_then_add_executable=TRUE + TribitsExampleProject + PASS_REGULAR_EXPRESSION_ALL + "Explicitly enabled packages on input [(]by user[)]: PkgWithUserErrors 1" + "Final set of enabled packages: PkgWithUserErrors 1" + "Processing enabled package: PkgWithUserErrors [(]Libs, Tests, Examples[)]" + "Configuring done" + "Generating done" + ALWAYS_FAIL_ON_NONZERO_RETURN + + TEST_4 + CMND ${CMAKE_COMMAND} + ARGS + ${TribitsExampleProject_COMMON_CONFIG_ARGS} + -DTribitsExProj_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} + -DTribitsExProj_ENABLE_Fortran=OFF + -DTribitsExProj_EXTRA_REPOSITORIES=PkgWithUserErrors + -DTribitsExProj_ENABLE_PkgWithUserErrors=ON + -DTribitsExProj_ENABLE_TESTS=ON + -DPkgWithUserErrors_turn_off_passing_call_order=TRUE + -DPkgWithUserErrors_Package_decl_called_then_add_executable=FALSE + -DPkgWithUserErrors_Package_decl_called_then_add_test_directories=TRUE + TribitsExampleProject + PASS_REGULAR_EXPRESSION_ALL + "Explicitly enabled packages on input [(]by user[)]: PkgWithUserErrors 1" + "Final set of enabled packages: PkgWithUserErrors 1" + "Processing enabled package: PkgWithUserErrors [(]Libs, Tests, Examples[)]" + "Configuring done" + "Generating done" + ALWAYS_FAIL_ON_NONZERO_RETURN + + TEST_5 + CMND ${CMAKE_COMMAND} + ARGS + ${TribitsExampleProject_COMMON_CONFIG_ARGS} + -DTribitsExProj_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} + -DTribitsExProj_ENABLE_Fortran=OFF + -DTribitsExProj_EXTRA_REPOSITORIES=PkgWithUserErrors + -DTribitsExProj_ENABLE_PkgWithUserErrors=ON + -DTribitsExProj_ENABLE_TESTS=ON + -DPkgWithUserErrors_turn_off_passing_call_order=TRUE + -DPkgWithUserErrors_Package_decl_called_then_add_test_directories=FALSE + -DPkgWithUserErrors_Package_decl_called_then_add_example_directories=TRUE + TribitsExampleProject + PASS_REGULAR_EXPRESSION_ALL + "Explicitly enabled packages on input [(]by user[)]: PkgWithUserErrors 1" + "Final set of enabled packages: PkgWithUserErrors 1" + "Processing enabled package: PkgWithUserErrors [(]Libs, Tests, Examples[)]" + "Configuring done" + "Generating done" + ALWAYS_FAIL_ON_NONZERO_RETURN + ) + TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_AFTER_POSTPROCESS OVERALL_WORKING_DIRECTORY TEST_NAME OVERALL_NUM_MPI_PROCS 1 diff --git a/test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt b/test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt index 54abc02ea..2794d0d78 100644 --- a/test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt +++ b/test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt @@ -161,6 +161,55 @@ IF(${PACKAGE_NAME}_UNPARSED_ARGS_ADD_EXECUTABLE) TRIBITS_PACKAGE_POSTPROCESS() ENDIF() +############################################################### +# Regression: Package_decl called then process package +############################################################### +IF(${PACKAGE_NAME}_Package_decl_called_then_add_library) + MESSAGE("Package_decl called then add_library") + TRIBITS_PACKAGE_DECL(PkgWithUserErrors) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + MESSAGE("building library") + TRIBITS_PACKAGE_DEF() + TRIBITS_ADD_LIBRARY( + pkgwithusererrors + HEADERS PkgWithUserErrorsLib.hpp + SOURCES PkgWithUserErrorsLib.cpp + ) + TRIBITS_PACKAGE_POSTPROCESS() +ENDIF() + +IF(${PACKAGE_NAME}_Package_decl_called_then_add_test_directories) + MESSAGE("Package_decl called then add_test_directories") + TRIBITS_PACKAGE_DECL(PkgWithUserErrors) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + MESSAGE("adding test directories") + TRIBITS_ADD_TEST_DIRECTORIES(test) + TRIBITS_PACKAGE_DEF() + TRIBITS_PACKAGE_POSTPROCESS() +ENDIF() + +IF(${PACKAGE_NAME}_Package_decl_called_then_add_executable) + MESSAGE("Package_decl called then add_executable") + TRIBITS_PACKAGE_DECL(PkgWithUserErrors) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + MESSAGE("building executable") + TRIBITS_ADD_EXECUTABLE( + usererrorexec + SOURCES PkgWithUserErrorsEX.cpp + ) + TRIBITS_PACKAGE_DEF() + TRIBITS_PACKAGE_POSTPROCESS() +ENDIF() + +IF(${PACKAGE_NAME}_Package_decl_called_then_add_example_directories) + MESSAGE("Package_decl called then add_example_directories") + TRIBITS_PACKAGE_DECL(PkgWithUserErrors) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + MESSAGE("adding example directories") + TRIBITS_ADD_EXAMPLE_DIRECTORIES(test) + TRIBITS_PACKAGE_DEF() + TRIBITS_PACKAGE_POSTPROCESS() +ENDIF() IF (${PACKAGE_NAME}_using_package_with_subpackage_commands) MESSAGE("Using package with subpackage commands in error")