Commit 92876d38 authored by Lev Walkin's avatar Lev Walkin

checked with shellcheck

parent bce0ce43
...@@ -12,9 +12,9 @@ if [ "x$1" = "x" ]; then ...@@ -12,9 +12,9 @@ if [ "x$1" = "x" ]; then
exit exit
fi fi
: ${srcdir=.} srcdir="${srcdir:-.}"
: ${abs_top_srcdir=`pwd`/../../} abs_top_srcdir="${abs_top_srcdir:-$(pwd)/../../}"
: ${abs_top_builddir=`pwd`/../../} abs_top_builddir="${abs_top_builddir:-$(pwd)/../../}"
if echo "$*" | grep -q -- -- ; then if echo "$*" | grep -q -- -- ; then
TEST_DRIVER=$(echo "$*" | sed -e 's/ -- .*/--/g') TEST_DRIVER=$(echo "$*" | sed -e 's/ -- .*/--/g')
...@@ -25,36 +25,36 @@ else ...@@ -25,36 +25,36 @@ else
fi fi
# Compute the .asn1 spec name by the given file name. # Compute the .asn1 spec name by the given file name.
source_short=`echo "$source_full" | sed -e 's/.*\///'` source_short=$(echo "$source_full" | sed -e 's/.*\///')
testno=`echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.'` testno=$(echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.')
args=`echo "$source_short" | sed -e 's/\.c[c]*$//'` args=$(echo "$source_short" | sed -e 's/\.c[c]*$//')
testdir=test-${args}
OFS=$IFS OFS=$IFS
IFS="." IFS="."
set $args set "$args"
shift shift
IFS=$OFS IFS=$OFS
AFLAGS="$@" AFLAGS="$*"
# Assume the test fails. Will be removed when it passes well. # Assume the test fails. Will be removed when it passes well.
testdir=test-${args}
if [ -f "${testdir}-FAILED" ]; then if [ -f "${testdir}-FAILED" ]; then
rm -rf ${testdir} rm -rf "${testdir}"
fi fi
touch ${testdir}-FAILED touch "${testdir}-FAILED"
mkdir -p $testdir mkdir -p "${testdir}"
ln -fns ../$source_full $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. # Create a Makefile for the project.
cat > $testdir/Makefile <<EOM cat > "$testdir/Makefile" <<EOM
# This file is autogenerated by ../$0 # This file is autogenerated by ../$0
COMMON_FLAGS= -I. COMMON_FLAGS= -I.
CFLAGS = \${COMMON_FLAGS} ${CFLAGS} -g -O0 CFLAGS = \${COMMON_FLAGS} ${CFLAGS:-} -g -O0
CPPFLAGS = -DSRCDIR=../${srcdir} CPPFLAGS = -DSRCDIR=../${srcdir}
CXXFLAGS = \${COMMON_FLAGS} ${CXXFLAGS} CXXFLAGS = \${COMMON_FLAGS} ${CXXFLAGS}
...@@ -86,7 +86,7 @@ clean: ...@@ -86,7 +86,7 @@ clean:
EOM EOM
# Perform building and checking # Perform building and checking
${TEST_DRIVER} make -C $testdir check ${TEST_DRIVER} make -C "$testdir" check
# Make sure the test is not marked as failed any longer. # Make sure the test is not marked as failed any longer.
rm -f ${testdir}-FAILED rm -f "${testdir}-FAILED"
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