From 97bcf0d3218ec235509f37f69b0629bd406cd18a Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 3 Jun 2022 13:38:27 -0600 Subject: [PATCH] Add headers for different sets of unit tests (#483) 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. --- .../core/TestingFunctionMacro_UnitTests.cmake | 54 +++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/test/core/TestingFunctionMacro_UnitTests.cmake b/test/core/TestingFunctionMacro_UnitTests.cmake index 8c5058b17..daa71fa3d 100644 --- a/test/core/TestingFunctionMacro_UnitTests.cmake +++ b/test/core/TestingFunctionMacro_UnitTests.cmake @@ -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) @@ -670,6 +665,13 @@ function(unittest_tribits_report_invalid_tribits_usage) endfunction() +################################################################################ +# +# Testing tribits_add_test() +# +################################################################################ + + function(unittest_tribits_add_test_basic) message("\n***") @@ -1304,7 +1306,6 @@ function(unittest_tribits_add_test_basic) "NAME;${PACKEXEN};COMMAND;/some/abs/path/${PACKEXEN}.exe;arg1" ) - # # ADD_DIR_TO_NAME # @@ -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***") @@ -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") @@ -4282,6 +4297,7 @@ function(unittest_tribits_add_eti_instantiations_initial) endfunction() + function(unittest_tribits_add_eti_instantiations_cumulative) set(package ${PROJECT_NAME}Framework) @@ -4363,6 +4379,7 @@ function(unittest_tribits_eti_explode) endfunction() + function(unittest_tribits_eti_mangle_symbol) message("*** Testing ETI Mangling ***") @@ -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) @@ -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()