summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2014-07-18 17:41:23 -0400
committerWill Estes <westes575@gmail.com>2014-11-12 05:14:28 -0500
commit976cc15cf72c08521e4b575cad6900c109ca71b2 (patch)
tree278d0d736a4b0475aac5d595a69e30953df64e61 /tests/Makefile.am
parent5336a9063d15fdeb086aef060754dd32abce6cba (diff)
split apart table options tests into tests per threading, table option, serialization and verification
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am77
1 files changed, 74 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b9935c4..a68359a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -27,7 +27,7 @@ TESTS = $(check_PROGRAMS) options.cn
# automake knows how to distinguish between the various kinds of tests
# we have.
-TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread .one
+TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread .one .opt .ser .ver
LOG_COMPILER = $(srcdir)/testwrapper.sh
AM_LOG_FLAGS = -d $(srcdir) -r
@@ -55,7 +55,7 @@ AM_ONE_LOG_FLAGS = -1 -d $(srcdir)
AM_YFLAGS = -d -p test
-check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) $(ONE_TESTS)
+check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) $(ONE_TESTS) $(TABLEOPTS_TESTS)
simple_tests = \
alloc_extra \
@@ -187,7 +187,8 @@ BUILT_SOURCES = \
reject_r.reject.c \
reject_ver.table.c \
reject_ser.table.c \
- top.h
+ top.h \
+ $(tableopts_c)
EXTRA_DIST = \
README \
@@ -258,6 +259,9 @@ basic_nr.txt \
top.h \
top.txt \
yyextra.txt \
+ $(tableopts_c) \
+ $(tableopts_tables) \
+ tableopts.txt \
options.cn
pthread_pthread_LDADD = -lpthread
@@ -345,3 +349,70 @@ reject_ser.table$(EXEEXT): reject_ser.table.$(OBJEXT)
top_main.$(OBJEXT): top.h
top.h: top.c
+
+# We separate out the tableopts _SOURCES variables and the linking
+# rules for those programs because automake has no way to specify such
+# things with a loop in a variable (even though make can do such
+# things) and the resultant list is both long an unenlightening. And
+# it can be / is generated by a shell script, tableopts.sh.
+
+tableopts.am: tableopts.sh
+ $(srcdir)/tableopts.sh > $(srcdir)/tableopts.am
+
+include tableopts.am
+
+tableopts := -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem
+tableopts_opt_tests := $(foreach opt,$(tableopts), tableopts_opt_nr$(opt) tableopts_opt_r$(opt))
+tableopts_sertests := $(foreach opt,$(tableopts), tableopts_ser_nr$(opt) tableopts_ser_r$(opt))
+tableopts_vertests := $(foreach opt,$(tableopts), tableopts_ver_nr$(opt) tableopts_ver_r$(opt))
+tableopts_tests := $(tableopts_opttests) $(tableopts_vertests) $(tableopts_sertests)
+
+tableopts_c := $(addsuffix .c,$(tableopts_tests))
+
+OPT_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_OPT_LOG_FLAGS = -d $(srcdir) -i tableopts.txt -r
+
+tableopts_opt_nr%.c: tableopts.l4
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) $* -o $@ $<
+
+tableopts_opt_nr%.$(OBJEXT): tableopts_opt_nr%.c
+ $(COMPILE) -c -o $@ $<
+
+tableopts_opt_r%.c: tableopts.l4
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) --reentrant $* -o $@ $<
+
+tableopts_opt_r%.$(OBJEXT): tableopts_opt_r%.c
+ $(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
+
+SER_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_SER_LOG_FLAGS = -d $(srcdir) -i tableopts.txt -r -t
+
+tableopts_ser_nr%.c: tableopts.l4
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ser_nr$*.ser.tables" $* -o $@ $<
+
+tableopts_ser_nr%.$(OBJEXT): tableopts_ser_nr%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
+
+tableopts_ser_r%.c: tableopts.l4
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ser_r$*.ser.tables" $* -o $@ $<
+
+tableopts_ser_r%.$(OBJEXT): tableopts_ser_r%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
+
+VER_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_VER_LOG_FLAGS = -d $(srcdir) -i tableopts.txt -r -t
+
+tableopts_ver_nr%.c: tableopts.l4
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ver_nr$*.ver.tables" --tables-verify $* -o $@ $<
+
+tableopts_ver_nr%.$(OBJEXT): tableopts_ver_nr%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
+
+tableopts_ver_nr%.ver$(EXEEXT): tableopts_ver_nr%.$(OBJEXT)
+ $(LINK) -o $@ $^
+
+tableopts_ver_r%.c: tableopts.l4
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ver_r$*.ver.tables" --tables-verify $* -o $@ $<
+
+tableopts_ver_r%.$(OBJEXT): tableopts_ver_r%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<