2017-03-09 08:01:10 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
|
|
|
. ${srcdir}/d4test_common.sh
|
|
|
|
|
2017-05-18 02:30:24 +08:00
|
|
|
echo "test_meta.sh:"
|
|
|
|
|
2018-10-31 10:48:12 +08:00
|
|
|
set -e
|
2018-10-02 05:51:43 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
cd ${DMRTESTFILES}
|
|
|
|
F=`ls -1 *.dmr | sed -e 's/[.]dmr//g' | tr '\r\n' ' '`
|
|
|
|
cd $WD
|
|
|
|
|
|
|
|
CDL=
|
|
|
|
for f in ${F} ; do
|
|
|
|
STEM=`echo $f | cut -d. -f 1`
|
|
|
|
if test -e ${CDLTESTFILES}/${STEM}.cdl ; then
|
|
|
|
CDL="${CDL} ${STEM}"
|
|
|
|
else
|
2017-08-06 12:41:31 +08:00
|
|
|
echo "Not found: ${CDLTESTFILES}/${STEM}.cdl; ignored"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4m ; fi
|
|
|
|
|
2018-06-27 03:58:45 +08:00
|
|
|
setresultdir results_test_meta
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
for f in ${F} ; do
|
|
|
|
echo "checking: $f"
|
2017-11-18 01:49:06 +08:00
|
|
|
if ! ${VG} ${execdir}/test_meta ${DMRTESTFILES}/${f}.dmr ./results_test_meta/${f} ; then
|
|
|
|
failure "${execdir}/test_meta ${DMRTESTFILES}/${f}.dmr ./results_test_meta/${f}"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
2018-10-02 05:51:43 +08:00
|
|
|
${NCDUMP} ${DUMPFLAGS} -h ./results_test_meta/${f} > ./results_test_meta/${f}.d4m
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x${TEST}" = x1 ; then
|
2017-11-18 01:49:06 +08:00
|
|
|
if ! diff -wBb ${BASELINE}/${f}.d4m ./results_test_meta/${f}.d4m ; then
|
|
|
|
failure "diff -wBb ${BASELINE}/${f}.ncdump ./results_test_meta/${f}.d4m"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
elif test "x${RESET}" = x1 ; then
|
|
|
|
echo "${f}:"
|
2017-11-18 01:49:06 +08:00
|
|
|
cp ./results_test_meta/${f}.d4m ${BASELINE}/${f}.d4m
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test "x${CDLDIFF}" = x1 ; then
|
|
|
|
for f in $CDL ; do
|
2017-11-18 01:49:06 +08:00
|
|
|
echo "diff -wBb ${CDLTESTFILES}/${f}.cdl ./results_test_meta/${f}.d4m"
|
2017-03-09 08:01:10 +08:00
|
|
|
rm -f ./tmp
|
|
|
|
cat ${CDLTESTFILES}/${f}.cdl \
|
|
|
|
cat >./tmp
|
2017-11-18 01:49:06 +08:00
|
|
|
echo diff -wBbu ./tmp ./results_test_meta/${f}.d4m
|
|
|
|
if ! diff -wBbu ./tmp ./results_test_meta/${f}.d4m ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "${f}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2017-11-18 01:49:06 +08:00
|
|
|
rm -rf ./results_test_meta
|
2017-03-09 08:01:10 +08:00
|
|
|
finish
|
|
|
|
|
2017-04-04 11:39:44 +08:00
|
|
|
|