summaryrefslogtreecommitdiff
path: root/tests/tableopts.sh
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-01-22 13:51:30 -0800
committerManoj Srivastava <srivasta@debian.org>2016-01-22 13:51:30 -0800
commitf753f2b7b6d97014110dbe418861353a2f3f445d (patch)
tree7f248ce2f59fbb79cab24b4727955e37e9a5ab81 /tests/tableopts.sh
parent306163051847aaaabe7ae0f4cfc7d23f15923f3a (diff)
parenta646b6cd438dc4bd957c6c6afd89b5e8e59468fe (diff)
Merge branch 'upstream'
Signed-off-by: Manoj Srivastava <srivasta@debian.org> # Conflicts: # INSTALL # Makefile.in # aclocal.m4 # build-aux/compile # build-aux/config.guess # build-aux/config.sub # build-aux/depcomp # build-aux/install-sh # build-aux/mdate-sh # build-aux/texinfo.tex # configure # doc/Makefile.in # doc/flex.1 # doc/flex.info # doc/flex.info-1 # doc/flex.info-2 # doc/flex.pdf # doc/stamp-vti # doc/version.texi # examples/Makefile.in # examples/fastwc/Makefile.in # examples/manual/Makefile.in # src/config.h.in # tests/Makefile.in # tests/test-bison-nr/Makefile.am # tests/test-bison-yylloc/Makefile.am # tests/test-bison-yylval/Makefile.am # tools/Makefile.in
Diffstat (limited to 'tests/tableopts.sh')
-rwxr-xr-xtests/tableopts.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/tableopts.sh b/tests/tableopts.sh
new file mode 100755
index 0000000..63a36d3
--- /dev/null
+++ b/tests/tableopts.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+set -euo pipefail
+IFS=$'\n\t'
+
+# This script is present to generate the automake _SOURCES variables
+# for the tableopts_* tests. It also generates the linking rules for
+# each test since automake isn't able to handle the pattern rules that
+# would be natural to use. Output is written to standard output for
+# inclusion in a Makefile.am, typically by redirecting the output and then an automake include directive.
+
+TABLEOPTS_TESTS=""
+tableopts_tables=""
+
+for kind in opt ser ver ; do
+ for threading in nr r ; do
+ for opt in -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem ; do
+ testname=tableopts_${kind}_${threading}${opt}.${kind}
+ if [ "${TABLEOPTS_TESTS}" = "" ] ;then
+ TABLEOPTS_TESTS=${testname}
+ if [ "$kind" = "ser" -o "$kind" = "ver" ] ; then
+ tableopts_tables=${testname}.tables
+ fi
+ else
+ TABLEOPTS_TESTS="${TABLEOPTS_TESTS} ${testname}"
+ if [ "$kind" = "ser" -o "$kind" = "ver" ] ; then
+ tableopts_tables="${tableopts_tables} ${testname}.tables"
+ fi
+ fi
+
+ bare_opt=${opt#-}
+ cat << EOF
+tableopts_${kind}_${threading}_${bare_opt}_${kind}_SOURCES = tableopts.l4
+
+${testname}\$(EXEEXT): tableopts_${kind}_${threading}${opt}.\$(OBJEXT)
+ \$(LINK) -o \$@ \$<
+
+EOF
+ done
+ done
+done
+
+echo TABLEOPTS_TESTS = ${TABLEOPTS_TESTS}
+echo
+echo tableopts_tables = ${tableopts_tables}