📄 testh5.sh.in
字号:
#!/bin/sh####################################################################### File: testh5.sh## Purpose: Test all of the executables using h5diff## Version: $Id: testh5.sh.in,v 1.1 2005/08/03 13:12:43 cary Exp $## Copyright 1999-2003 Tech-X Corporation#######################################################################echoecho Executing $0 $*# Get optionswhile test -n "$1"; do case "$1" in -i) INTERACTIVE=yes shift ;; *) break ;; esacdone# set some needed pathsTEST_PATH=`dirname $0`# Find the most recent version of hdf5-1.6H5DIFF=@H5DIFF@############ Get the options###########testname=$1# Create sed commands filescat >shorten.sed <<EOF/Comparing/p/differences/p/Comparison failed/p/has rank/pEOFcat >failures.sed <<EOF/differences/p/Comparison failed/pEOF# remove old log, h5, txt filesrm -f ${testname}.out ${testname}.log ${testname}*.h5 ${testname}*.txt# run demoecho Running $testname... | tee -a $testname.outres=0# Run and get result./${testname}.sh 2>&1 | tee -a $testname.outres=${PIPESTATUS[0]}echo ./${testname}.sh finished with result $rescase $res in# test crashed 0) sigseg=`grep SIGSEGV $testname.out` if test -n "$sigseg"; then echo " ${testname} crashed! SIGSEGV!" | tee check-$testname.log exit $res fi p4_error=`grep p4_error $testname.out` if test -n "$p4_error"; then echo " ${testname} crashed! p4_error!" | tee check-$testname.log exit $res fi echo " ${testname} ran successfully." | tee check-$testname.log ;; 127) echo " ${testname} crashed! Unable to find executable!" | tee check-$testname.log exit $res ;; 55) echo " ${testname} test was not run because the required build options were not present. See ${testname}.out." | tee check-$testname.log exit $res ;; 56) echo " ${testname} test was not run because there is no parallel build. See ${testname}.out." | tee check-$testname.log exit $res ;; *) echo " ${testname} crashed! See ${testname}.out." | tee check-$testname.log exit $res ;;esac# test ran successfully# Check for filesecho Checking for filesh5files=`ls ${testname}*.h5`if test -z "$h5files"; then echo " ${testname} failed! Executed, but no h5 files were created! See ${testname}.out." | tee check-$testname.log exit 57fi# Do diffingecho "done." | tee -a $testname.out# echo "" | tee -a $testname.outecho Examining output from $testname: >diffs.txt# for j in `ls ${testname}*.h5`; dofor j in $h5files; do# make sure results in place if test ! -f ${testname}_accepted/${j}; then echo " ${testname} failed! Executed, but accepted file ${testname}_accepted/$j not present! See ${testname}.out." | tee check-$testname.log exit 58 fi# Get the parameters for this test DATANAME=`echo $j | sed "s/${testname}_//" | sed 's/_.*.h5//'` if test -f ${testname}.diff; then NOTEST=`grep ^${DATANAME}_NOTEST ${testname}.diff` if test -n "$NOTEST"; then echo Skipping $DATANAME continue fi RELATIVE=`grep ^${DATANAME}_RELATIVE ${testname}.diff | sed "s/^${DATANAME}_RELATIVE=//"` ABSOLUTE=`grep ^${DATANAME}_ABSOLUTE ${testname}.diff | sed "s/^${DATANAME}_ABSOLUTE=//"` fi unset h5diffopts if test -n "$RELATIVE"; then h5diffopts="-p $RELATIVE" fi if test -n "$ABSOLUTE"; then h5diffopts="$h5diffopts -d $ABSOLUTE" fi# Do this test h5diffcmd="$H5DIFF ${j} ${testname}_accepted/${j} $h5diffopts -v" echo "Comparing ${j}: $h5diffcmd" 1>>diffs.txt 2>&1 $h5diffcmd | sed -n -f shorten.sed >>diffs.txtdonecat diffs.txt | tee -a $testname.out# Check for any failuresfail1=`grep differences diffs.txt | sed 's/^0 differences.*$//'`fail2=`grep "Comparison failed" diffs.txt`fail3=`grep "max dimensions" diffs.txt`if test -n "$fail1" -o -n "$fail2" -o -n "$fail3"; then msg=" $testname failed. See $testname.out."else msg=" $testname passed."fiecho $msg >>$testname.outecho $msg | tee check-$testname.logrm diffs.txt
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -