From 92876d38ddb2fea5b3c870c3679d4f48e676cc8f Mon Sep 17 00:00:00 2001 From: Lev Walkin Date: Sun, 3 Jul 2016 00:00:41 -0700 Subject: checked with shellcheck --- asn1c/tests/check-assembly.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'asn1c/tests') diff --git a/asn1c/tests/check-assembly.sh b/asn1c/tests/check-assembly.sh index 16529479..371bd63a 100755 --- a/asn1c/tests/check-assembly.sh +++ b/asn1c/tests/check-assembly.sh @@ -12,9 +12,9 @@ if [ "x$1" = "x" ]; then exit fi -: ${srcdir=.} -: ${abs_top_srcdir=`pwd`/../../} -: ${abs_top_builddir=`pwd`/../../} +srcdir="${srcdir:-.}" +abs_top_srcdir="${abs_top_srcdir:-$(pwd)/../../}" +abs_top_builddir="${abs_top_builddir:-$(pwd)/../../}" if echo "$*" | grep -q -- -- ; then TEST_DRIVER=$(echo "$*" | sed -e 's/ -- .*/--/g') @@ -25,36 +25,36 @@ else fi # Compute the .asn1 spec name by the given file name. -source_short=`echo "$source_full" | sed -e 's/.*\///'` -testno=`echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.'` +source_short=$(echo "$source_full" | sed -e 's/.*\///') +testno=$(echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.') -args=`echo "$source_short" | sed -e 's/\.c[c]*$//'` -testdir=test-${args} +args=$(echo "$source_short" | sed -e 's/\.c[c]*$//') OFS=$IFS IFS="." -set $args +set "$args" shift IFS=$OFS -AFLAGS="$@" +AFLAGS="$*" # Assume the test fails. Will be removed when it passes well. +testdir=test-${args} if [ -f "${testdir}-FAILED" ]; then - rm -rf ${testdir} + rm -rf "${testdir}" fi -touch ${testdir}-FAILED +touch "${testdir}-FAILED" -mkdir -p $testdir -ln -fns ../$source_full $testdir +mkdir -p "${testdir}" +ln -fns "../${source_full}" "${testdir}" -asn_module=`echo ${abs_top_srcdir}/tests/${testno}-*.asn1` +asn_module=$(echo "${abs_top_srcdir}/tests/${testno}"-*.asn1) # Create a Makefile for the project. -cat > $testdir/Makefile < "$testdir/Makefile" <