diff options
author | Will Estes <westes575@gmail.com> | 2014-06-24 21:07:52 -0400 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2014-11-12 05:14:28 -0500 |
commit | 5fb6428901f7265638ea7604b1834d06e0ad9331 (patch) | |
tree | 7ec2d474193dfaa71a340ee5131e9cd86d930dce /tests | |
parent | 01c6ea670bf7376f977047ef5ddf2e68cabe447e (diff) |
refactor pthread test for new test suite layout
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.gitignore | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 18 | ||||
-rw-r--r-- | tests/pthread.l (renamed from tests/test-pthread/scanner.l) | 2 | ||||
-rw-r--r-- | tests/pthread_1.txt (renamed from tests/test-pthread/test-1.input) | 0 | ||||
-rw-r--r-- | tests/pthread_2.txt (renamed from tests/test-pthread/test-2.input) | 0 | ||||
-rw-r--r-- | tests/pthread_3.txt (renamed from tests/test-pthread/test-3.input) | 0 | ||||
-rw-r--r-- | tests/pthread_4.txt (renamed from tests/test-pthread/test-4.input) | 0 | ||||
-rw-r--r-- | tests/pthread_5.txt (renamed from tests/test-pthread/test-5.input) | 0 | ||||
-rw-r--r-- | tests/test-pthread/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-pthread/Makefile.am | 46 |
10 files changed, 19 insertions, 56 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index 43248bf..7a853fc 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -69,6 +69,8 @@ prefix_nr prefix_nr.c prefix_r prefix_r.c +pthread.pthread +pthread.c reject_nr.reject reject_nr.reject.c reject_r.reject diff --git a/tests/Makefile.am b/tests/Makefile.am index 6728ad1..8b38e8c 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 +TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread LOG_COMPILER = $(srcdir)/testwrapper.sh AM_LOG_FLAGS = -d $(srcdir) -r @@ -47,9 +47,12 @@ AM_CN_LOG_FLAGS=$(FLEX) I3_LOG_COMPILER=$(srcdir)/testwrapper.sh AM_I3_LOG_FLAGS=-i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt +PTHREAD_LOG_COMPILER=$(srcdir)/testwrapper.sh +AM_PTHREAD_LOG_FLAGS=-i $(srcdir)/pthread_1.txt -i $(srcdir)/pthread_2.txt -i $(srcdir)/pthread_3.txt -i $(srcdir)/pthread_4.txt -i $(srcdir)/pthread_5.txt + AM_YFLAGS = -d -p test -check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) +check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) simple_tests = \ alloc_extra \ @@ -104,6 +107,9 @@ DIRECT_TESTS = \ I3_TESTS = \ cxx_yywrap.i3 +PTHREAD_TESTS = \ + pthread.pthread + alloc_extra_SOURCES = alloc_extra.l array_nr_SOURCES = array_nr.l array_r_SOURCES = array_r.l @@ -136,6 +142,7 @@ posix_SOURCES = posix.l posixly_correct_SOURCES = posixly_correct.l prefix_nr_SOURCES = prefix_nr.l prefix_r_SOURCES = prefix_r.l +pthread_pthread_SOURCES = pthread.l quotes_SOURCES = quotes.l reject_nr_reject_SOURCES = reject.l4 reject_r_reject_SOURCES = reject.l4 @@ -217,6 +224,11 @@ basic_nr.txt \ noansi_r.txt \ prefix_nr.txt \ prefix_r.txt \ + pthread_1.txt \ + pthread_2.txt \ + pthread_3.txt \ + pthread_4.txt \ + pthread_5.txt \ reject.txt \ reject_nr.reject.c \ reject_r.reject.c \ @@ -232,6 +244,8 @@ basic_nr.txt \ yyextra.txt \ options.cn +pthread_pthread_LDADD = -lpthread + # specify how to process .l files in order to test the flex built by make all FLEX = $(top_builddir)/src/flex diff --git a/tests/test-pthread/scanner.l b/tests/pthread.l index 8603873..1084321 100644 --- a/tests/test-pthread/scanner.l +++ b/tests/pthread.l @@ -46,7 +46,7 @@ static int process_text(char* s, yyscan_t scanner); %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option nounput nomain nodefault %option yywrap %option reentrant diff --git a/tests/test-pthread/test-1.input b/tests/pthread_1.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-1.input +++ b/tests/pthread_1.txt diff --git a/tests/test-pthread/test-2.input b/tests/pthread_2.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-2.input +++ b/tests/pthread_2.txt diff --git a/tests/test-pthread/test-3.input b/tests/pthread_3.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-3.input +++ b/tests/pthread_3.txt diff --git a/tests/test-pthread/test-4.input b/tests/pthread_4.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-4.input +++ b/tests/pthread_4.txt diff --git a/tests/test-pthread/test-5.input b/tests/pthread_5.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-5.input +++ b/tests/pthread_5.txt diff --git a/tests/test-pthread/.gitignore b/tests/test-pthread/.gitignore deleted file mode 100644 index f60ad66..0000000 --- a/tests/test-pthread/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-pthread -OUTPUT diff --git a/tests/test-pthread/Makefile.am b/tests/test-pthread/Makefile.am deleted file mode 100644 index fe5d545..0000000 --- a/tests/test-pthread/Makefile.am +++ /dev/null @@ -1,46 +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. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test-1.input test-2.input test-3.input test-4.input test-5.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -LIBS = -lpthread -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-pthread - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname) $(srcdir)/test-*.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< |