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

Adding failing test for Issue #272 #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
99 changes: 99 additions & 0 deletions test/core/ExamplesUnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down