From 1640c98141036e8640eb051daf39036914980251 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Thu, 11 Apr 2019 08:12:08 -0600 Subject: [PATCH] allow tests to be built but not run --- configure.ac | 8 ++++++++ examples/c/Makefile.am | 2 ++ tests/cunit/Makefile.am | 2 ++ tests/general/Makefile.am | 2 ++ tests/performance/Makefile.am | 2 ++ tests/unit/Makefile.am | 2 ++ 6 files changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac index 7ea837ac930..fb64b23040f 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,14 @@ AC_ARG_ENABLE([papi], [AS_HELP_STRING([--disable-papi], test "x$enable_papi" = xno || enable_papi=yes AC_MSG_RESULT($enable_papi) +# Does the user want to disable test runs? +AC_MSG_CHECKING([whether test runs should be enabled for make check]) +AC_ARG_ENABLE([test-runs], [AS_HELP_STRING([--disable-test-runs], + [disable running run_test.sh test scripts for make check. Tests will still be built.])]) +test "x$enable_test_runs" = xno || enable_test_runs=yes +AC_MSG_RESULT($enable_test_runs) +AM_CONDITIONAL(RUN_TESTS, [test "x$enable_test_runs" = xyes]) + # Does the user want to enable Fortran library? AC_MSG_CHECKING([whether Fortran library should be built]) AC_ARG_ENABLE([fortran], diff --git a/examples/c/Makefile.am b/examples/c/Makefile.am index 9ee038a44c1..50750dd9132 100644 --- a/examples/c/Makefile.am +++ b/examples/c/Makefile.am @@ -10,8 +10,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/clib # Build the tests for make check. check_PROGRAMS = example1 examplePio darray_no_async +if RUN_TESTS # Tests will run from a bash script. TESTS = run_tests.sh +endif # RUN_TESTS # Distribute the test script. EXTRA_DIST = run_tests.sh diff --git a/tests/cunit/Makefile.am b/tests/cunit/Makefile.am index 2811a01be3c..ff25651eeb7 100644 --- a/tests/cunit/Makefile.am +++ b/tests/cunit/Makefile.am @@ -21,8 +21,10 @@ test_darray_async test_darray_async_many test_darray_2sync \ test_async_multicomp test_async_multi2 test_async_manyproc \ test_darray_fill test_decomp_frame test_perf2 +if RUN_TESTS # Tests will run from a bash script. TESTS = run_tests.sh +endif # RUN_TESTS # Source code for each test. test_intercomm2_SOURCES = test_intercomm2.c test_common.c pio_tests.h diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 49d6b07a753..d7f11687daa 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -60,8 +60,10 @@ pio_iosystem_tests_SOURCES = pio_iosystem_tests.F90 pio_iosystem_tests2_SOURCES = pio_iosystem_tests2.F90 pio_iosystem_tests3_SOURCES = pio_iosystem_tests3.F90 +if RUN_TESTS # Tests will run from a bash script. TESTS = run_tests.sh +endif # RUN_TESTS %.F90: %.F90.in util/pio_tf_f90gen.pl --annotate-source --out=$@ $< diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am index 6b7bfb5ec23..17a14e91ce8 100644 --- a/tests/performance/Makefile.am +++ b/tests/performance/Makefile.am @@ -27,8 +27,10 @@ check_PROGRAMS = pioperf pioperf_SOURCES = pioperformance.F90 +if RUN_TESTS # Tests will run from a bash script. TESTS = run_tests.sh +endif # RUN_TESTS EXTRA_DIST = CMakeLists.txt gensimple.pl Pioperformance.md pioperf.nl \ run_tests.sh diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 0ffa2150b93..848f2af471b 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -24,8 +24,10 @@ libglobal_vars_la_SOURCES = global_vars.F90 libncdf_tests_la_SOURCES = ncdf_tests.F90 libbasic_tests_la_SOURCES = basic_tests.F90 +if RUN_TESTS # Tests will run from a bash script. TESTS = run_tests.sh +endif # RUN_TESTS # Distribute the test script. EXTRA_DIST = CMakeLists.txt run_tests.sh input.nl