]> granicus.if.org Git - flex/commitdiff
refactor pthread test for new test suite layout
authorWill Estes <westes575@gmail.com>
Wed, 25 Jun 2014 01:07:52 +0000 (21:07 -0400)
committerWill Estes <westes575@gmail.com>
Wed, 12 Nov 2014 10:14:28 +0000 (05:14 -0500)
tests/.gitignore
tests/Makefile.am
tests/pthread.l [moved from tests/test-pthread/scanner.l with 99% similarity]
tests/pthread_1.txt [moved from tests/test-pthread/test-1.input with 100% similarity]
tests/pthread_2.txt [moved from tests/test-pthread/test-2.input with 100% similarity]
tests/pthread_3.txt [moved from tests/test-pthread/test-3.input with 100% similarity]
tests/pthread_4.txt [moved from tests/test-pthread/test-4.input with 100% similarity]
tests/pthread_5.txt [moved from tests/test-pthread/test-5.input with 100% similarity]
tests/test-pthread/.gitignore [deleted file]
tests/test-pthread/Makefile.am [deleted file]

index 43248bf719871d96bc22c63a95c07589e1295e3a..7a853fc25a78d1dc2800f743042d6abd84f88224 100644 (file)
@@ -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
index 6728ad106ecdb92c70f04f816f8b151ffb632f4d..8b38e8ccd810b558ce586e289200b7e687a69b3d 100644 (file)
@@ -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
similarity index 99%
rename from tests/test-pthread/scanner.l
rename to tests/pthread.l
index 8603873808a65e457bc83676df074f6456057868..1084321b97611980ecf2de2ce81f646cd3332e1d 100644 (file)
@@ -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/.gitignore b/tests/test-pthread/.gitignore
deleted file mode 100644 (file)
index f60ad66..0000000
+++ /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 (file)
index fe5d545..0000000
+++ /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) $<