From 5336a9063d15fdeb086aef060754dd32abce6cba Mon Sep 17 00:00:00 2001 From: Will Estes Date: Thu, 17 Jul 2014 21:36:43 -0400 Subject: add tableopts.sh script --- tests/tableopts.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 tests/tableopts.sh (limited to 'tests/tableopts.sh') diff --git a/tests/tableopts.sh b/tests/tableopts.sh new file mode 100755 index 0000000..eada259 --- /dev/null +++ b/tests/tableopts.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# 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. + +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} + tableopts_tables=${testname}.tables + else + TABLEOPTS_TESTS="${TABLEOPTS_TESTS} ${testname}" + tableopts_tables="${tableopts_tables} ${testname}.tables" + 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} -- cgit v1.2.3 From 976cc15cf72c08521e4b575cad6900c109ca71b2 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Fri, 18 Jul 2014 17:41:23 -0400 Subject: split apart table options tests into tests per threading, table option, serialization and verification --- tests/tableopts.sh | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'tests/tableopts.sh') diff --git a/tests/tableopts.sh b/tests/tableopts.sh index eada259..f009b7d 100755 --- a/tests/tableopts.sh +++ b/tests/tableopts.sh @@ -7,26 +7,31 @@ # inclusion in a Makefile.am, typically by redirecting the output and then an automake include directive. 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} - tableopts_tables=${testname}.tables - else - TABLEOPTS_TESTS="${TABLEOPTS_TESTS} ${testname}" - tableopts_tables="${tableopts_tables} ${testname}.tables" - fi - bare_opt=${opt#-} - cat << EOF + 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 + done done echo TABLEOPTS_TESTS = ${TABLEOPTS_TESTS} -- cgit v1.2.3 From f4ec87b6d926cfe635b480dbeec71b3b489dbb02 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Fri, 18 Jul 2014 21:16:11 -0400 Subject: use unofficial bash strict mode and cleanups in supporting bash scripts --- tests/tableopts.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/tableopts.sh') diff --git a/tests/tableopts.sh b/tests/tableopts.sh index f009b7d..63a36d3 100755 --- a/tests/tableopts.sh +++ b/tests/tableopts.sh @@ -1,4 +1,6 @@ -#!/bin/sh +#!/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 @@ -6,6 +8,9 @@ # 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 -- cgit v1.2.3