#! /usr/bin/env bash # Copyright(C) 1999-2021 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # # See packages/seacas/LICENSE for details # script to run all tests and compare them to saved dump files. # # To run the tests with valgrind checking, uncomment the next line and comment the # following line. Can also define other prefixes if wanted. if [ "$1" == "" ]; then mkdir -p nc3; cd nc3 fi if [ "$1" == "netcdf4" ]; then export EXODUS_NETCDF4=quiet mkdir -p nc4; cd nc4 fi if [ "$1" == "netcdf5" ]; then export EXODUS_NETCDF5=quiet mkdir -p nc5; cd nc5 fi #PREFIX = "valgrind --tool=memcheck" PREFIX="" SUFFIX="" BINDIR=@CMAKE_CURRENT_BINARY_DIR@ SRCDIR=@CMAKE_CURRENT_SOURCE_DIR@ NCDUMP=@NETCDF_NCDUMP@ DIFF="diff -w" ret_status=0 # testwt - single precision write test echo "************************************************************************" echo "************************************************************************" rm -f test.output echo "testwt ..." echo "begin testwt" > test.output ${PREFIX} ${BINDIR}/f32_testwt${SUFFIX} >> test.output ret_status=$((ret_status+$?)) echo "end testwt" >> test.output ${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 ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[4]})) # testrd - single precision read test echo "testrd ..." ${PREFIX} ${BINDIR}/f32_testrd${SUFFIX} | grep -v version | grep -v "word_size" |${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) # testrdd - double precision read of single precision file echo "testrdd ..." ${PREFIX} ${BINDIR}/f32_testrdd${SUFFIX} | grep -v version | grep -v "word_size" | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) # testwtd - double precision write test echo "testwtd ..." echo "begin testwtd" >> test.output ${PREFIX} ${BINDIR}/f32_testwtd${SUFFIX} >> test.output ret_status=$((ret_status+$?)) ${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 ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[4]})) # testrdd - double precision read test echo "testrdd ..." ${PREFIX} ${BINDIR}/f32_testrdd${SUFFIX} | grep -v version | grep -v "word_size" | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) # testrd - single precision read of double precision file echo "testrd ..." ${PREFIX} ${BINDIR}/f32_testrd${SUFFIX} | grep -v version | grep -v "word_size" | ${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res ret_status=$((ret_status+${PIPESTATUS[0]}+${PIPESTATUS[3]})) echo "************************************************************************" echo "************************************************************************" exit $ret_status