Skip to content

Commit

Permalink
Revert "Final stage of bats removal, all tests converted to use shell…
Browse files Browse the repository at this point in the history
… scripts (#228)"

This reverts commit a34023f.
  • Loading branch information
wrongkindofdoctor authored Dec 2, 2019
1 parent a34023f commit acf8b28
Show file tree
Hide file tree
Showing 97 changed files with 1,057 additions and 578 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ before_script:
- export CPPFLAGS="-I/usr/include -Duse_LARGEFILE -DMAXFIELDMETHODS_=500 ${CPPFLAGS_ADD}"
- export FCFLAGS="-fcray-pointer -Waliasing -ffree-line-length-none -fno-range-check ${FCFLAGS_REAL_KIND} ${OPENMP}"
- export LDFLAGS='-L/usr/lib'
- export LOG_DRIVER_FLAGS="--comments"

script:
- autoreconf -i
Expand Down
19 changes: 18 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ AC_PROG_F77
# Find the install program.
AC_PROG_INSTALL

# Is bats installed? It is required for testing.
AC_CHECK_PROGS([FMS_BATS], [bats])
if test -z "$FMS_BATS"; then
AC_MSG_ERROR([Cannot find bats utility. Install bats and try again.])
fi

# Is sed installed? It is required for testing.
AC_CHECK_PROGS([FMS_SED], [sed])
if test -z "$FMS_SED"; then
AC_MSG_ERROR([Cannot find sed. Install sed and try again.])
fi

# Is ncgen installed? It is required for testing.
AC_CHECK_PROGS([FMS_NCGEN], [ncgen])
if test -z "$FMS_NCGEN"; then
AC_MSG_ERROR([Cannot find ncgen. Install ncgen and try again.])
fi

# Check to see if any macros must be set to enable large (>2GB) files.
AC_SYS_LARGEFILE

Expand Down Expand Up @@ -136,7 +154,6 @@ AC_CONFIG_FILES([Makefile
sat_vapor_pres/Makefile
random_numbers/Makefile
libFMS/Makefile
test_fms/test_common.sh
test_fms/Makefile
test_fms/diag_manager/Makefile
test_fms/data_override/Makefile
Expand Down
6 changes: 2 additions & 4 deletions test_fms/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
ACLOCAL_AMFLAGS = -I m4

# Make targets will be run in each subdirectory. Order is significant.
SUBDIRS = diag_manager data_override exchange monin_obukhov drifters \
mosaic interpolator fms mpp mpp_io time_interp time_manager \
SUBDIRS = diag_manager data_override exchange monin_obukhov drifters \
mosaic interpolator fms mpp mpp_io time_interp time_manager \
horiz_interp field_manager fft axis_utils

EXTRA_DIST = test_common.sh.in
14 changes: 10 additions & 4 deletions test_fms/axis_utils/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

# uramirez, Ed Hartnett

LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/tap-driver.sh

# Set srcdir as evironment variable to be reference in the job script
TESTS_ENVIRONMENT = srcdir="$(top_srcdir)"

# Find the fms and mpp mod files.
AM_CPPFLAGS = -I${top_builddir}/axis_utils -I${top_builddir}/fms \
-I${top_builddir}/mpp
AM_CPPFLAGS = -I${top_builddir}/axis_utils -I${top_builddir}/fms \
-I${top_builddir}/mpp

# Link to the FMS library.
LDADD = ${top_builddir}/libFMS/libFMS.la
Expand All @@ -17,10 +23,10 @@ check_PROGRAMS = test_axis_utils
test_axis_utils_SOURCES = test_axis_utils.F90

# Run the test program.
TESTS = test_axis_utils2.sh
TESTS = test_axis_utils.sh

# Copy over other needed files to the srcdir
EXTRA_DIST = input_base.nml test_axis_utils2.sh
EXTRA_DIST = test_axis_utils.sh test_axis_utils.bats input_base.nml

# Clean up
CLEANFILES = input.nml *.out*
10 changes: 10 additions & 0 deletions test_fms/axis_utils/test_axis_utils.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
teardown () {
# Echo the output. Will only be done on a test failure.
echo "$output"
}

@test "1" {
skip "Fails in 32bit/Mixed mode"
run mpirun -n 2 ./test_axis_utils
[ "$status" -eq 0 ]
}
5 changes: 5 additions & 0 deletions test_fms/axis_utils/test_axis_utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

cp $srcdir/test_fms/axis_utils/input_base.nml input.nml

bats $srcdir/test_fms/axis_utils/test_axis_utils.bats
16 changes: 0 additions & 16 deletions test_fms/axis_utils/test_axis_utils2.sh

This file was deleted.

20 changes: 13 additions & 7 deletions test_fms/data_override/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@

# uramirez, Ed Hartnett

LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/tap-driver.sh

# Set srcdir as evironment variable to be reference in the job script.
TESTS_ENVIRONMENT = srcdir="$(top_srcdir)" builddir="$(top_builddir)"

# Find the needed mod and .inc files.
AM_CPPFLAGS = -I${top_srcdir}/include -I${top_builddir}/mpp \
-I${top_builddir}/fms -I${top_builddir}/constants \
-I${top_builddir}/time_manager -I${top_builddir}/diag_manager \
AM_CPPFLAGS = -I${top_srcdir}/include -I${top_builddir}/mpp \
-I${top_builddir}/fms -I${top_builddir}/constants \
-I${top_builddir}/time_manager -I${top_builddir}/diag_manager \
-I${top_builddir}/data_override

# Link to the FMS library.
Expand All @@ -19,11 +25,11 @@ check_PROGRAMS = test_data_override
test_data_override_SOURCES = test_data_override.F90

# Run the test program.
TESTS = test_data_override2.sh
TESTS = test_data_override.sh

# Include these files with the distribution.
EXTRA_DIST = input_base.nml diag_table_base data_table_base \
test_data_override2.sh
EXTRA_DIST = test_data_override.sh test_data_override.bats \
input.nml_base diag_table data_table

# Clean up
CLEANFILES = input.nml *.nc* *.out diag_table data_table
CLEANFILES = input.nml *.nc* *.out *_table
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions test_fms/data_override/test_data_override.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
setup() {
# Clear out any previous test files
rm -f input.nml > /dev/null 2>&1

# Setup the run directory
tnum=$( printf "%2.2d" ${BATS_TEST_NUMBER} )
sed "s/<test_num>/${tnum}/" $srcdir/test_fms/data_override/input.nml_base > input.nml
}

teardown () {
# Echo the output. Will only be done on a test failure.
echo "$output"
}

@test "Test 1: Cubic-Grid" {
skip "The input file is missing"
cp -r $srcdir/test_fms/data_override/INPUT $builddir/test_fms/data_override/INPUT
run mpirun -n 2 ./test_data_override
[ "$status" -eq 0 ]
}

@test "Test 2: Latlon-Grid" {
skip "The input file is missing"
run mpirun -n 2 ./test_data_override
[ "$status" -eq 0 ]
chmod 755 $builddir/test_fms/data_override/INPUT
rm -rf $builddir/test_fms/data_override/INPUT
}
6 changes: 6 additions & 0 deletions test_fms/data_override/test_data_override.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

cp $srcdir/test_fms/data_override/data_table data_table
cp $srcdir/test_fms/data_override/diag_table diag_table

bats $srcdir/test_fms/data_override/test_data_override.bats
24 changes: 0 additions & 24 deletions test_fms/data_override/test_data_override2.sh

This file was deleted.

17 changes: 12 additions & 5 deletions test_fms/diag_manager/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

# uramirez, Ed Hartnett

LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/tap-driver.sh

# Set srcdir as evironment variable to be reference in the job script
TESTS_ENVIRONMENT = srcdir="$(top_srcdir)"

# Find the needed mod and .inc files.
AM_CPPFLAGS = -I${top_srcdir}/include -I${top_builddir}/mpp \
-I${top_builddir}/fms -I${top_builddir}/diag_manager \
AM_CPPFLAGS = -I${top_srcdir}/include -I${top_builddir}/mpp \
-I${top_builddir}/fms -I${top_builddir}/diag_manager \
-I${top_builddir}/time_manager -I${top_builddir}/constants

# Link to the FMS library.
Expand All @@ -17,10 +23,11 @@ check_PROGRAMS = test_diag_manager
# This is the source code for the test.
test_diag_manager_SOURCES = test_diag_manager.F90

# Run the test.
TESTS = test_diag_manager2.sh
# Run the test program.
TESTS = test_diag_manager.sh

# Copy over other needed files to the srcdir
EXTRA_DIST = input.nml_base diagTables test_diag_manager2.sh
EXTRA_DIST = test_diag_manager.sh input.nml_base diagTables \
test_diag_manager.bats

CLEANFILES = input.nml *.nc *.out
Loading

0 comments on commit acf8b28

Please sign in to comment.