Added benchmarking option to cmake-based builds, turned on unit-testing by default

This commit is contained in:
Ward Fisher 2023-02-16 11:20:45 -07:00
parent 678f632d95
commit c05505a1b8
2 changed files with 14 additions and 4 deletions

View File

@ -1411,7 +1411,14 @@ IF(ENABLE_TESTS)
# Option to turn on unit testing. See
# https://github.com/Unidata/netcdf-c/pull/1472 for more information.
###
OPTION(ENABLE_UNIT_TESTS "Run Unit Tests." OFF)
OPTION(ENABLE_UNIT_TESTS "Run Unit Tests." ON)
###
# Option to turn on performance testing.
# See https://github.com/Unidata/netcdf-c/issues/2627 for more information.
###
OPTION(ENABLE_BENCHMARKS "Run benchmark Tests." ON)
###
# End known-failures.
@ -2364,6 +2371,9 @@ IF(ENABLE_TESTS)
IF(ENABLE_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF()
IF(ENABLE_BENCHMARKS)
ADD_SUBDIRECTORY(nc_perf)
ENDIF(ENABLE_BENCHMARKS)
IF(ENABLE_UNIT_TESTS)
ADD_SUBDIRECTORY(unit_test)
ENDIF(ENABLE_UNIT_TESTS)

View File

@ -325,13 +325,13 @@ fi
# Does the user want to turn off unit tests (useful for test coverage
# analysis).
AC_MSG_CHECKING([if unit tests should be disabled])
AC_MSG_CHECKING([if unit tests should be enabled])
AC_ARG_ENABLE([unit-tests],
[AS_HELP_STRING([--disable-unit-tests],
[AS_HELP_STRING([--enable-unit-tests],
[Disable tests in unit_test directory. Other tests still run.])])
test "x$enable_unit_tests" = xno || enable_unit_tests=yes
AC_MSG_RESULT($enable_unit_tests)
AM_CONDITIONAL([BUILD_UNIT_TESTS], [test "x$enable_unit_tests" = xyes])
AM_CONDITIONAL(BUILD_UNIT_TESTS, [test "x$enable_unit_tests" = xyes])
# Does the user require dynamic loading?
# This is only for those hdf5 installs that support it.