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_parse.sh:"
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
cd ${DMRTESTFILES}
|
|
|
|
F=`ls -1 *.dmr | sed -e 's/[.]dmr//' |tr '\r\n' ' '`
|
|
|
|
cd $WD
|
|
|
|
|
2018-06-27 03:58:45 +08:00
|
|
|
setresultdir results_test_parse
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4p ; fi
|
|
|
|
for f in $F ; do
|
|
|
|
echo "testing: $f"
|
2017-11-18 01:49:06 +08:00
|
|
|
if ! ${VG} ${execdir}/test_parse ${DMRTESTFILES}/${f}.dmr > ./results_test_parse/${f}.d4p ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "${f}"
|
|
|
|
fi
|
|
|
|
if test "x${TEST}" = x1 ; then
|
2017-11-18 01:49:06 +08:00
|
|
|
if ! diff -wBb ${BASELINE}/${f}.d4p ./results_test_parse/${f}.d4p ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
failure "${f}"
|
|
|
|
fi
|
|
|
|
elif test "x${DIFF}" = x1 ; then
|
2017-11-18 01:49:06 +08:00
|
|
|
echo "diff -wBb ${DMRTESTFILES}/${f}.dmr ./results_test_parse/${f}.d4p"
|
2017-03-09 08:01:10 +08:00
|
|
|
rm -f ./tmp
|
2017-11-18 01:49:06 +08:00
|
|
|
cat ./results_test_parse/${f}.d4p \
|
2017-03-09 08:01:10 +08:00
|
|
|
| sed -e '/<Dimensions>/d' -e '/<Types>'/d -e '/<Variables>'/d -e '/<Groups>'/d \
|
|
|
|
| sed -e '/<\/Dimensions>/d' -e '/<\/Types>'/d -e '/<\/Variables>'/d -e '/<\/Groups>'/d \
|
|
|
|
| sed -e '/_edu.ucar.opaque.size/,+2d' \
|
|
|
|
| cat > ./tmp
|
|
|
|
if ! diff -wBb ${DMRTESTFILES}/${f}.dmr ./tmp ; then
|
|
|
|
failure "${f}"
|
|
|
|
fi
|
|
|
|
elif test "x${RESET}" = x1 ; then
|
|
|
|
echo "${f}:"
|
2017-11-18 01:49:06 +08:00
|
|
|
cp ./results_test_parse/${f}.d4p ${BASELINE}/${f}.d4p
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
done
|
2017-11-18 01:49:06 +08:00
|
|
|
rm -rf ./results_test_parse
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
finish
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
2017-04-04 11:39:44 +08:00
|
|
|
|