From e0d321a6502c3a3f567f16430bfa94cdefc63a53 Mon Sep 17 00:00:00 2001 From: Lev Walkin Date: Thu, 11 Sep 2014 01:28:57 -0700 Subject: version 0.9.26 --- asn1c/tests/check-assembly.sh | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'asn1c/tests/check-assembly.sh') diff --git a/asn1c/tests/check-assembly.sh b/asn1c/tests/check-assembly.sh index 5858f5bf..bdcc7d9f 100755 --- a/asn1c/tests/check-assembly.sh +++ b/asn1c/tests/check-assembly.sh @@ -10,11 +10,15 @@ if [ "x$1" = "x" ]; then exit fi +set -o pipefail +set -e + # Compute the .asn1 spec name by the given file name. -source=`echo "$1" | sed -e 's/.*\///'` -testno=`echo "$source" | cut -f2 -d'-' | cut -f1 -d'.'` +source_full=$1 +source_short=`echo "$source_full" | sed -e 's/.*\///'` +testno=`echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.'` -args=`echo "$source" | sed -e 's/\.c[c]*$//'` +args=`echo "$source_short" | sed -e 's/\.c[c]*$//'` testdir=test-${args} OFS=$IFS @@ -24,16 +28,15 @@ shift IFS=$OFS AFLAGS="$@" -touch ${testdir}-FAILED # Create this file to ease post mortem analysis +# Assume the test fails. Will be removed when it passes well. +touch ${testdir}-FAILED -if [ ! -d $testdir ]; then - mkdir $testdir || exit $? -fi -cd $testdir || exit $? -rm -f ./$source 2>/dev/null -ln -fns ../$source || exit $? +mkdir -p $testdir +cd $testdir +rm -f $source_short +ln -fns ../$source_full -asn_module=`echo ../../../tests/${testno}-*.asn1` +asn_module=`echo ../${top_srcdir}/tests/${testno}-*.asn1` # Create a Makefile for the project. cat > Makefile < Makefile <