Skip to content

Commit

Permalink
Add headers for different sets of unit tests (TriBITSPub#483)
Browse files Browse the repository at this point in the history
This is to make the file easier to navigate so I can add more unit tests.

This file has gotten way too big and needs to be broken into several smaller
files at some point here.
  • Loading branch information
bartlettroscoe committed Jun 3, 2022
1 parent 700f916 commit 97bcf0d
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions test/core/TestingFunctionMacro_UnitTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,23 @@ include(GlobalNullSet)
include(AppendStringVar)


#####################################################################
################################################################################
#
# Unit tests for tribits_add_xxx(...) CMake commands run as CMake code
# Unit tests for a collection of TriBITS Core CMake code
#
# This file contains a set of unit tests for the package_arch macros
# tribits_add_xxx(...) functions. These unit tests are written in CMake
# itself. This is not a very advanced unit testing system and it not that
# easy to work with. However, it does perform some pretty strong testing and
# is much better than doing nothing.
# These unit tests are written in CMake itself. This is not a very advanced
# unit testing system and it not that easy to work with. However, it does
# perform some pretty strong testing and is much better than doing nothing.
# Each set of tests is in a function scope so as not to impact other tests.
#
#####################################################################
################################################################################


################################################################################
#
# Set up unit test functions that will be called below to actually run the
# unit tests.
#
# The reason that we use functions is so that we can change variables just
# inside of the functions that have their own variable scoping. In that way,
# we can keep variables that are set in one unit test from affecting the
# others.
# Testing misc functions and macros
#
################################################################################


function(unittest_append_string_var)
Expand Down Expand Up @@ -670,6 +665,13 @@ function(unittest_tribits_report_invalid_tribits_usage)
endfunction()


################################################################################
#
# Testing tribits_add_test()
#
################################################################################


function(unittest_tribits_add_test_basic)

message("\n***")
Expand Down Expand Up @@ -1304,7 +1306,6 @@ function(unittest_tribits_add_test_basic)
"NAME;${PACKEXEN};COMMAND;/some/abs/path/${PACKEXEN}.exe;arg1"
)


#
# ADD_DIR_TO_NAME
#
Expand Down Expand Up @@ -2331,6 +2332,13 @@ function(unittest_tribits_add_test_properties)
endfunction()


################################################################################
#
# Testing tribits_add_advanced_test()
#
################################################################################


function(unittest_tribits_add_advanced_test_basic)

message("\n***")
Expand Down Expand Up @@ -4135,6 +4143,13 @@ function(unittest_tribits_add_executable_and_test)
endfunction()


################################################################################
#
# Testing TriBITS ETI support code
#
################################################################################


function(unittest_tribits_eti_type_expansion)

message("*** Test passing invalid arguments to tribits_eti_type_expansion( ... )\n")
Expand Down Expand Up @@ -4282,6 +4297,7 @@ function(unittest_tribits_add_eti_instantiations_initial)

endfunction()


function(unittest_tribits_add_eti_instantiations_cumulative)

set(package ${PROJECT_NAME}Framework)
Expand Down Expand Up @@ -4363,6 +4379,7 @@ function(unittest_tribits_eti_explode)

endfunction()


function(unittest_tribits_eti_mangle_symbol)

message("*** Testing ETI Mangling ***")
Expand Down Expand Up @@ -4486,9 +4503,12 @@ function(unittest_tribits_eti_generate_macros)

endfunction()


################################################################################
#
# Execute the unit tests
#
################################################################################

# Set up some global environment stuff
set(${PROJECT_NAME}_HOSTNAME testhost.nowhere.com)
Expand All @@ -4504,7 +4524,7 @@ set( TRIBITS_ADD_TEST_ADD_TEST_UNITTEST TRUE )
set( TRIBITS_ADD_TEST_ADD_TEST_CAPTURE TRUE )

message("\n***")
message("*** Running little bits of tests")
message("*** Testing misc TriBITS functions and macros")
message("***\n")

unittest_append_string_var()
Expand Down

0 comments on commit 97bcf0d

Please sign in to comment.