Unidata / netcdf-c

Official GitHub repository for netCDF-C libraries and utilities.
BSD 3-Clause "New" or "Revised" License
520 stars 262 forks source link

nc_test/run_inmemory.sh has exit in middle of test script #1233

Closed edhartnett closed 5 years ago

edhartnett commented 5 years ago

We have a test script: nc_test/run_inmemory.sh:

#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

set -e

# Get the target OS and CPU
CPU=`uname -p`
OS=`uname`

#Constants
FILE3=tst_inmemory3
CREATE3=tst_inmemory3_create
FILE4=tst_inmemory4
CREATE4=tst_inmemory4_create

# For tst_open_mem
OMEMFILE=f03tst_open_mem.nc

echo ""
echo "*** Testing in-memory operations"

HASHDF5=`${top_builddir}/nc-config --has-hdf5`

# Execute the core of the inmemory tests
${execdir}/tst_inmemory
exit
${execdir}/tst_open_mem ${srcdir}/${OMEMFILE}

echo "**** Test ncdump of the resulting inmemory data"
${NCDUMP} -n "${FILE3}" ${FILE3}.nc > ${FILE3}.cdl
${NCDUMP} -n "${FILE3}" ${CREATE3}.nc > ${CREATE3}.cdl
diff -wb ${FILE3}.cdl ${CREATE3}.cdl

if test "x$HASHDF5" = "xyes" ; then
${NCDUMP} ${FILE4}.nc > ${FILE4}.cdl
${NCDUMP} ${CREATE4}.nc > ${CREATE4}.cdl
diff -wb ${FILE4}.cdl ${CREATE4}.cdl

# cleanup
rm -f ${FILE3}.nc ${FILE4}.nc ${CREATE3}.nc ${CREATE4}.nc
rm -f ${FILE3}.cdl ${FILE4}.cdl ${CREATE3}.cdl ${CREATE4}.cdl

echo "PASS: all inmemory tests"

exit 0

Note that there is an "exit" statement on line 29. This prevents over have the script from executing. Is this intentional?

WardF commented 5 years ago

My guess is that this is an oversight, but of course commenting that exit out results in a failure. Taking a look now, thanks!

DennisHeimbigner commented 5 years ago

Odd. When I removed it and ran it, it passed. Can you show the run_inmemory.log file?

WardF commented 5 years ago

I will in a bit when I am back to computer. It is failing on OSX. The w and b flags for diff are not as forgiving on OSX as they are on Linux.

DennisHeimbigner commented 5 years ago

It turns out it is a problem with the way I am constructing the files.

WardF commented 5 years ago

Is there a simple fix for this? Should I continue trying to debug it or do you have a fix for it?

DennisHeimbigner commented 5 years ago

I have a fix, although visual studio is giving me some problems. Also, when I am done, you will have to check it under OSX.