]> granicus.if.org Git - flex/commitdiff
refactor yyextra test for new test suite layout
authorWill Estes <westes575@gmail.com>
Sat, 14 Jun 2014 15:48:48 +0000 (11:48 -0400)
committerWill Estes <westes575@gmail.com>
Wed, 12 Nov 2014 10:14:27 +0000 (05:14 -0500)
tests/.gitignore
tests/Makefile.am
tests/test-yyextra/.gitignore [deleted file]
tests/test-yyextra/Makefile.am [deleted file]
tests/yyextra.l [moved from tests/test-yyextra/scanner.l with 98% similarity]
tests/yyextra.txt [moved from tests/test-yyextra/test.input with 100% similarity]

index 582238170e8a40a6d4034bd04daa470bd713478a..ba408e91ebdd5688c9cc8d320f5ef55ddf4b1274 100644 (file)
@@ -52,3 +52,5 @@ string_r
 string_r.c
 top
 top.[ch]
+yyextra
+yyextra.c
index 9863ecdf8948b1a6d346029a576776b463f171e0..6e706b36e3d8129b7b1890a2cc74260968cb884f 100644 (file)
@@ -50,7 +50,8 @@ check_PROGRAMS = \
        prefix_r \
        string_nr \
 string_r \
-       top
+       top \
+       yyextra
 
 alloc_extra_SOURCES = alloc_extra.l
 array_nr_SOURCES = array_nr.l
@@ -76,6 +77,7 @@ prefix_r_SOURCES = prefix_r.l
 string_nr_SOURCES = string_nr.l
 string_r_SOURCES = string_r.l
 top_SOURCES = top.l top_main.c
+yyextra_SOURCES = yyextra.l
 
 BUILT_SOURCES = \
        bison_nr_scanner.h \
@@ -116,7 +118,9 @@ basic_nr.txt \
        noansi_r.txt \
        prefix_nr.txt \
        prefix_r.txt \
-       top.txt
+       top.h \
+       top.txt \
+       yyextra.txt
 
 # specify how to process .l files in order to test the flex built by make all
 
diff --git a/tests/test-yyextra/.gitignore b/tests/test-yyextra/.gitignore
deleted file mode 100644 (file)
index 7e4b915..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-parser.c
-parser.h
-scanner.c
-test-yyextra
-OUTPUT
diff --git a/tests/test-yyextra/Makefile.am b/tests/test-yyextra/Makefile.am
deleted file mode 100644 (file)
index d55f74e..0000000
+++ /dev/null
@@ -1,49 +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.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)
-#LDFLAGS = $(top_srcdir)/libfl.a 
-#LFLAGS = --header="scanner.h"
-#YFLAGS = --defines --output=parser.c
-
-testname = test-yyextra
-
-scanner.c: $(srcdir)/scanner.l
-       $(FLEX) $(LFLAGS) $<
-
-parser.c: $(srcdir)/parser.y
-       $(BISON) $(YFLAGS) $<
-
-$(testname)$(EXEEXT): $(OBJS)
-       $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES)
-
-test: $(testname)$(EXEEXT)
-       ./$(testname)$(EXEEXT) < $(srcdir)/test.input
-
-.c.o:
-       $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
similarity index 98%
rename from tests/test-yyextra/scanner.l
rename to tests/yyextra.l
index baba52b01ac3cf8ff6b251ae185c6aa4311c5291..172d02d1e9bbce4a3ff00f0f9f53b03cbcfd2a19 100644 (file)
@@ -47,7 +47,7 @@ static void append_char (char c,  yyscan_t  scanner );
 
 %}
 
-%option 8bit outfile="scanner.c" prefix="test"
+%option 8bit prefix="test"
 %option nounput nomain noyywrap nodefault
 %option warn
 %option reentrant