From 976cc15cf72c08521e4b575cad6900c109ca71b2 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Fri, 18 Jul 2014 17:41:23 -0400 Subject: [PATCH] split apart table options tests into tests per threading, table option, serialization and verification --- tests/.gitignore | 4 + tests/Makefile.am | 77 +++- tests/tableopts.am | 333 ++++++++++++++++++ .../scanner.l => tableopts.l4} | 0 tests/tableopts.sh | 33 +- .../test.input => tableopts.txt} | 0 tests/test-table-opts/.gitignore | 11 - tests/test-table-opts/Makefile.am | 132 ------- 8 files changed, 430 insertions(+), 160 deletions(-) create mode 100644 tests/tableopts.am rename tests/{test-table-opts/scanner.l => tableopts.l4} (100%) rename tests/{test-table-opts/test.input => tableopts.txt} (100%) delete mode 100644 tests/test-table-opts/.gitignore delete mode 100644 tests/test-table-opts/Makefile.am diff --git a/tests/.gitignore b/tests/.gitignore index fe6a602..5bece86 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -99,3 +99,7 @@ top top.[ch] yyextra yyextra.c +tableopts_*.c +*.opt +*.ser +*.ver 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 $@ $< diff --git a/tests/tableopts.am b/tests/tableopts.am new file mode 100644 index 0000000..bbb20d0 --- /dev/null +++ b/tests/tableopts.am @@ -0,0 +1,333 @@ +tableopts_opt_nr_Ca_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Ca.opt$(EXEEXT): tableopts_opt_nr-Ca.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Ce_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Ce.opt$(EXEEXT): tableopts_opt_nr-Ce.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Cf_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cf.opt$(EXEEXT): tableopts_opt_nr-Cf.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_CF_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-CF.opt$(EXEEXT): tableopts_opt_nr-CF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Cm_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cm.opt$(EXEEXT): tableopts_opt_nr-Cm.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Cem_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cem.opt$(EXEEXT): tableopts_opt_nr-Cem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Cae_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cae.opt$(EXEEXT): tableopts_opt_nr-Cae.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Caef_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Caef.opt$(EXEEXT): tableopts_opt_nr-Caef.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_CaeF_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-CaeF.opt$(EXEEXT): tableopts_opt_nr-CaeF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Cam_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cam.opt$(EXEEXT): tableopts_opt_nr-Cam.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_nr_Caem_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Caem.opt$(EXEEXT): tableopts_opt_nr-Caem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Ca_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Ca.opt$(EXEEXT): tableopts_opt_r-Ca.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Ce_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Ce.opt$(EXEEXT): tableopts_opt_r-Ce.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Cf_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cf.opt$(EXEEXT): tableopts_opt_r-Cf.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_CF_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-CF.opt$(EXEEXT): tableopts_opt_r-CF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Cm_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cm.opt$(EXEEXT): tableopts_opt_r-Cm.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Cem_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cem.opt$(EXEEXT): tableopts_opt_r-Cem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Cae_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cae.opt$(EXEEXT): tableopts_opt_r-Cae.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Caef_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Caef.opt$(EXEEXT): tableopts_opt_r-Caef.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_CaeF_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-CaeF.opt$(EXEEXT): tableopts_opt_r-CaeF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Cam_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cam.opt$(EXEEXT): tableopts_opt_r-Cam.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_opt_r_Caem_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Caem.opt$(EXEEXT): tableopts_opt_r-Caem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Ca_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Ca.ser$(EXEEXT): tableopts_ser_nr-Ca.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Ce_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Ce.ser$(EXEEXT): tableopts_ser_nr-Ce.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Cf_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cf.ser$(EXEEXT): tableopts_ser_nr-Cf.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_CF_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-CF.ser$(EXEEXT): tableopts_ser_nr-CF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Cm_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cm.ser$(EXEEXT): tableopts_ser_nr-Cm.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Cem_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cem.ser$(EXEEXT): tableopts_ser_nr-Cem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Cae_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cae.ser$(EXEEXT): tableopts_ser_nr-Cae.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Caef_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Caef.ser$(EXEEXT): tableopts_ser_nr-Caef.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_CaeF_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-CaeF.ser$(EXEEXT): tableopts_ser_nr-CaeF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Cam_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cam.ser$(EXEEXT): tableopts_ser_nr-Cam.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_nr_Caem_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Caem.ser$(EXEEXT): tableopts_ser_nr-Caem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Ca_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Ca.ser$(EXEEXT): tableopts_ser_r-Ca.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Ce_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Ce.ser$(EXEEXT): tableopts_ser_r-Ce.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Cf_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cf.ser$(EXEEXT): tableopts_ser_r-Cf.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_CF_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-CF.ser$(EXEEXT): tableopts_ser_r-CF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Cm_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cm.ser$(EXEEXT): tableopts_ser_r-Cm.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Cem_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cem.ser$(EXEEXT): tableopts_ser_r-Cem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Cae_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cae.ser$(EXEEXT): tableopts_ser_r-Cae.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Caef_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Caef.ser$(EXEEXT): tableopts_ser_r-Caef.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_CaeF_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-CaeF.ser$(EXEEXT): tableopts_ser_r-CaeF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Cam_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cam.ser$(EXEEXT): tableopts_ser_r-Cam.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ser_r_Caem_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Caem.ser$(EXEEXT): tableopts_ser_r-Caem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Ca_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Ca.ver$(EXEEXT): tableopts_ver_nr-Ca.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Ce_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Ce.ver$(EXEEXT): tableopts_ver_nr-Ce.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Cf_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cf.ver$(EXEEXT): tableopts_ver_nr-Cf.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_CF_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-CF.ver$(EXEEXT): tableopts_ver_nr-CF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Cm_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cm.ver$(EXEEXT): tableopts_ver_nr-Cm.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Cem_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cem.ver$(EXEEXT): tableopts_ver_nr-Cem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Cae_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cae.ver$(EXEEXT): tableopts_ver_nr-Cae.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Caef_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Caef.ver$(EXEEXT): tableopts_ver_nr-Caef.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_CaeF_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-CaeF.ver$(EXEEXT): tableopts_ver_nr-CaeF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Cam_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cam.ver$(EXEEXT): tableopts_ver_nr-Cam.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_nr_Caem_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Caem.ver$(EXEEXT): tableopts_ver_nr-Caem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Ca_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Ca.ver$(EXEEXT): tableopts_ver_r-Ca.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Ce_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Ce.ver$(EXEEXT): tableopts_ver_r-Ce.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Cf_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cf.ver$(EXEEXT): tableopts_ver_r-Cf.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_CF_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-CF.ver$(EXEEXT): tableopts_ver_r-CF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Cm_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cm.ver$(EXEEXT): tableopts_ver_r-Cm.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Cem_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cem.ver$(EXEEXT): tableopts_ver_r-Cem.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Cae_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cae.ver$(EXEEXT): tableopts_ver_r-Cae.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Caef_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Caef.ver$(EXEEXT): tableopts_ver_r-Caef.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_CaeF_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-CaeF.ver$(EXEEXT): tableopts_ver_r-CaeF.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Cam_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cam.ver$(EXEEXT): tableopts_ver_r-Cam.$(OBJEXT) + $(LINK) -o $@ $< + +tableopts_ver_r_Caem_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Caem.ver$(EXEEXT): tableopts_ver_r-Caem.$(OBJEXT) + $(LINK) -o $@ $< + +TABLEOPTS_TESTS = tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ce.opt tableopts_opt_nr-Cf.opt tableopts_opt_nr-CF.opt tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cae.opt tableopts_opt_nr-Caef.opt tableopts_opt_nr-CaeF.opt tableopts_opt_nr-Cam.opt tableopts_opt_nr-Caem.opt tableopts_opt_r-Ca.opt tableopts_opt_r-Ce.opt tableopts_opt_r-Cf.opt tableopts_opt_r-CF.opt tableopts_opt_r-Cm.opt tableopts_opt_r-Cem.opt tableopts_opt_r-Cae.opt tableopts_opt_r-Caef.opt tableopts_opt_r-CaeF.opt tableopts_opt_r-Cam.opt tableopts_opt_r-Caem.opt tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ce.ser tableopts_ser_nr-Cf.ser tableopts_ser_nr-CF.ser tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cae.ser tableopts_ser_nr-Caef.ser tableopts_ser_nr-CaeF.ser tableopts_ser_nr-Cam.ser tableopts_ser_nr-Caem.ser tableopts_ser_r-Ca.ser tableopts_ser_r-Ce.ser tableopts_ser_r-Cf.ser tableopts_ser_r-CF.ser tableopts_ser_r-Cm.ser tableopts_ser_r-Cem.ser tableopts_ser_r-Cae.ser tableopts_ser_r-Caef.ser tableopts_ser_r-CaeF.ser tableopts_ser_r-Cam.ser tableopts_ser_r-Caem.ser tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ce.ver tableopts_ver_nr-Cf.ver tableopts_ver_nr-CF.ver tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cae.ver tableopts_ver_nr-Caef.ver tableopts_ver_nr-CaeF.ver tableopts_ver_nr-Cam.ver tableopts_ver_nr-Caem.ver tableopts_ver_r-Ca.ver tableopts_ver_r-Ce.ver tableopts_ver_r-Cf.ver tableopts_ver_r-CF.ver tableopts_ver_r-Cm.ver tableopts_ver_r-Cem.ver tableopts_ver_r-Cae.ver tableopts_ver_r-Caef.ver tableopts_ver_r-CaeF.ver tableopts_ver_r-Cam.ver tableopts_ver_r-Caem.ver + +tableopts_tables = tableopts_ser_nr-Ca.ser.tables tableopts_ser_nr-Ce.ser.tables tableopts_ser_nr-Cf.ser.tables tableopts_ser_nr-CF.ser.tables tableopts_ser_nr-Cm.ser.tables tableopts_ser_nr-Cem.ser.tables tableopts_ser_nr-Cae.ser.tables tableopts_ser_nr-Caef.ser.tables tableopts_ser_nr-CaeF.ser.tables tableopts_ser_nr-Cam.ser.tables tableopts_ser_nr-Caem.ser.tables tableopts_ser_r-Ca.ser.tables tableopts_ser_r-Ce.ser.tables tableopts_ser_r-Cf.ser.tables tableopts_ser_r-CF.ser.tables tableopts_ser_r-Cm.ser.tables tableopts_ser_r-Cem.ser.tables tableopts_ser_r-Cae.ser.tables tableopts_ser_r-Caef.ser.tables tableopts_ser_r-CaeF.ser.tables tableopts_ser_r-Cam.ser.tables tableopts_ser_r-Caem.ser.tables tableopts_ver_nr-Ca.ver.tables tableopts_ver_nr-Ce.ver.tables tableopts_ver_nr-Cf.ver.tables tableopts_ver_nr-CF.ver.tables tableopts_ver_nr-Cm.ver.tables tableopts_ver_nr-Cem.ver.tables tableopts_ver_nr-Cae.ver.tables tableopts_ver_nr-Caef.ver.tables tableopts_ver_nr-CaeF.ver.tables tableopts_ver_nr-Cam.ver.tables tableopts_ver_nr-Caem.ver.tables tableopts_ver_r-Ca.ver.tables tableopts_ver_r-Ce.ver.tables tableopts_ver_r-Cf.ver.tables tableopts_ver_r-CF.ver.tables tableopts_ver_r-Cm.ver.tables tableopts_ver_r-Cem.ver.tables tableopts_ver_r-Cae.ver.tables tableopts_ver_r-Caef.ver.tables tableopts_ver_r-CaeF.ver.tables tableopts_ver_r-Cam.ver.tables tableopts_ver_r-Caem.ver.tables diff --git a/tests/test-table-opts/scanner.l b/tests/tableopts.l4 similarity index 100% rename from tests/test-table-opts/scanner.l rename to tests/tableopts.l4 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} diff --git a/tests/test-table-opts/test.input b/tests/tableopts.txt similarity index 100% rename from tests/test-table-opts/test.input rename to tests/tableopts.txt diff --git a/tests/test-table-opts/.gitignore b/tests/test-table-opts/.gitignore deleted file mode 100644 index a332ff1..0000000 --- a/tests/test-table-opts/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -TEMPLATE -OUTPUT -.deps -test-opt-* -test-ser-* -test-ver-* -*.tables diff --git a/tests/test-table-opts/Makefile.am b/tests/test-table-opts/Makefile.am deleted file mode 100644 index 235e6c8..0000000 --- a/tests/test-table-opts/Makefile.am +++ /dev/null @@ -1,132 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -# ------------------------------------------------ -# This test is really a set of tests, one for -# each compression flag. -Ca, -Cem, etc.. -# 'test-opt' builds non-serialized scanners with various table options. -# 'test-ver' verifies that the serialized tables match the in-code tables. -# 'test-ser' deserializes the tables at runtime. -# 'test-mul' checks that we can store multiple tables in a single file. -# ------------------------------------------------ - -FLEX = $(top_builddir)/flex - -testname := test-table-opts -allopts := -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem - -# the test names themselves -opttests := $(foreach opt,$(allopts), test-opt-nr$(opt) test-opt-r$(opt)) -sertests := $(foreach opt,$(allopts), test-ser-nr$(opt) test-ser-r$(opt)) -vertests := $(foreach opt,$(allopts), test-ver-nr$(opt) test-ver-r$(opt)) -alltests := $(opttests) $(vertests) $(sertests) test-mul - -# the executables to build -optexe := $(addsuffix $(EXEEXT),$(opttests)) -verexe := $(addsuffix $(EXEEXT),$(vertests)) -serexe := $(addsuffix $(EXEEXT),$(sertests)) -allexe := $(optexe) $(verexe) $(serexe) - -# the .c files -optsrc := $(addsuffix .c,$(opttests)) -versrc := $(addsuffix .c,$(vertests)) -sersrc := $(addsuffix .c,$(sertests)) -allsrc := $(optsrc) $(versrc) $(sersrc) - -# the .o files -optobj := $(addsuffix .o,$(opttests)) -verobj := $(addsuffix .o,$(vertests)) -serobj := $(addsuffix .o,$(sertests)) -allobj := $(optobj) $(verobj) $(serobj) - -# the .tables files -sertables := $(addsuffix .tables,$(sertests)) -alltables := $(addsuffix .tables,$(alltests)) - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c OUTPUT $(allobj) $(allsrc) $(alltables) \ - all-ser.tables $(allexe) -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -test: test-opt test-ser test-ver test-mul - -test-opt-r%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) --reentrant $* -o $@ $< - -test-opt-nr%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) $* -o $@ $< - -test-ser-r%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) -R --tables-file="test-ser-r$*.tables" $* -o $@ $< - -test-ser-nr%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) --tables-file="test-ser-nr$*.tables" $* -o $@ $< - -test-ver-r%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) -R --tables-file="test-ver-r$*.tables" --tables-verify $* -o $@ $< - -test-ver-nr%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) --tables-file="test-ver-nr$*.tables" --tables-verify $* -o $@ $< - -test-opt%$(EXEEXT): test-opt%.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-ser%$(EXEEXT): test-ser%.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-ver%$(EXEEXT): test-ver%.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-opt: $(optexe) - for t in $(optexe) ; do \ - ./$$t `basename $$t $(EXEEXT)`.tables < $(srcdir)/test.input \ - || { echo $t FAILED ; exit 1 ; } ; \ - done - -test-ver: $(verexe) - for t in $(verexe) ; do \ - ./$$t `basename $$t $(EXEEXT)`.tables < $(srcdir)/test.input \ - || { echo $t FAILED ; exit 1 ; } ; \ - done - -test-ser: $(serexe) - for t in $(serexe) ; do \ - ./$$t `basename $$t $(EXEEXT)`.tables < $(srcdir)/test.input \ - || { echo $t FAILED ; exit 1 ; } ; \ - done - -test-mul: $(serexe) - $(RM) all-ser.tables - cat $(sertables) > all-ser.tables - for t in $(serexe) ; do \ - ./$$t all-ser.tables < $(srcdir)/test.input || { echo $$t FAILED; exit 1; } ; \ - done - -test-opt-nr-%.o: test-opt-nr-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< -test-ser-nr-%.o: test-ser-nr-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL $(CFLAGS) $< -test-ver-nr-%.o: test-ver-nr-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL $(CFLAGS) $< - -test-opt-r-%.o: test-opt-r-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_IS_REENTRANT $(CFLAGS) $< -test-ser-r-%.o: test-ser-r-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT $(CFLAGS) $< -test-ver-r-%.o: test-ver-r-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT $(CFLAGS) $< - -.PHONY: test test-opt test-ser test-ver test-mul -.SECONDARY: $(allobj) $(allsrc) -- 2.40.0