mirror of
https://github.com/westes/flex.git
synced 2026-01-27 01:44:23 +00:00
refactor include_by_* tests for new test suite layout
This commit is contained in:
parent
7563365413
commit
e98b2df022
6
tests/.gitignore
vendored
6
tests/.gitignore
vendored
@ -41,6 +41,12 @@ header_nr
|
||||
header_nr_scanner.[ch]
|
||||
header_r
|
||||
header_r_scanner.[ch]
|
||||
include_by_buffer.direct
|
||||
include_by_buffer.direct.c
|
||||
include_by_push.direct
|
||||
include_by_push.direct.c
|
||||
include_by_reentrant.direct
|
||||
include_by_reentrant.direct.c
|
||||
mem_nr
|
||||
mem_nr.c
|
||||
mem_r
|
||||
|
||||
@ -87,6 +87,9 @@ TABLE_TESTS = \
|
||||
reject_ver.table
|
||||
|
||||
DIRECT_TESTS = \
|
||||
include_by_buffer.direct \
|
||||
include_by_push.direct \
|
||||
include_by_reentrant.direct \
|
||||
rescan_nr.direct \
|
||||
rescan_r.direct
|
||||
|
||||
@ -108,6 +111,9 @@ debug_r_SOURCES = debug_r.l
|
||||
extended_SOURCES = extended.l
|
||||
header_nr_SOURCES = header_nr_scanner.l header_nr_main.c
|
||||
header_r_SOURCES = header_r_scanner.l header_r_main.c
|
||||
include_by_buffer_direct_SOURCES = include_by_buffer.direct.l
|
||||
include_by_push_direct_SOURCES = include_by_push.direct.l
|
||||
include_by_reentrant_direct_SOURCES = include_by_reentrant.direct.l
|
||||
mem_nr_SOURCES = mem_nr.l
|
||||
mem_r_SOURCES = mem_r.l
|
||||
multiple_scanners_nr_SOURCES = multiple_scanners_nr_main.c multiple_scanners_nr_1.l multiple_scanners_nr_2.l
|
||||
@ -179,6 +185,15 @@ basic_nr.txt \
|
||||
header_nr.txt \
|
||||
header_r_scanner.h \
|
||||
header_r.txt \
|
||||
include_by_buffer.direct.txt \
|
||||
include_by_buffer.direct_2.txt \
|
||||
include_by_buffer.direct_3.txt \
|
||||
include_by_push.direct.txt \
|
||||
include_by_push.direct_2.txt \
|
||||
include_by_push.direct_3.txt \
|
||||
include_by_reentrant.direct.txt \
|
||||
include_by_reentrant.direct_2.txt \
|
||||
include_by_reentrant.direct_3.txt \
|
||||
mem_nr.txt \
|
||||
mem_r.txt \
|
||||
noansi_nr.txt \
|
||||
@ -232,6 +247,12 @@ header_nr_scanner.h: header_nr_scanner.c
|
||||
header_r_main.$(OBJEXT): header_r_scanner.h
|
||||
header_r_scanner.h: header_r_scanner.c
|
||||
|
||||
include_by_buffer.direct$(EXE): include_by_buffer.direct.txt include_by_buffer.direct_2.txt include_by_buffer.direct_3.txt
|
||||
|
||||
include_by_push.direct$(EXE): include_by_push.direct.txt include_by_push.direct_2.txt include_by_push.direct_3.txt
|
||||
|
||||
include_by_reentrant.direct$(EXE): include_by_reentrant.direct.txt include_by_reentrant.direct_2.txt include_by_reentrant.direct_3.txt
|
||||
|
||||
multiple_scanners_nr_main.$(OBJEXT): multiple_scanners_nr_1.h multiple_scanners_nr_2.h
|
||||
multiple_scanners_nr_1.h: multiple_scanners_nr_1.c
|
||||
multiple_scanners_nr_2.h: multiple_scanners_nr_2.c
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
f * are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
@ -31,7 +31,7 @@
|
||||
#include "config.h"
|
||||
%}
|
||||
|
||||
%option 8bit outfile="scanner.c" prefix="test"
|
||||
%option 8bit prefix="test"
|
||||
%option nounput nomain noyywrap
|
||||
%option warn
|
||||
|
||||
@ -87,7 +87,7 @@ main ( int argc, char** argv )
|
||||
{
|
||||
FILE * fp;
|
||||
if( argc != 2 ) {
|
||||
fprintf(stderr,"*** Error: Must specifiy one filename.\n");
|
||||
fprintf(stderr,"*** Error: Must specify one filename.\n");
|
||||
exit(-1);
|
||||
}
|
||||
if((fp=fopen(argv[1],"r"))==NULL) {
|
||||
3
tests/include_by_buffer.direct.txt
Normal file
3
tests/include_by_buffer.direct.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Beginning of "include_by_buffer.direct.txt"
|
||||
#include <include_by_buffer.direct_2.txt>
|
||||
End of "include_by_buffer.direct.txt"
|
||||
3
tests/include_by_buffer.direct_2.txt
Normal file
3
tests/include_by_buffer.direct_2.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Beginning of "include_by_buffer.direct_2.txt"
|
||||
#include <include_by_buffer.direct_3.txt>
|
||||
End of "include_by_buffer.direct_2.txt"
|
||||
2
tests/include_by_buffer.direct_3.txt
Normal file
2
tests/include_by_buffer.direct_3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Beginning of "include_by_buffer.direct_3.txt"
|
||||
End of "include_by_buffer.direct_3.txt"
|
||||
@ -31,7 +31,7 @@
|
||||
#include "config.h"
|
||||
%}
|
||||
|
||||
%option 8bit outfile="scanner.c" prefix="test"
|
||||
%option 8bit prefix="test"
|
||||
%option nounput nomain noyywrap
|
||||
%option warn
|
||||
|
||||
@ -77,7 +77,7 @@ main ( int argc, char** argv )
|
||||
{
|
||||
FILE * fp;
|
||||
if( argc != 2 ) {
|
||||
fprintf(stderr,"*** Error: Must specifiy one filename.\n");
|
||||
fprintf(stderr,"*** Error: Must specify one filename.\n");
|
||||
exit(-1);
|
||||
}
|
||||
if((fp=fopen(argv[1],"r"))==NULL) {
|
||||
3
tests/include_by_push.direct.txt
Normal file
3
tests/include_by_push.direct.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Beginning of "include_by_push.direct.txt"
|
||||
#include <include_by_push.direct_2.txt>
|
||||
End of "include_by_push.direct.txt"
|
||||
3
tests/include_by_push.direct_2.txt
Normal file
3
tests/include_by_push.direct_2.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Beginning of "include_by_push.direct_2.txt"
|
||||
#include <include_by_push.direct_3.txt>
|
||||
End of "include_by_push.direct_2.txt"
|
||||
2
tests/include_by_push.direct_3.txt
Normal file
2
tests/include_by_push.direct_3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Beginning of "include_by_push.direct_3.txt"
|
||||
End of "include_by_push.direct_3.txt"
|
||||
@ -31,7 +31,7 @@
|
||||
#include "config.h"
|
||||
%}
|
||||
|
||||
%option 8bit outfile="scanner.c" prefix="test"
|
||||
%option 8bit prefix="test"
|
||||
%option nounput nomain noyywrap
|
||||
%option reentrant
|
||||
%option warn
|
||||
@ -84,7 +84,7 @@ main ( argc, argv )
|
||||
FILE * fp;
|
||||
yyscan_t scanner;
|
||||
if( argc != 2 ) {
|
||||
fprintf(stderr,"*** Error: Must specifiy one filename.\n");
|
||||
fprintf(stderr,"*** Error: Must specify one filename.\n");
|
||||
exit(-1);
|
||||
}
|
||||
if((fp=fopen(argv[1],"r"))==NULL) {
|
||||
3
tests/include_by_reentrant.direct.txt
Normal file
3
tests/include_by_reentrant.direct.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Beginning of "include_by_reentrant.direct.txt".
|
||||
#include <include_by_reentrant.direct_2.txt>
|
||||
End of "include_by_reentrant.direct.txt".
|
||||
3
tests/include_by_reentrant.direct_2.txt
Normal file
3
tests/include_by_reentrant.direct_2.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Beginning of "include_by_reentrant.direct_2.txt".
|
||||
#include <include_by_reentrant.direct_3.txt>
|
||||
End of "include_by_reentrant.direct_2.txt".
|
||||
2
tests/include_by_reentrant.direct_3.txt
Normal file
2
tests/include_by_reentrant.direct_3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Beginning of "include_by_reentrant.direct_3.txt".
|
||||
End of "include_by_reentrant.direct_3.txt".
|
||||
7
tests/test-include-by-buffer/.gitignore
vendored
7
tests/test-include-by-buffer/.gitignore
vendored
@ -1,7 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
parser.c
|
||||
parser.h
|
||||
scanner.c
|
||||
test-include-by-buffer
|
||||
OUTPUT
|
||||
@ -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-1.input test-2.input test-3.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-include-by-buffer
|
||||
|
||||
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-1.input
|
||||
|
||||
.c.o:
|
||||
$(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
|
||||
@ -1,3 +0,0 @@
|
||||
Beginning of "test-1.input".
|
||||
#include <test-2.input>
|
||||
End of "test-1.input".
|
||||
@ -1,3 +0,0 @@
|
||||
Beginning of "test-2.input".
|
||||
#include <test-3.input>
|
||||
End of "test-2.input".
|
||||
@ -1,2 +0,0 @@
|
||||
Beginning of "test-3.input".
|
||||
End of "test-3.input".
|
||||
7
tests/test-include-by-push/.gitignore
vendored
7
tests/test-include-by-push/.gitignore
vendored
@ -1,7 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
parser.c
|
||||
parser.h
|
||||
scanner.c
|
||||
test-include-by-push
|
||||
OUTPUT
|
||||
@ -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-1.input test-2.input test-3.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-include-by-push
|
||||
|
||||
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-1.input
|
||||
|
||||
.c.o:
|
||||
$(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
|
||||
@ -1,3 +0,0 @@
|
||||
Beginning of "test-1.input".
|
||||
#include <test-2.input>
|
||||
End of "test-1.input".
|
||||
@ -1,3 +0,0 @@
|
||||
Beginning of "test-2.input".
|
||||
#include <test-3.input>
|
||||
End of "test-2.input".
|
||||
@ -1,2 +0,0 @@
|
||||
Beginning of "test-3.input".
|
||||
End of "test-3.input".
|
||||
7
tests/test-include-by-reentrant/.gitignore
vendored
7
tests/test-include-by-reentrant/.gitignore
vendored
@ -1,7 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
parser.c
|
||||
parser.h
|
||||
scanner.c
|
||||
test-include-by-reentrant
|
||||
OUTPUT
|
||||
@ -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-1.input test-2.input test-3.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-include-by-reentrant
|
||||
|
||||
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) $(srcdir)/test-1.input
|
||||
|
||||
.c.o:
|
||||
$(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
|
||||
@ -1,3 +0,0 @@
|
||||
Beginning of "test-1.input".
|
||||
#include <test-2.input>
|
||||
End of "test-1.input".
|
||||
@ -1,3 +0,0 @@
|
||||
Beginning of "test-2.input".
|
||||
#include <test-3.input>
|
||||
End of "test-2.input".
|
||||
@ -1,2 +0,0 @@
|
||||
Beginning of "test-3.input".
|
||||
End of "test-3.input".
|
||||
Loading…
x
Reference in New Issue
Block a user