Skip to content

Commit

Permalink
tribits_add_advanced_test(): Update section on using in non-TriBITS p…
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlettroscoe committed Sep 6, 2023
1 parent e9513a2 commit 3d1552c
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions tribits/core/test_support/TribitsAddAdvancedTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,9 @@ include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake")
#
# The function ``tribits_add_advanced_test()`` can be used to add tests in
# non-TriBITS projects. To do so, one just needs to set the variables
# ``PROJECT_NAME``, ``PACKAGE_NAME`` (which could be the same as
# ``PROJECT_NAME``), ``${PACKAGE_NAME}_ENABLE_TESTS=TRUE``, and
# ``${PROJECT_NAME}_TRIBITS_DIR`` (pointing to the TriBITS location). For example,
# a valid project can be a simple as::
# ``${PROJECT_NAME}_ENABLE_TESTS=TRUE`` and ``${PROJECT_NAME}_TRIBITS_DIR``
# (pointing to the TriBITS location). For example, a valid project can be a
# simple as::
#
# cmake_minimum_required(VERSION 3.23.0)
# set(PROJECT_NAME TAATDriver)
Expand All @@ -868,20 +867,27 @@ include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake")
# "Location of TriBITS to use." )
# set(PACKAGE_NAME ${PROJECT_NAME})
# set(${PACKAGE_NAME}_ENABLE_TESTS TRUE)
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
# ${TRIBITS_DIR}/core/utils
# ${TRIBITS_DIR}/core/package_arch )
# include(TribitsAddAdvancedTest)
# include("${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support/TribitsAddAdvancedTest.cmake")
# include(CTest)
# enable_testing()
#
# tribits_add_advanced_test(
# TAAT_COPY_FILES_TO_TEST_DIR_bad_file_name
# tribits_add_advanced_test( HelloWorld
# OVERALL_WORKING_DIRECTORY TEST_NAME
# TEST_0 CMND echo ARGS "Hello World!"
# PASS_REGULAR_EXPRESIOIN "Hello World"
# )
#
# Above, one can replace::
#
# include("${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support/TribitsAddAdvancedTest.cmake")
#
# with::
#
# list(PREPEND CMAKE_MODULE_PATH "${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support")
# include(TribitsAddAdvancedTest)
#
# and it will have the same effect.
#
function(tribits_add_advanced_test TEST_NAME_IN)

if (${PROJECT_NAME}_VERBOSE_CONFIGURE)
Expand Down

0 comments on commit 3d1552c

Please sign in to comment.