Commit d8cc847d authored by Lev Walkin's avatar Lev Walkin

working better with new automake test suite driver

parent 619f0cd7
......@@ -4,6 +4,8 @@
*.lo
*.libs
*.deps
*.log
*.trs
*.core
.tmp.*
......
......@@ -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 = \
......
......@@ -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
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