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
|
|
|
|
2022-11-14 04:15:11 +08:00
|
|
|
computetestablefiles
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
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"
|
2022-11-14 04:15:11 +08:00
|
|
|
if ! ${VG} ${execdir}/test_meta ${RAWTESTFILES}/${f}.dmr ${builddir}/results_test_meta/${f} ; then
|
|
|
|
failure "${execdir}/test_meta ${RAWTESTFILES}/${f}.dmr ${builddir}/results_test_meta/${f}"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
2022-11-14 04:15:11 +08:00
|
|
|
${NCDUMP} ${DUMPFLAGS} -h ${builddir}/results_test_meta/${f} > ${builddir}/results_test_meta/${f}.d4m
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x${TEST}" = x1 ; then
|
2022-11-14 04:15:11 +08:00
|
|
|
if ! diff -wBb ${BASELINE}/${f}.d4m ${builddir}/results_test_meta/${f}.d4m ; then
|
|
|
|
failure "diff -wBb ${BASELINE}/${f}.ncdump ${builddir}/results_test_meta/${f}.d4m"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
elif test "x${RESET}" = x1 ; then
|
|
|
|
echo "${f}:"
|
2022-11-14 04:15:11 +08:00
|
|
|
cp ${builddir}/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
|
2022-11-14 04:15:11 +08:00
|
|
|
echo "diff -wBb ${CDLTESTFILES}/${f}.cdl ${builddir}/results_test_meta/${f}.d4m"
|
|
|
|
rm -f ${builddir}/tmp
|
2017-03-09 08:01:10 +08:00
|
|
|
cat ${CDLTESTFILES}/${f}.cdl \
|
2022-11-14 04:15:11 +08:00
|
|
|
cat >${builddir}/tmp
|
|
|
|
echo diff -wBbu ${builddir}/tmp ${builddir}/results_test_meta/${f}.d4m
|
|
|
|
if ! diff -wBbu ${builddir}/tmp ${builddir}/results_test_meta/${f}.d4m ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "${f}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2021-01-15 12:39:08 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
finish
|
|
|
|
|
2017-04-04 11:39:44 +08:00
|
|
|
|