| 1 |
#! /usr/bin/env bash |
| 2 |
# Copyright(C) 1999-2022, 2024 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 |
#PREFIX = "valgrind --tool=memcheck" |
| 14 |
PREFIX="" |
| 15 |
SUFFIX="" |
| 16 |
BINDIR=@CMAKE_CURRENT_BINARY_DIR@ |
| 17 |
SRCDIR=@CMAKE_CURRENT_SOURCE_DIR@ |
| 18 |
NCDUMP=@NETCDF_NCDUMP@ |
| 19 |
DIFF="diff -w" |
| 20 |
|
| 21 |
ret_status=0 |
| 22 |
|
| 23 |
# testwt - single precision write test |
| 24 |
echo "************************************************************************" |
| 25 |
echo "************************************************************************" |
| 26 |
rm -f test.output |
| 27 |
echo "testwt ..." |
| 28 |
echo "begin testwt" > test.output |
| 29 |
${PREFIX} ${BINDIR}/f_testwt${SUFFIX} >> test.output |
| 30 |
ret_status=$((ret_status+$?)) |
| 31 |
${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt.res |
| 32 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 33 |
echo "end testwt, status = $ret_status" >> test.output |
| 34 |
|
| 35 |
# testrd - single precision read test |
| 36 |
echo "testrd ..." |
| 37 |
echo "testrd ... [Expect ex_create NOCLOBBER error from this test]" |
| 38 |
${PREFIX} ${BINDIR}/f_testrd${SUFFIX} | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res |
| 39 |
|
| 40 |
# testcp_ss - single-to-single precision copy test |
| 41 |
echo "testcp_ss ..." |
| 42 |
echo "begin testcp_ss" >> test.output |
| 43 |
${PREFIX} ${BINDIR}/f_testcp${SUFFIX} >> test.output |
| 44 |
ret_status=$((ret_status+$?)) |
| 45 |
${NCDUMP} -d5,5 testcp.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res |
| 46 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 47 |
echo "end testcp_ss, status = $ret_status" >> test.output |
| 48 |
|
| 49 |
# testcpnl - single-to-single, normal to large copy test |
| 50 |
echo "testcpnl ..." |
| 51 |
echo "begin testcpnl" >> test.output |
| 52 |
${PREFIX} ${BINDIR}/f_testcpnl${SUFFIX} >> test.output |
| 53 |
ret_status=$((ret_status+$?)) |
| 54 |
${NCDUMP} -d5,5 testcpnl.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testcpnl.dmp | tee testcpnl.res |
| 55 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 56 |
echo "end testcpnl, status = $ret_status" >> test.output |
| 57 |
|
| 58 |
# testwt1 - single precision write test with multiple side sets |
| 59 |
echo "testwt1 ..." |
| 60 |
echo "testwt1 ... [Expect WEDGE6 warning from this test]" |
| 61 |
echo "begin testwt1" >> test.output |
| 62 |
${PREFIX} ${BINDIR}/f_testwt1${SUFFIX} >> test.output |
| 63 |
ret_status=$((ret_status+$?)) |
| 64 |
${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/test1.dmp | tee testwt1.res |
| 65 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 66 |
echo "end testwt1, status = $ret_status" >> test.output |
| 67 |
|
| 68 |
# testrd1 - single precision read test with multiple side sets |
| 69 |
echo "testrd1 ..." |
| 70 |
echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]" |
| 71 |
${PREFIX} ${BINDIR}/f_testrd1${SUFFIX} | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testrd1.dmp | tee testrd1.res |
| 72 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 73 |
|
| 74 |
# testwtd - double precision write test |
| 75 |
echo "testwtd ..." |
| 76 |
echo "begin testwtd" >> test.output |
| 77 |
${PREFIX} ${BINDIR}/f_testwtd${SUFFIX} >> test.output |
| 78 |
ret_status=$((ret_status+$?)) |
| 79 |
${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testd.dmp | tee testwtd.res |
| 80 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 81 |
echo "end testwtd, status = $ret_status" >> test.output |
| 82 |
|
| 83 |
# testrdd - double precision read test |
| 84 |
echo "testrdd ..." |
| 85 |
${PREFIX} ${BINDIR}/f_testrdd${SUFFIX} | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res |
| 86 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 87 |
|
| 88 |
# testwt2 - single precision write 2 files (simultaneously open) test |
| 89 |
echo "testwt2 ..." |
| 90 |
echo "begin testwt2" >> test.output |
| 91 |
${PREFIX} ${BINDIR}/f_testwt2${SUFFIX} >> test.output | grep -v "property name string" |
| 92 |
${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res |
| 93 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 94 |
${NCDUMP} -d5,5 test2.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res |
| 95 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 96 |
echo "end testwt2, status = $ret_status" >> test.output |
| 97 |
|
| 98 |
echo "testwt_nsid ..." |
| 99 |
echo "begin testwt_nsid" >> test.output |
| 100 |
${PREFIX} ${BINDIR}/f_testwt_nsid${SUFFIX} >> test.output |
| 101 |
ret_status=$((ret_status+$?)) |
| 102 |
${NCDUMP} -d5,5 test-nsided.exo | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/test-nsided.dmp | tee testwt_nsid.res |
| 103 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 104 |
echo "end testwt_nsid, status = $ret_status" >> test.output |
| 105 |
|
| 106 |
# testrd_nsid - single precision read test |
| 107 |
echo "testrd_nsid ..." |
| 108 |
${PREFIX} ${BINDIR}/f_testrd_nsid${SUFFIX} | grep -v version | grep -v _FillValue | ${DIFF} - ${SRCDIR}/testrd_nsid.dmp | tee testrd_nsid.res |
| 109 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) |
| 110 |
|
| 111 |
# test_nem - nemesis routines |
| 112 |
echo "test_nem ..." |
| 113 |
${PREFIX} ${BINDIR}/f_test_nem${SUFFIX} | ${DIFF} -w - ${SRCDIR}/test_nem.dmp | tee test_nem.res |
| 114 |
ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[1]})) |
| 115 |
echo "end test_nem, status = $ret_status" >> test.output |
| 116 |
|
| 117 |
# test partial read/write. Uses 'test.exo' from testwt. |
| 118 |
echo "test_partial ..." |
| 119 |
${PREFIX} ${BINDIR}/f_testwt${SUFFIX} >> test.output |
| 120 |
${PREFIX} ${BINDIR}/f_testpart${SUFFIX} >> test.output |
| 121 |
echo "************************************************************************" |
| 122 |
echo "************************************************************************" |
| 123 |
|
| 124 |
exit $ret_status |