Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/master' into update-trilinos-3913
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlettroscoe committed Sep 22, 2017
2 parents eb2ddb1 + 446bfb8 commit 7d117e9
Show file tree
Hide file tree
Showing 39 changed files with 654 additions and 16 deletions.
1 change: 1 addition & 0 deletions ProjectName.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ SET(PROJECT_NAME TriBITS)
SET(${PROJECT_NAME}_USES_PYTHON TRUE)
SET(MPI_EXEC_DEFAULT_NUMPROCS 1)
SET(${PROJECT_NAME}_SKIP_EXTRAREPOS_FILE TRUE)
SET(${PROJECT_NAME}_CHECK_FOR_UNPARSED_ARGUMENTS_DEFAULT FATAL_ERROR)
300 changes: 298 additions & 2 deletions test/core/ExamplesUnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_ALL_NoFortran_WrapExternal_Verb
OVERALL_NUM_MPI_PROCS 1

TEST_0
MESSSAGE "Do a verbose configure and check that the packages coupling variables are correct."
MESSAGE "Do a verbose configure and check that the packages coupling variables are correct."
CMND ${CMAKE_COMMAND}
ARGS
${TribitsExampleProject_COMMON_CONFIG_ARGS}
Expand Down Expand Up @@ -1835,7 +1835,7 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_ALL_NoFortran_OverridePackageSo
ARGS -r TribitsExampleProject/packages/with_subpackages/

TEST_3
MESSSAGE "Override with_packages/ source dir and configure"
MESSAGE "Override with_packages/ source dir and configure"
CMND ${CMAKE_COMMAND}
ARGS
${TribitsExampleProject_COMMON_CONFIG_ARGS}
Expand Down Expand Up @@ -2991,3 +2991,299 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsExampleMetaProject
"100% tests passed, 0 tests failed out of"

)


########################################################################
# User error checking tests
########################################################################


TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_PASS
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
MESSAGE "Configure PkgWithUserErrors"
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_ADD_LIBRARY_BEFORE_POST_PROCESS=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 make
ARGS ${CTEST_BUILD_FLAGS}
PASS_REGULAR_EXPRESSION_ALL
"Built target PkgWithUserErrors_PkgWithUserErrorsTest"
ALWAYS_FAIL_ON_NONZERO_RETURN

TEST_4 CMND ${CMAKE_CTEST_COMMAND} ARGS -VV
PASS_REGULAR_EXPRESSION_ALL
"Test [#]1: PkgWithUserErrors_PkgWithUserErrorsTest[_MPI1]* [.]+ +Passed"
ALWAYS_FAIL_ON_NONZERO_RETURN

)


TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_PACKAGE_POST_PROCESS
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
MESSAGE "Configure PkgWithUserErrors"
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_SKIP_PACKAGE_POST_PROCESS=TRUE
-DPkgWithUserErrors_ADD_LIBRARY_BEFORE_POST_PROCESS=TRUE
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"Processing enabled package: PkgWithUserErrors [(]Libs, Tests, Examples[)]"
"ERROR: Forgot to call TRIBITS_PACKAGE_POSTPROCESS[(][)] .*/TribitsExampleProject/PkgWithUserErrors/CMakeLists.txt"
ALWAYS_FAIL_ON_ZERO_RETURN
)

TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_SKIP_PACKAGE_INIT
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
MESSAGE "Configure PkgWithUserErrors"
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_SKIP_TRIBITS_PACKAGE_INIT=TRUE
-DPkgWithUserErrors_ADD_LIBRARY_BEFORE_POST_PROCESS=TRUE
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"Must call TRIBITS_PACKAGE[(][)] before TRIBITS_ADD_LIBRARY[(][)]"
"Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

TEST_3
MESSAGE "Configure PkgWithUserErrors"
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_SKIP_TRIBITS_PACKAGE_INIT=TRUE
-DPkgWithUserErrors_ADD_LIBRARY_BEFORE_POST_PROCESS=FALSE
-DPkgWithUserErrors_ADD_EXECUTABLE_BEFORE_POST_PROCESS=TRUE
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"Must call TRIBITS_PACKAGE[(][)] before TRIBITS_ADD_EXECUTABLE[(][)]"
"Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

TEST_4
MESSAGE "Configure PkgWithUserErrors"
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_SKIP_TRIBITS_PACKAGE_INIT=TRUE
-DPkgWithUserErrors_ADD_LIBRARY_BEFORE_POST_PROCESS=FALSE
-DPkgWithUserErrors_ADD_EXECUTABLE_BEFORE_POST_PROCESS=""
-DPkgWithUserErrors_SKIP_PACKAGE_TESTS=TRUE
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"Must call TRIBITS_PACKAGE[(][)] before TRIBITS_PACKAGE_POSTPROCESS[(][)]"
"Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

)

TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_TARGETS_AFTER_POSTPROCESS
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
MESSAGE "Configure PkgWithUserErrors"
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_ADD_LIBRARY_BEFORE_POST_PROCESS=FALSE
-DPkgWithUserErrors_ADD_LIBRARY_AFTER_POST_PROCESS=TRUE
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"Must call TRIBITS_ADD_LIBRARY[(][)] before TRIBITS_PACKAGE_POSTPROCESS[(][)] in"
"Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

TEST_3
MESSAGE "Configure PkgWithUserErrors"
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_ADD_LIBRARY_AFTER_POST_PROCESS=FALSE
-DPkgWithUserErrors_ADD_EXECUTABLE_AFTER_POST_PROCESS=TRUE
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"Must call TRIBITS_ADD_EXECUTABLE[(][)] before TRIBITS_PACKAGE_POSTPROCESS[(][)] in"
"Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

)

TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_PkgWithUserErrors_UNPARSED_ARGS
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
MESSAGE "Configure PkgWithUserErrors"
CMND ${CMAKE_COMMAND}
ARGS
${TribitsExampleProject_COMMON_CONFIG_ARGS}
-DTribitsExProj_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-DTribitsExProj_CHECK_FOR_UNPARSED_ARGUMENTS=FATAL_ERROR
-DTribitsExProj_ENABLE_Fortran=OFF
-DTribitsExProj_EXTRA_REPOSITORIES=PkgWithUserErrors
-DTribitsExProj_ENABLE_PkgWithUserErrors=ON
-DPkgWithUserErrors_UNPARSED_ARGS_DEFINE_DEPENDENCIES=ON
-DTribitsExProj_ENABLE_TESTS=ON
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"CMake Error at.*TribitsGeneralMacros.cmake:"
"Arguments are being passed in but not used. UNPARSED_ARGUMENTS ="
"nonsense_jdslkfhlskd"
"TRIBITS_READ_PACKAGE_DEPENDENCIES"
"-- Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

TEST_3
MESSAGE "Configure PkgWithUserErrors"
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
-DPkgWithUserErrors_UNPARSED_ARGS_DEFINE_DEPENDENCIES=OFF
-DPkgWithUserErrors_UNPARSED_ARGS_ADD_LIBRARY=ON
-DTribitsExProj_ENABLE_TESTS=ON
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"CMake Error at.*TribitsGeneralMacros.cmake:"
"Arguments are being passed in but not used. UNPARSED_ARGUMENTS ="
"this_shouldnt_be_here"
"PkgWithUserErrors/CMakeLists.txt.*TRIBITS_ADD_LIBRARY"
"-- Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN

TEST_4
MESSAGE "Configure PkgWithUserErrors"
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
-DPkgWithUserErrors_UNPARSED_ARGS_DEFINE_DEPENDENCIES=OFF
-DPkgWithUserErrors_UNPARSED_ARGS_ADD_LIBRARY=OFF
-DPkgWithUserErrors_UNPARSED_ARGS_ADD_EXECUTABLE=ON
-DTribitsExProj_ENABLE_TESTS=ON
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"CMake Error at.*TribitsGeneralMacros.cmake:"
"Arguments are being passed in but not used. UNPARSED_ARGUMENTS ="
"misspelled_argument"
"PkgWithUserErrors/CMakeLists.txt.*TRIBITS_ADD_EXECUTABLE"
"-- Configuring incomplete, errors occurred!"
ALWAYS_FAIL_ON_ZERO_RETURN
)
72 changes: 72 additions & 0 deletions test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# TRIBITS_PACKAGE() will be called by default
IF(NOT ${PACKAGE_NAME}_SKIP_TRIBITS_PACKAGE_INIT)
TRIBITS_PACKAGE(PkgWithUserErrors)
ENDIF()

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

# Not added by defult
IF(${PACKAGE_NAME}_ADD_LIBRARY_BEFORE_POST_PROCESS)
MESSAGE("building library")
TRIBITS_ADD_LIBRARY(
pkgwithusererrors
HEADERS PkgWithUserErrorsLib.hpp
SOURCES PkgWithUserErrorsLib.cpp
)
ENDIF()

# Not added by defult
IF(${PACKAGE_NAME}_UNPARSED_ARGS_ADD_LIBRARY)
TRIBITS_ADD_LIBRARY(
pkgwithusererrors
this_shouldnt_be_here
HEADERS PkgWithUserErrorsLib.hpp
SOURCES PkgWithUserErrorsLib.cpp
)
ENDIF()

# Not added by defult
IF(${PACKAGE_NAME}_ADD_EXECUTABLE_BEFORE_POST_PROCESS)
MESSAGE("building exectuable")
TRIBITS_ADD_EXECUTABLE(
usererrorexec
SOURCES PkgWithUserErrorsEX.cpp
)
ENDIF()

# Not added by defult
IF(${PACKAGE_NAME}_UNPARSED_ARGS_ADD_EXECUTABLE)
MESSAGE("building exectuable")
TRIBITS_ADD_EXECUTABLE(
usererrorexec
misspelled_argument
SOURCES PkgWithUserErrorsEX.cpp
SPORCOOS some_file.cpp
)
ENDIF()

IF(NOT ${PACKAGE_NAME}_SKIP_PACKAGE_TESTS)
TRIBITS_ADD_TEST_DIRECTORIES(test)
ENDIF()

# TRIBITS_PACKAGE_POSTPROCESS() will be called by default
IF (NOT ${PACKAGE_NAME}_SKIP_PACKAGE_POST_PROCESS)
TRIBITS_PACKAGE_POSTPROCESS()
ENDIF()

# Not added by defult
IF (${PACKAGE_NAME}_ADD_LIBRARY_AFTER_POST_PROCESS)
TRIBITS_ADD_LIBRARY(
pkgwithusererrors2
HEADERS PkgWithUserErrorsLib.hpp
SOURCES PkgWithUserErrorsLib.cpp
)
ENDIF()

# Not added by defult
IF(${PACKAGE_NAME}_ADD_EXECUTABLE_AFTER_POST_PROCESS)
TRIBITS_ADD_EXECUTABLE(
usererrorexec
SOURCES PkgWithUserErrorsEX.cpp
)
ENDIF()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TRIBITS_REPOSITORY_DEFINE_PACKAGES(
PkgWithUserErrors . PT
)
Loading

0 comments on commit 7d117e9

Please sign in to comment.