refactor c_cxx_nr, c_cxx_r tests for new test suite layout

This commit is contained in:
Will Estes 2014-06-14 16:22:07 -04:00
parent 278d524678
commit 18abc5a0e6
10 changed files with 23 additions and 103 deletions

4
tests/.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -32,7 +32,7 @@
%}
%option 8bit outfile="scanner.cpp" prefix="test"
%option 8bit prefix="test"
%option nounput nomain noyywrap
%option warn

View File

@ -32,7 +32,7 @@
%}
%option 8bit outfile="scanner.cpp" prefix="test"
%option 8bit prefix="test"
%option nounput nomain noyywrap
%option warn reentrant

View File

@ -1,5 +0,0 @@
Makefile
scanner.cpp
test-c-cpp-nr
OUTPUT
Makefile.in

View File

@ -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) $<

View File

@ -1,5 +0,0 @@
Makefile
scanner.cpp
test-c-cpp-r
OUTPUT
Makefile.in

View File

@ -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) $<