summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2014-06-04 16:58:33 -0400
committerWill Estes <westes575@gmail.com>2014-11-12 05:14:26 -0500
commit1c39506c5a670f120c7fae3181f2f5b0aa17653d (patch)
tree9c9db75990ba6e29145f0d351a2c890c67048514 /tests
parentd342834a6b29b16fe15db9b339a89b8506fbb2d7 (diff)
refactor header_nr test for new test suite layout
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore2
-rw-r--r--tests/Makefile.am14
-rw-r--r--tests/header_nr.txt (renamed from tests/test-header-nr/test.input)0
-rw-r--r--tests/header_nr_main.c (renamed from tests/test-header-nr/main.c)2
-rw-r--r--tests/header_nr_scanner.l (renamed from tests/test-header-nr/scanner.l)2
-rw-r--r--tests/test-header-nr/.gitignore7
-rw-r--r--tests/test-header-nr/Makefile.am53
7 files changed, 15 insertions, 65 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index 4be8a48..4a9e55d 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -28,3 +28,5 @@ debug_r
debug_r.c
extended
extended.c
+header_nr
+header_nr_scanner.[ch]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e41b5f2..1a47e14 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -38,7 +38,8 @@ check_PROGRAMS = \
ccl \
debug_nr \
debug_r \
- extended
+ extended \
+ header_nr
alloc_extra_SOURCES = alloc_extra.l
array_nr_SOURCES = array_nr.l
@@ -52,6 +53,7 @@ ccl_SOURCES = ccl.l
debug_nr_SOURCES = debug_nr.l
debug_r_SOURCES = debug_r.l
extended_SOURCES = extended.l
+header_nr_SOURCES = header_nr_scanner.l header_nr_main.c
BUILT_SOURCES = \
bison_nr_scanner.h \
@@ -59,7 +61,8 @@ BUILT_SOURCES = \
bison_yylloc_parser.h \
bison_yylloc_scanner.h \
bison_yylval_parser.h \
- bison_yylval_scanner.h
+ bison_yylval_scanner.h \
+ header_nr_scanner.h
EXTRA_DIST = \
README \
@@ -78,7 +81,9 @@ basic_nr.txt \
ccl.txt \
debug_nr.txt \
debug_r.txt \
- extended.txt
+ extended.txt \
+ header_nr_scanner.h \
+ header_nr.txt
# specify how to process .l files in order to test the flex built by make all
@@ -95,3 +100,6 @@ bison_yylloc_scanner.h: bison_yylloc_scanner.c
bison_yylval_main$(objext): bison_yylval_parser.h bison_yylval_scanner.h
bison_yylval_scanner.h: bison_yylval_scanner.c
+
+header_nr_main$(objext): header_nr_scanner.h
+header_nr_scanner.h: header_nr_scanner.c
diff --git a/tests/test-header-nr/test.input b/tests/header_nr.txt
index 2ce5001..2ce5001 100644
--- a/tests/test-header-nr/test.input
+++ b/tests/header_nr.txt
diff --git a/tests/test-header-nr/main.c b/tests/header_nr_main.c
index b03fe30..0ac60d9 100644
--- a/tests/test-header-nr/main.c
+++ b/tests/header_nr_main.c
@@ -21,7 +21,7 @@
* PURPOSE.
*/
-#include "scanner.h"
+#include "header_nr_scanner.h"
int
main ( int argc, char** argv )
diff --git a/tests/test-header-nr/scanner.l b/tests/header_nr_scanner.l
index a768f72..31332fc 100644
--- a/tests/test-header-nr/scanner.l
+++ b/tests/header_nr_scanner.l
@@ -29,7 +29,7 @@
%}
-%option 8bit outfile="scanner.c" prefix="test" header="scanner.h"
+%option 8bit prefix="test" header="header_nr_scanner.h"
%option nounput nomain noyywrap
%option warn
diff --git a/tests/test-header-nr/.gitignore b/tests/test-header-nr/.gitignore
deleted file mode 100644
index 9ef03b1..0000000
--- a/tests/test-header-nr/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-scanner.c
-scanner.h
-test-header-nr
-
-OUTPUT
diff --git a/tests/test-header-nr/Makefile.am b/tests/test-header-nr/Makefile.am
deleted file mode 100644
index 11b6ff4..0000000
--- a/tests/test-header-nr/Makefile.am
+++ /dev/null
@@ -1,53 +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 test.input main.c
-CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) $(OBJS) OUTPUT
-OBJS = scanner.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
-
-testname = test-header-nr
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $<
-
-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) $<
-
-scanner.h: scanner.c
-main.o: scanner.h