From b5054f668a2f24c4bdabf4b25e66a328608db5ca Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Mon, 25 Mar 2019 07:19:32 -0600 Subject: [PATCH] getting fortran tests working --- tests/unit/Makefile.am | 4 ++-- tests/unit/run_tests.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 tests/unit/run_tests.sh diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 868cf96d18b..63ce64b4187 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -22,10 +22,10 @@ libncdf_tests_la_SOURCES = ncdf_tests.F90 libbasic_tests_la_SOURCES = basic_tests.F90 # Tests will run from a bash script. -#TESTS = run_tests.sh +TESTS = run_tests.sh # Distribute the test script. -EXTRA_DIST = CMakeLists.txt #run_tests.sh +EXTRA_DIST = CMakeLists.txt run_tests.sh # Clean up files produced during testing. CLEANFILES = *.nc *.log diff --git a/tests/unit/run_tests.sh b/tests/unit/run_tests.sh new file mode 100755 index 00000000000..c892aa1b65a --- /dev/null +++ b/tests/unit/run_tests.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# This is a test script for PIO for tests/unit directory. +# Ed Hartnett 3/25/19 + +# Stop execution of script if error is returned. +set -e + +# Stop loop if ctrl-c is pressed. +trap exit INT TERM + +printf 'running PIO tests...\n' + +PIO_TESTS='pio_unit_test_driver' + +success1=true +for TEST in $PIO_TESTS +do + success1=false + echo "running ${TEST}" + mpiexec -n 4 ./${TEST} && success1=true || break +done + +# Did we succeed? +if test x$success1 = xtrue; then + exit 0 +fi +exit 1