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 7, 2022
1 parent 154dcb4 commit 40b81ed
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 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 @@ -2314,6 +2316,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 @@ -4118,6 +4127,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 @@ -4265,6 +4281,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 @@ -4346,6 +4363,7 @@ function(unittest_tribits_eti_explode)

endfunction()


function(unittest_tribits_eti_mangle_symbol)

message("*** Testing ETI Mangling ***")
Expand Down Expand Up @@ -4469,9 +4487,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 @@ -4487,7 +4508,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 40b81ed

Please sign in to comment.