diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b0573111b..f1ed322786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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." OFF) + ### # 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) @@ -2604,6 +2614,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURREN configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/plugins/findplugin.sh @ONLY NEWLINE_STYLE LF) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/examples/C/findplugin.sh @ONLY NEWLINE_STYLE LF) +IF(ENABLE_BENCHMARKS) + IF(ENABLE_PARALLEL4) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nc_perf/run_par_bm_test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/nc_perf/run_par_bm_test.sh @ONLY NEWLINE_STYLE LF) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nc_perf/run_gfs_test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/nc_perf/run_gfs_test.sh @ONLY NEWLINE_STYLE LF) + ENDIF(ENABLE_PARALLEL4) +ENDIF(ENABLE_BENCHMARKS) + IF(ENABLE_TESTS) ##### # Build ncdap_test|dap4_test/findtestserver[4].c diff --git a/configure.ac b/configure.ac index 6c0698d803..be6835a599 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/nc_perf/CMakeLists.txt b/nc_perf/CMakeLists.txt index d0acdb61ef..6f6ef0ec24 100644 --- a/nc_perf/CMakeLists.txt +++ b/nc_perf/CMakeLists.txt @@ -24,8 +24,10 @@ add_bin_test(nc_perf tst_files3 tst_utils.c) add_bin_test(nc_perf tst_mem tst_utils.c) add_bin_test(nc_perf tst_wrf_reads tst_utils.c) add_bin_test(nc_perf tst_attsperf tst_utils.c) +add_bin_test(nc_perf tst_bm_rando tst_utils.c) +add_bin_test(nc_perf tst_compress tst_utils.c) -add_sh_test(nc_perf run_knmi_bm) +#add_sh_test(nc_perf run_knmi_bm) add_sh_test(nc_perf perftest) add_sh_test(nc_perf run_tst_chunks) add_sh_test(nc_perf run_bm_elena) @@ -36,9 +38,11 @@ add_sh_test(nc_perf run_bm_test2) # This will run a parallel I/O benchmark for parallel builds. IF(TEST_PARALLEL4) +add_bin_test(nc_perf tst_compress_par tst_utils.c) add_sh_test(nc_perf run_par_bm_test) -ENDIF() -ENDIF() +ENDIF(TEST_PARALLEL4) +ENDIF(BUILD_UTILITIES) + +FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) +FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE) -ADD_EXTRA_DIST(run_par_bm_test.sh.in run_knmi_bm.sh CMakeLists.txt -perftest.sh run_bm_test1.sh run_bm_test2.sh) diff --git a/nc_perf/run_gfs_test.sh.in b/nc_perf/run_gfs_test.sh.in old mode 100644 new mode 100755 diff --git a/nc_perf/run_par_bm_test.sh.in b/nc_perf/run_par_bm_test.sh.in old mode 100644 new mode 100755 diff --git a/nc_perf/tst_compress.c b/nc_perf/tst_compress.c index 354ac422cb..1495ff4848 100644 --- a/nc_perf/tst_compress.c +++ b/nc_perf/tst_compress.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #define TEST_NAME "tst_compress"