Skip to content

Commit

Permalink
starting to add ftst_vars.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 28, 2020
1 parent 2987785 commit e9f4f75
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions tests/unit/basic_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/unit/driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!! @file
!! @brief The driver for PIO unit tests
!<
#include "config.h"

Program pio_unit_test_driver
use pio
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/ftst_vars.F90
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/unit/global_vars.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!! @file
!! @brief Module containing variables used across all unit test files
!<
#include "config.h"

module global_vars

Expand Down
1 change: 1 addition & 0 deletions tests/unit/ncdf_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!! @file
!! @brief Module containing netcdf-specific PIO unit tests
!<
#include "config.h"

module ncdf_tests

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/run_tests.sh → tests/unit/run_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9f4f75

Please sign in to comment.