diff --git a/configure.ac b/configure.ac index 429a14e1e9d..ec0262495f9 100644 --- a/configure.ac +++ b/configure.ac @@ -403,6 +403,7 @@ AC_CONFIG_FILES([tests/general/pio_tutil.F90:tests/general/util/pio_tutil.F90]) AC_CONFIG_FILES([tests/cunit/run_tests.sh], [chmod ugo+x tests/cunit/run_tests.sh]) AC_CONFIG_FILES([tests/ncint/run_tests.sh], [chmod ugo+x tests/ncint/run_tests.sh]) AC_CONFIG_FILES([tests/ncint/run_perf.sh], [chmod ugo+x tests/ncint/run_perf.sh]) +AC_CONFIG_FILES([tests/unit/run_tests.sh], [chmod ugo+x tests/unit/run_tests.sh]) AC_CONFIG_FILES([examples/c/run_tests.sh], [chmod ugo+x examples/c/run_tests.sh]) # Args: diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 1eaea6e77b3..b1ac4dd39e7 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -10,10 +10,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/flib # Build the test for make check. -check_PROGRAMS = pio_unit_test_driver +check_PROGRAMS = pio_unit_test_driver ftst_vars pio_unit_test_driver_SOURCES = driver.F90 pio_unit_test_driver_LDADD = libglobal_vars.la libncdf_tests.la \ -libbasic_tests.la ${top_builddir}/src/flib/libpiof.la ${top_builddir}/src/clib/libpioc.la +libbasic_tests.la ${top_builddir}/src/flib/libpiof.la \ +${top_builddir}/src/clib/libpioc.la +ftst_vars_SOURCES = ftst_vars.F90 # Build these uninstalled convenience libraries. noinst_LTLIBRARIES = libglobal_vars.la libncdf_tests.la \ diff --git a/tests/unit/basic_tests.F90 b/tests/unit/basic_tests.F90 index e48c99a9047..b9f72692be4 100644 --- a/tests/unit/basic_tests.F90 +++ b/tests/unit/basic_tests.F90 @@ -3,6 +3,7 @@ !! @brief Module containing basic unit tests that are run for both !! binary and netcdf file types. !< +#include "config.h" module basic_tests diff --git a/tests/unit/driver.F90 b/tests/unit/driver.F90 index 6764b875595..6c3975d9b47 100644 --- a/tests/unit/driver.F90 +++ b/tests/unit/driver.F90 @@ -2,6 +2,7 @@ !! @file !! @brief The driver for PIO unit tests !< +#include "config.h" Program pio_unit_test_driver use pio diff --git a/tests/unit/ftst_vars.F90 b/tests/unit/ftst_vars.F90 new file mode 100644 index 00000000000..335c8423f1a --- /dev/null +++ b/tests/unit/ftst_vars.F90 @@ -0,0 +1,23 @@ + ! This is a test of the PIO Fortran library. + + ! This tests var functions. + + ! Ed Hartnett, 8/28/20 +#include "config.h" + +program ftst_vars + use mpi + use pio + integer :: my_rank, ntasks + integer :: ierr + + ! Set up MPI + call MPI_Init(ierr) + call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierr) + call MPI_Comm_size(MPI_COMM_WORLD, ntasks , ierr) + + if (my_rank .eq. 0) print *,'Testing variables...' + + if (my_rank .eq. 0) print *,'SUCCESS!' + call MPI_Finalize(ierr) +end program ftst_vars diff --git a/tests/unit/global_vars.F90 b/tests/unit/global_vars.F90 index f3347ba38c9..69cf0f412ac 100644 --- a/tests/unit/global_vars.F90 +++ b/tests/unit/global_vars.F90 @@ -2,6 +2,7 @@ !! @file !! @brief Module containing variables used across all unit test files !< +#include "config.h" module global_vars diff --git a/tests/unit/ncdf_tests.F90 b/tests/unit/ncdf_tests.F90 index 831a06d28fb..765132751e3 100644 --- a/tests/unit/ncdf_tests.F90 +++ b/tests/unit/ncdf_tests.F90 @@ -2,6 +2,7 @@ !! @file !! @brief Module containing netcdf-specific PIO unit tests !< +#include "config.h" module ncdf_tests diff --git a/tests/unit/run_tests.sh b/tests/unit/run_tests.sh.in similarity index 82% rename from tests/unit/run_tests.sh rename to tests/unit/run_tests.sh.in index 0f7c61ee178..aedce3635cf 100755 --- a/tests/unit/run_tests.sh +++ b/tests/unit/run_tests.sh.in @@ -10,14 +10,14 @@ trap exit INT TERM printf 'running PIO tests...\n' -PIO_TESTS='pio_unit_test_driver' +PIO_TESTS='pio_unit_test_driver ftst_vars' success1=true for TEST in $PIO_TESTS do success1=false echo "running ${TEST}" - mpiexec -n 4 ./${TEST} && success1=true + @WITH_MPIEXEC@ -n 4 ./${TEST} && success1=true if test $success1 = false; then break fi