| 1 |
#! /usr/bin/env bash |
| 2 |
# Copyright(C) 1999-2021 National Technology & Engineering Solutions |
| 3 |
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 4 |
# NTESS, the U.S. Government retains certain rights in this software. |
| 5 |
# |
| 6 |
# See packages/seacas/LICENSE for details |
| 7 |
|
| 8 |
# script to run all tests and compare them to saved dump files. |
| 9 |
# |
| 10 |
# To run the tests with valgrind checking, uncomment the next line and comment the |
| 11 |
# following line. Can also define other prefixes if wanted. |
| 12 |
|
| 13 |
if [ "$1" == "" ]; then |
| 14 |
mkdir -p nc3; cd nc3 |
| 15 |
fi |
| 16 |
if [ "$1" == "netcdf4" ]; then |
| 17 |
export EXODUS_NETCDF4=quiet |
| 18 |
mkdir -p nc4; cd nc4 |
| 19 |
fi |
| 20 |
if [ "$1" == "netcdf5" ]; then |
| 21 |
export EXODUS_NETCDF5=quiet |
| 22 |
mkdir -p nc5; cd nc5 |
| 23 |
fi |
| 24 |
|
| 25 |
#PREFIX = "valgrind --tool=memcheck" |
| 26 |
PREFIX="" |
| 27 |
SUFFIX="" |
| 28 |
BINDIR=@CMAKE_CURRENT_BINARY_DIR@ |
| 29 |
SRCDIR=@CMAKE_CURRENT_SOURCE_DIR@ |
| 30 |
NCDUMP=@NETCDF_NCDUMP@ |
| 31 |
DIFF="diff -w" |
| 32 |
|
| 33 |
ret_status=0 |
| 34 |
|
| 35 |
# testwt - single precision write test |
| 36 |
echo "************************************************************************" |
| 37 |
echo "************************************************************************" |
| 38 |
rm -f test.output |
| 39 |
echo "testwt ..." |
| 40 |
echo "begin testwt" > test.output |
| 41 |
${PREFIX} ${BINDIR}/f32_testwt${SUFFIX} >> test.output |
| 42 |
ret_status=$((ret_status+$?)) |
| 43 |
echo "end testwt" >> test.output |
| 44 |
${NCDUMP} -d5,5 test.exo | grep -v version | grep -v "word_size" | grep -v int64_status| grep -v _FillValue | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt.res |
| 45 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[4]})) |
| 46 |
|
| 47 |
# testrd - single precision read test |
| 48 |
echo "testrd ..." |
| 49 |
${PREFIX} ${BINDIR}/f32_testrd${SUFFIX} | grep -v version | grep -v "word_size" |${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res |
| 50 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 51 |
|
| 52 |
# testrdd - double precision read of single precision file |
| 53 |
echo "testrdd ..." |
| 54 |
${PREFIX} ${BINDIR}/f32_testrdd${SUFFIX} | grep -v version | grep -v "word_size" | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res |
| 55 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 56 |
|
| 57 |
# testwtd - double precision write test |
| 58 |
echo "testwtd ..." |
| 59 |
echo "begin testwtd" >> test.output |
| 60 |
${PREFIX} ${BINDIR}/f32_testwtd${SUFFIX} >> test.output |
| 61 |
ret_status=$((ret_status+$?)) |
| 62 |
${NCDUMP} -d5,5 test.exo | grep -v version | grep -v int64_status| grep -v "word_size" | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testd.dmp | tee testwtd.res |
| 63 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[4]})) |
| 64 |
|
| 65 |
# testrdd - double precision read test |
| 66 |
echo "testrdd ..." |
| 67 |
${PREFIX} ${BINDIR}/f32_testrdd${SUFFIX} | grep -v version | grep -v "word_size" | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res |
| 68 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 69 |
|
| 70 |
# testrd - single precision read of double precision file |
| 71 |
echo "testrd ..." |
| 72 |
${PREFIX} ${BINDIR}/f32_testrd${SUFFIX} | grep -v version | grep -v "word_size" | ${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res |
| 73 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 74 |
|
| 75 |
echo "************************************************************************" |
| 76 |
echo "************************************************************************" |
| 77 |
|
| 78 |
exit $ret_status |