summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2014-06-14 16:22:07 -0400
committerWill Estes <westes575@gmail.com>2014-11-12 05:14:27 -0500
commit18abc5a0e644d76fe0b5c48711f3609fa70138f8 (patch)
tree650d3696f76a50a75f854e0807e766ddd7976955 /tests
parent278d5246783f32865905c53864edb5b0e410a28b (diff)
refactor c_cxx_nr, c_cxx_r tests for new test suite layout
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore4
-rw-r--r--tests/Makefile.am18
-rw-r--r--tests/c_cxx_nr.lll (renamed from tests/test-c-cpp-nr/scanner.l)2
-rw-r--r--tests/c_cxx_nr.txt (renamed from tests/test-c-cpp-nr/test.input)0
-rw-r--r--tests/c_cxx_r.lll (renamed from tests/test-c-cpp-r/scanner.l)2
-rw-r--r--tests/c_cxx_r.txt (renamed from tests/test-c-cpp-r/test.input)0
-rw-r--r--tests/test-c-cpp-nr/.gitignore5
-rw-r--r--tests/test-c-cpp-nr/Makefile.am45
-rw-r--r--tests/test-c-cpp-r/.gitignore5
-rw-r--r--tests/test-c-cpp-r/Makefile.am45
10 files changed, 23 insertions, 103 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index 2a75e2b..363c9d1 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -20,6 +20,10 @@ bison_yylloc_scanner.[ch]
bison_yylval
bison_yylval_parser.[ch]
bison_yylval_scanner.[ch]
+c_cxx_nr
+c_cxx_nr.cc
+c_cxx_r
+c_cxx_r.cc
ccl
ccl.c
cxx_basic
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1098c98..5691e0c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,6 +35,8 @@ check_PROGRAMS = \
bison_nr \
bison_yylloc \
bison_yylval \
+ c_cxx_nr \
+ c_cxx_r \
ccl \
cxx_basic \
debug_nr \
@@ -63,6 +65,8 @@ 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
bison_yylval_SOURCES = bison_yylval_scanner.l bison_yylval_parser.y bison_yylval_main.c
+c_cxx_nr_SOURCES = c_cxx_nr.lll
+c_cxx_r_SOURCES = c_cxx_r.lll
ccl_SOURCES = ccl.l
cxx_basic_SOURCES = cxx_basic.ll
debug_nr_SOURCES = debug_nr.l
@@ -90,6 +94,8 @@ BUILT_SOURCES = \
bison_yylloc_scanner.h \
bison_yylval_parser.h \
bison_yylval_scanner.h \
+ c_cxx_nr.cc \
+ c_cxx_r.cc \
header_nr_scanner.h \
header_r_scanner.h \
top.h
@@ -108,8 +114,12 @@ basic_nr.txt \
bison_yylloc.txt \
bison_yylval_scanner.h \
bison_yylval.txt \
- cxx_basic.txt \
+ c_cxx_nr.cc \
+ c_cxx_nr.txt \
+ c_cxx_r.cc \
+ c_cxx_r.txt \
ccl.txt \
+ cxx_basic.txt \
debug_nr.txt \
debug_r.txt \
extended.txt \
@@ -146,6 +156,12 @@ 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
+# automake does not support compiling flex scanners output in C as C++
+# so we explicitly sayhow, using the .lll suffix for the lex input file
+
+.lll.cc:
+ $(FLEX) -o $@ $<
+
header_nr_main$(objext): header_nr_scanner.h
header_nr_scanner.h: header_nr_scanner.c
diff --git a/tests/test-c-cpp-nr/scanner.l b/tests/c_cxx_nr.lll
index e184008..c9e0fb6 100644
--- a/tests/test-c-cpp-nr/scanner.l
+++ b/tests/c_cxx_nr.lll
@@ -32,7 +32,7 @@
%}
-%option 8bit outfile="scanner.cpp" prefix="test"
+%option 8bit prefix="test"
%option nounput nomain noyywrap
%option warn
diff --git a/tests/test-c-cpp-nr/test.input b/tests/c_cxx_nr.txt
index 7288a40..7288a40 100644
--- a/tests/test-c-cpp-nr/test.input
+++ b/tests/c_cxx_nr.txt
diff --git a/tests/test-c-cpp-r/scanner.l b/tests/c_cxx_r.lll
index 3182d1b..83a39d7 100644
--- a/tests/test-c-cpp-r/scanner.l
+++ b/tests/c_cxx_r.lll
@@ -32,7 +32,7 @@
%}
-%option 8bit outfile="scanner.cpp" prefix="test"
+%option 8bit prefix="test"
%option nounput nomain noyywrap
%option warn reentrant
diff --git a/tests/test-c-cpp-r/test.input b/tests/c_cxx_r.txt
index 7288a40..7288a40 100644
--- a/tests/test-c-cpp-r/test.input
+++ b/tests/c_cxx_r.txt
diff --git a/tests/test-c-cpp-nr/.gitignore b/tests/test-c-cpp-nr/.gitignore
deleted file mode 100644
index 94f62d4..0000000
--- a/tests/test-c-cpp-nr/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile
-scanner.cpp
-test-c-cpp-nr
-OUTPUT
-Makefile.in
diff --git a/tests/test-c-cpp-nr/Makefile.am b/tests/test-c-cpp-nr/Makefile.am
deleted file mode 100644
index 9aec3b2..0000000
--- a/tests/test-c-cpp-nr/Makefile.am
+++ /dev/null
@@ -1,45 +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.cpp $(testname)$(EXEEXT) $(OBJS) OUTPUT
-OBJS = scanner.o
-
-AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir)
-#LDFLAGS = $(top_srcdir)/libfl.a
-#YFLAGS = --defines --output=parser.c
-
-testname = test-c-cpp-nr
-
-scanner.cpp: $(srcdir)/scanner.l
- $(FLEX) $<
-
-$(testname)$(EXEEXT): $(OBJS)
- $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES)
-
-test: $(testname)$(EXEEXT)
- ./$(testname)$(EXEEXT) < $(srcdir)/test.input
-
-.cpp.o:
- $(CXX) $(CXXFLAGS) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $<
diff --git a/tests/test-c-cpp-r/.gitignore b/tests/test-c-cpp-r/.gitignore
deleted file mode 100644
index 40be8ce..0000000
--- a/tests/test-c-cpp-r/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile
-scanner.cpp
-test-c-cpp-r
-OUTPUT
-Makefile.in
diff --git a/tests/test-c-cpp-r/Makefile.am b/tests/test-c-cpp-r/Makefile.am
deleted file mode 100644
index 1c9c23e..0000000
--- a/tests/test-c-cpp-r/Makefile.am
+++ /dev/null
@@ -1,45 +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.cpp $(testname)$(EXEEXT) $(OBJS) OUTPUT
-OBJS = scanner.o
-
-AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir)
-#LDFLAGS = $(top_srcdir)/libfl.a
-#YFLAGS = --defines --output=parser.c
-
-testname = test-c-cpp-r
-
-scanner.cpp: $(srcdir)/scanner.l
- $(FLEX) $<
-
-$(testname)$(EXEEXT): $(OBJS)
- $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES)
-
-test: $(testname)$(EXEEXT)
- ./$(testname)$(EXEEXT) < $(srcdir)/test.input
-
-.cpp.o:
- $(CXX) $(CXXFLAGS) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $<