Commit 8e1d7591 authored by Lev Walkin's avatar Lev Walkin

better test diagnostics

parent b47d1ada
......@@ -4,15 +4,17 @@
diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files
diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output
ec=0
finalExitCode=0
if [ "$1" != "regenerate" ]; then
set -e
fi
PROCESSING=""
LAST_FAILED=""
print_status() {
echo "Error while processing $PROCESSING"
if [ -n "${LAST_FAILED}" ]; then
echo "Error while processing $LAST_FAILED"
fi
}
trap print_status EXIT
......@@ -29,20 +31,20 @@ for ref in ${top_srcdir}/tests/tests-asn1c-compiler/*.asn1.-*; do
template=.tmp.check-parsing.$$
oldversion=${template}.old
newversion=${template}.new
PROCESSING="$ref (from $src)"
LANG=C sed -e 's/^found in .*/found in .../' < "$ref" > "$oldversion"
ec=0
(${top_builddir}/asn1c/asn1c -S ${top_srcdir}/skeletons -no-gen-OER -no-gen-PER "-$flags" "$src" | LANG=C sed -e 's/^found in .*/found in .../' > "$newversion") || ec=$?
if [ $? = 0 ]; then
diff $diffArgs "$oldversion" "$newversion" || ec=$?
fi
if [ $ec != 0 ]; then
LAST_FAILED="$ref (from $src)"
finalExitCode=$ec
fi
rm -f $oldversion $newversion
if [ "$1" = "regenerate" ]; then
${top_builddir}/asn1c/asn1c -S ${top_srcdir}/skeletons -no-gen-OER -no-gen-PER "-$flags" "$src" > "$ref"
fi
done
if [ $ec = 0 ]; then
trap '' EXIT
fi
exit $ec
exit $finalExitCode
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment