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

better test diagnostics

parent b47d1ada
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files
diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output
ec=0 finalExitCode=0
if [ "$1" != "regenerate" ]; then if [ "$1" != "regenerate" ]; then
set -e set -e
fi fi
PROCESSING="" LAST_FAILED=""
print_status() { print_status() {
echo "Error while processing $PROCESSING" if [ -n "${LAST_FAILED}" ]; then
echo "Error while processing $LAST_FAILED"
fi
} }
trap print_status EXIT trap print_status EXIT
...@@ -29,20 +31,20 @@ for ref in ${top_srcdir}/tests/tests-asn1c-compiler/*.asn1.-*; do ...@@ -29,20 +31,20 @@ for ref in ${top_srcdir}/tests/tests-asn1c-compiler/*.asn1.-*; do
template=.tmp.check-parsing.$$ template=.tmp.check-parsing.$$
oldversion=${template}.old oldversion=${template}.old
newversion=${template}.new newversion=${template}.new
PROCESSING="$ref (from $src)"
LANG=C sed -e 's/^found in .*/found in .../' < "$ref" > "$oldversion" 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=$? (${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 if [ $? = 0 ]; then
diff $diffArgs "$oldversion" "$newversion" || ec=$? diff $diffArgs "$oldversion" "$newversion" || ec=$?
fi fi
if [ $ec != 0 ]; then
LAST_FAILED="$ref (from $src)"
finalExitCode=$ec
fi
rm -f $oldversion $newversion rm -f $oldversion $newversion
if [ "$1" = "regenerate" ]; then if [ "$1" = "regenerate" ]; then
${top_builddir}/asn1c/asn1c -S ${top_srcdir}/skeletons -no-gen-OER -no-gen-PER "-$flags" "$src" > "$ref" ${top_builddir}/asn1c/asn1c -S ${top_srcdir}/skeletons -no-gen-OER -no-gen-PER "-$flags" "$src" > "$ref"
fi fi
done done
if [ $ec = 0 ]; then exit $finalExitCode
trap '' EXIT
fi
exit $ec
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