diff options
author | Will Estes <westes575@gmail.com> | 2014-06-04 09:04:09 -0400 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2014-11-12 05:14:26 -0500 |
commit | 82f6a7cc2c75b09a7fb505ecbeaf6fc5f80622f9 (patch) | |
tree | 7a6138555c0da5c57cd499fd5777b4ad99941027 /tests | |
parent | bb00ab6892df1799c25790cf2f48c9260f4ff059 (diff) |
refactor bison-yylloc test for new test suite layout
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.gitignore | 3 | ||||
-rw-r--r-- | tests/Makefile.am | 15 | ||||
-rw-r--r-- | tests/bison-yylloc-main.c (renamed from tests/test-bison-yylloc/main.c) | 4 | ||||
-rw-r--r-- | tests/bison-yylloc-parser.y (renamed from tests/test-bison-yylloc/parser.y) | 2 | ||||
-rw-r--r-- | tests/bison-yylloc-scanner.l (renamed from tests/test-bison-yylloc/scanner.l) | 6 | ||||
-rw-r--r-- | tests/bison-yylloc.txt (renamed from tests/test-bison-yylloc/test.input) | 0 | ||||
-rw-r--r-- | tests/test-bison-yylloc/.gitignore | 10 | ||||
-rw-r--r-- | tests/test-bison-yylloc/Makefile.am | 55 |
8 files changed, 21 insertions, 74 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index fd7c410..10f6ae5 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -14,3 +14,6 @@ basic-r.c bison-nr bison-nr-scanner.[ch] bison-nr-parser.[ch] +bison-yylloc +bison-yylloc-parser.[ch] +bison-yylloc-scanner.[ch] diff --git a/tests/Makefile.am b/tests/Makefile.am index 1d23e40..b180c88 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -32,7 +32,8 @@ check_PROGRAMS = \ array-r \ basic-nr \ basic-r \ - bison-nr + bison-nr \ + bison-yylloc alloc_extra_SOURCES = alloc-extra.l array_nr_SOURCES = array-nr.l @@ -40,10 +41,13 @@ array_r_SOURCES = array-r.l basic_nr_SOURCES = basic-nr.l basic_r_SOURCES = basic-r.l bison_nr_SOURCES = bison-nr-scanner.l bison-nr-parser.y bison-nr-main.c +bison_yylloc_SOURCES = bison-yylloc-scanner.l bison-yylloc-parser.y bison-yylloc-main.c BUILT_SOURCES = \ bison-nr-scanner.h \ - bison-nr-parser.h + bison-nr-parser.h \ + bison-yylloc-parser.h \ + bison-yylloc-scanner.h EXTRA_DIST = \ README \ @@ -54,7 +58,9 @@ EXTRA_DIST = \ basic-nr.txt \ basic-r.txt \ bison-nr-scanner.h \ - bison-nr.txt + bison-nr.txt \ + bison-yylloc-scanner.h \ + bison-yylloc.txt # specify how to process .l files in order to test the flex built by make all @@ -65,3 +71,6 @@ FLEX = $(top_builddir)/src/flex bison-nr-main($objext): bison-nr-parser.h bison-nr-scanner.h bison-nr-scanner.h: bison-nr-scanner.c + +bison-yylloc-main$(objext): bison-yylloc-parser.h bison-yylloc-scanner.h +bison-yylloc-scanner.h: bison-yylloc-scanner.c diff --git a/tests/test-bison-yylloc/main.c b/tests/bison-yylloc-main.c index 24568a9..ba56219 100644 --- a/tests/test-bison-yylloc/main.c +++ b/tests/bison-yylloc-main.c @@ -21,8 +21,8 @@ * PURPOSE. */ -#include "parser.h" -#include "scanner.h" +#include "bison-yylloc-parser.h" +#include "bison-yylloc-scanner.h" int main ( int argc, char** argv ) { diff --git a/tests/test-bison-yylloc/parser.y b/tests/bison-yylloc-parser.y index 224d252..87cb501 100644 --- a/tests/test-bison-yylloc/parser.y +++ b/tests/bison-yylloc-parser.y @@ -26,7 +26,7 @@ /* How to compile: - bison --defines --output-file="parser.c" --name-prefix="test" parser.y + bison --defines --output-file="bison-yylloc-parser.c" --name-prefix="test" parser.y */ %{ #include <stdio.h> diff --git a/tests/test-bison-yylloc/scanner.l b/tests/bison-yylloc-scanner.l index aaf6fd7..dbcc237 100644 --- a/tests/test-bison-yylloc/scanner.l +++ b/tests/bison-yylloc-scanner.l @@ -25,16 +25,16 @@ /* The scanner expects to link to bison yylval . */ #include <stdio.h> #include <stdlib.h> -#include "parser.h" +#include "bison-yylloc-parser.h" #include "config.h" static char* STRDUP(char* s1); #define YY_EXTRA_TYPE int %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option reentrant bison-bridge bison-locations yylineno %option nomain nounput noyy_top_state noyywrap nodefault warn -%option prefix="test" header="scanner.h" +%option header="bison-yylloc-scanner.h" %% diff --git a/tests/test-bison-yylloc/test.input b/tests/bison-yylloc.txt index 94adcb2..94adcb2 100644 --- a/tests/test-bison-yylloc/test.input +++ b/tests/bison-yylloc.txt diff --git a/tests/test-bison-yylloc/.gitignore b/tests/test-bison-yylloc/.gitignore deleted file mode 100644 index 690e860..0000000 --- a/tests/test-bison-yylloc/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -scanner.h -yyheader.h -test-bison-yylloc - -OUTPUT diff --git a/tests/test-bison-yylloc/Makefile.am b/tests/test-bison-yylloc/Makefile.am deleted file mode 100644 index dc41b0f..0000000 --- a/tests/test-bison-yylloc/Makefile.am +++ /dev/null @@ -1,55 +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 - -builddir = @builddir@ - -EXTRA_DIST = scanner.l parser.y test.input main.c -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = scanner.o parser.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -YFLAGS = --defines --output=parser.c --name-prefix="test" - -testname = test-bison-yylloc - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< -scanner.h: scanner.c -scanner.o: parser.h - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< -parser.h: parser.c - -main.o: scanner.h parser.h - -$(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) $< |