2023-01-19 10:47:29 +08:00
|
|
|
# not executable
|
|
|
|
|
2023-04-05 08:37:20 +08:00
|
|
|
. ${srcdir}/d4manifest.sh
|
2023-01-19 10:47:29 +08:00
|
|
|
|
2020-06-01 23:27:57 +08:00
|
|
|
if test "x$SETX" = x1 ; then set -x ; fi
|
|
|
|
|
2022-11-14 04:15:11 +08:00
|
|
|
if test "x$NOOPTIONS" = x ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
if test $# = 0 ; then
|
|
|
|
TEST=1
|
|
|
|
else
|
|
|
|
for arg in "$@"; do
|
|
|
|
case "${arg}" in
|
|
|
|
test) TEST=1 ;;
|
|
|
|
reset) RESET=1 ;;
|
|
|
|
diff) DIFF=1 ;;
|
|
|
|
cdl) CDLDIFF=1 ;;
|
|
|
|
log) ;;
|
|
|
|
*) echo unknown argument $arg ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
fi
|
2022-11-14 04:15:11 +08:00
|
|
|
fi
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
# Define input paths
|
|
|
|
WD=`pwd`
|
2022-10-19 04:27:12 +08:00
|
|
|
cd ${top_srcdir}/dap4_test/cdltestfiles; CDLTESTFILES=`pwd` ; cd ${WD}
|
2022-11-14 04:15:11 +08:00
|
|
|
cd ${top_srcdir}/dap4_test/rawtestfiles; RAWTESTFILES=`pwd` ; cd ${WD}
|
2022-10-19 04:27:12 +08:00
|
|
|
cd ${top_srcdir}/dap4_test/baseline; BASELINE=`pwd` ; cd ${WD}
|
|
|
|
cd ${top_srcdir}/dap4_test/baselineraw; BASELINERAW=`pwd` ; cd ${WD}
|
|
|
|
cd ${top_srcdir}/dap4_test/baselineremote; BASELINEREM=`pwd` ; cd ${WD}
|
2022-11-14 04:15:11 +08:00
|
|
|
cd ${top_srcdir}/dap4_test/baselinehyrax; BASELINEHY=`pwd` ; cd ${WD}
|
2022-10-19 04:27:12 +08:00
|
|
|
cd ${top_srcdir}/dap4_test/baselinethredds; BASELINETH=`pwd` ; cd ${WD}
|
2017-03-09 08:01:10 +08:00
|
|
|
|
2018-06-27 03:58:45 +08:00
|
|
|
setresultdir() {
|
2018-09-05 01:27:47 +08:00
|
|
|
rm -fr ${builddir}/$1
|
|
|
|
mkdir -p ${builddir}/$1
|
2018-06-27 03:58:45 +08:00
|
|
|
}
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
FAILURES=
|
|
|
|
failure() {
|
|
|
|
echo "*** Fail: $1"
|
|
|
|
FAILURES=1
|
|
|
|
if test "x$2" != x ; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
PUSHD() {
|
|
|
|
pushd $1 >>/dev/null
|
|
|
|
}
|
|
|
|
POPD() {
|
|
|
|
popd >>/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
filesexist() {
|
|
|
|
for x in "$@" ; do
|
|
|
|
if ! test -e $x ; then
|
|
|
|
failure "missing file: $x"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-05-22 10:46:56 +08:00
|
|
|
urlbasename() {
|
|
|
|
constraint=`echo "$1" | cut -d '?' -f2`
|
|
|
|
unconstrained=`echo "$1" | cut -d '?' -f1`
|
|
|
|
base=`basename $unconstrained`
|
|
|
|
prefix=`dirname $unconstrained`
|
|
|
|
}
|
|
|
|
|
|
|
|
makeurl() {
|
|
|
|
urlbasename "$2"
|
|
|
|
if test "x$constraint" = "x$unconstrained" ; then
|
|
|
|
URL="$1/${prefix}/${base}${FRAG}"
|
|
|
|
else
|
|
|
|
URL="$1/${prefix}/${base}?$constraint${FRAG}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
finish() {
|
|
|
|
if test "x$FAILURES" = x1 ; then
|
|
|
|
echo "*** Fail"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "*** Pass"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-10-02 05:51:43 +08:00
|
|
|
# Return the complete set of arguments minus any found in $SUPPRESS
|
2017-03-09 08:01:10 +08:00
|
|
|
suppress() {
|
2018-10-02 05:51:43 +08:00
|
|
|
local args="$@"
|
|
|
|
suppress=
|
|
|
|
for a in $args; do
|
|
|
|
for s in $SUPPRESS; do if test "x$a" != "x$s" ; then suppress="$suppress $a"; fi; done
|
|
|
|
done
|
2017-03-09 08:01:10 +08:00
|
|
|
}
|
|
|
|
|
2023-01-19 10:47:29 +08:00
|
|
|
# Compute the set of testable names using the manifest.
|
2022-11-14 04:15:11 +08:00
|
|
|
EXCLUDEDFILES="test_vlen9 test_vlen10"
|
|
|
|
|
|
|
|
computetestablefiles() {
|
|
|
|
local F0 firs excluded
|
|
|
|
# remove untestable files
|
|
|
|
F=
|
|
|
|
first=0
|
2023-01-19 10:47:29 +08:00
|
|
|
for f in ${dap4_manifest} ; do
|
2022-11-14 04:15:11 +08:00
|
|
|
excluded=0
|
|
|
|
for x in $EXCLUDEDFILES ; do
|
|
|
|
if test "x$x" = "x$f" ; then excluded=1; break; fi
|
|
|
|
done
|
|
|
|
if test "x$excluded" = x0 ; then
|
|
|
|
if test "x$first" = x1 ; then F="${f}.nc"; first=0; else F="$F ${f}.nc"; fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2023-01-19 10:47:29 +08:00
|
|
|
# Split a d4manifest.sh constraint line
|
|
|
|
# Result is to set 4 variables: FILE QUERY INDEX FRAG
|
|
|
|
splitconstraint() {
|
|
|
|
local tpl
|
|
|
|
tpl="$1"
|
|
|
|
FILE=`echo $tpl | cut -d"?" -f1`
|
|
|
|
tpl=`echo $tpl | cut -d"?" -f2`
|
|
|
|
QUERY=`echo $tpl | cut -d"=" -f1`
|
|
|
|
INDEX=`echo $tpl | cut -d"=" -f2`
|
|
|
|
FRAG="#dap4&log&show=fetch"
|
|
|
|
}
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
VG="valgrind --leak-check=full --error-exitcode=1 --num-callers=100"
|
|
|
|
if test "x$USEVG" = x ; then VG=; fi
|
|
|
|
|
2022-11-14 04:15:11 +08:00
|
|
|
DUMPFLAGS="-XF"
|
|
|
|
|
2018-10-02 05:51:43 +08:00
|
|
|
|