aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2016-07-02 23:33:32 +0000
committerLev Walkin <vlm@lionet.info>2016-07-02 23:33:32 +0000
commitd8cc847d8745b41de280b87f30cc72ee9e62438e (patch)
tree5f8ee798dc541a8468a7d0c5809a83aefbb1dd64
parent619f0cd736b579eb88a25951d8b5698aebca5f7d (diff)
working better with new automake test suite driver
-rw-r--r--.gitignore2
-rw-r--r--asn1c/tests/Makefile.am43
-rwxr-xr-xasn1c/tests/check-assembly.sh38
3 files changed, 68 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index c492386c..de8dd0f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,8 @@
*.lo
*.libs
*.deps
+*.log
+*.trs
*.core
.tmp.*
diff --git a/asn1c/tests/Makefile.am b/asn1c/tests/Makefile.am
index 1a8ed3b0..0eea6d45 100644
--- a/asn1c/tests/Makefile.am
+++ b/asn1c/tests/Makefile.am
@@ -3,11 +3,48 @@ SUBDIRS = check-src
dist_check_SCRIPTS = check-assembly.sh
-TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS}" CXXFLAGS="${CXXFLAGS}" srcdir=${srcdir} top_srcdir=${top_srcdir} top_builddir=${top_builddir} ${srcdir}/check-assembly.sh
+TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS}" CXXFLAGS="${CXXFLAGS}" srcdir=${srcdir} abs_top_srcdir=${abs_top_srcdir} abs_top_builddir=${abs_top_builddir} ${srcdir}/check-assembly.sh
+
+TESTS =
+TESTS += ${srcdir}/check-src/check-03.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-119.-fwide-types.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-119.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-126.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-127.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-131.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-132.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-133.-gen-PER.c
+TESTS += ${srcdir}/check-src/check-19.c
+TESTS += ${srcdir}/check-src/check-22.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-24.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-25.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-30.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-31.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-32.c
+TESTS += ${srcdir}/check-src/check-33.c
+TESTS += ${srcdir}/check-src/check-35.c
+TESTS += ${srcdir}/check-src/check-39.c
+TESTS += ${srcdir}/check-src/check-41.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-41.c
+TESTS += ${srcdir}/check-src/check-42.c
+TESTS += ${srcdir}/check-src/check-43.c
+TESTS += ${srcdir}/check-src/check-44.c
+TESTS += ${srcdir}/check-src/check-46.c
+TESTS += ${srcdir}/check-src/check-48.c
+TESTS += ${srcdir}/check-src/check-50.c
+TESTS += ${srcdir}/check-src/check-59.c
+TESTS += ${srcdir}/check-src/check-60.c
+TESTS += ${srcdir}/check-src/check-62.c
+TESTS += ${srcdir}/check-src/check-65.c
+TESTS += ${srcdir}/check-src/check-70.-fwide-types.c
+TESTS += ${srcdir}/check-src/check-70.c
+TESTS += ${srcdir}/check-src/check-72.-fcompound-names.c
+TESTS += ${srcdir}/check-src/check-73.c
+TESTS += ${srcdir}/check-src/check-92.-findirect-choice.c
+TESTS += ${srcdir}/check-src/check-92.c
-TESTS = ${srcdir}/check-src/check-*.c
if TEST_64BIT
-TESTS += ${srcdir}/check-src/check64-*.c
+TESTS += ${srcdir}/check-src/check64-134.-gen-PER.c
endif
EXTRA_DIST = \
diff --git a/asn1c/tests/check-assembly.sh b/asn1c/tests/check-assembly.sh
index 9768d8e4..16529479 100755
--- a/asn1c/tests/check-assembly.sh
+++ b/asn1c/tests/check-assembly.sh
@@ -5,15 +5,26 @@
# test-* directories, do lots of other magic stuff and exit cleanly.
#
+set -e
+
if [ "x$1" = "x" ]; then
echo "Usage: $0 <check-NN.c>"
exit
fi
-set -e
+: ${srcdir=.}
+: ${abs_top_srcdir=`pwd`/../../}
+: ${abs_top_builddir=`pwd`/../../}
+
+if echo "$*" | grep -q -- -- ; then
+ TEST_DRIVER=$(echo "$*" | sed -e 's/ -- .*/--/g')
+ source_full=$(echo "$*" | sed -e 's/.* //g')
+else
+ TEST_DRIVER=""
+ source_full="$1"
+fi
# Compute the .asn1 spec name by the given file name.
-source_full=$1
source_short=`echo "$source_full" | sed -e 's/.*\///'`
testno=`echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.'`
@@ -28,17 +39,18 @@ IFS=$OFS
AFLAGS="$@"
# Assume the test fails. Will be removed when it passes well.
+if [ -f "${testdir}-FAILED" ]; then
+ rm -rf ${testdir}
+fi
touch ${testdir}-FAILED
mkdir -p $testdir
-cd $testdir
-rm -f $source_short
-ln -fns ../$source_full
+ln -fns ../$source_full $testdir
-asn_module=`echo ../${top_srcdir}/tests/${testno}-*.asn1`
+asn_module=`echo ${abs_top_srcdir}/tests/${testno}-*.asn1`
# Create a Makefile for the project.
-cat > Makefile <<EOM
+cat > $testdir/Makefile <<EOM
# This file is autogenerated by ../$0
COMMON_FLAGS= -I.
@@ -46,7 +58,7 @@ CFLAGS = \${COMMON_FLAGS} ${CFLAGS} -g -O0
CPPFLAGS = -DSRCDIR=../${srcdir}
CXXFLAGS = \${COMMON_FLAGS} ${CXXFLAGS}
-CC = ${CC}
+CC ?= ${CC}
all: check-executable
check-executable: compiled-module *.c*
@@ -54,8 +66,10 @@ check-executable: compiled-module *.c*
\$(CC) \$(CPPFLAGS) \$(CFLAGS) -o check-executable *.c* -lm
# Compile the corresponding .asn1 spec.
-compiled-module: ${asn_module} ../${top_builddir}/asn1c/asn1c
- ../${top_builddir}/asn1c/asn1c -S ../${top_srcdir}/skeletons -Wdebug-compiler \\
+compiled-module: ${asn_module} ${abs_top_builddir}/asn1c/asn1c
+ ${abs_top_builddir}/asn1c/asn1c \\
+ -S ${abs_top_srcdir}/skeletons \\
+ -Wdebug-compiler \\
${AFLAGS} ${asn_module}
rm -f converter-sample.c
@touch compiled-module
@@ -72,7 +86,7 @@ clean:
EOM
# Perform building and checking
-make check
+${TEST_DRIVER} make -C $testdir check
# Make sure the test is not marked as failed any longer.
-rm -f ../${testdir}-FAILED
+rm -f ${testdir}-FAILED