diff options
-rw-r--r-- | tests/.gitignore | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 12 | ||||
-rw-r--r-- | tests/lineno_nr.l (renamed from tests/test-lineno-nr/scanner.l) | 2 | ||||
-rw-r--r-- | tests/lineno_nr.one.txt (renamed from tests/test-lineno-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/test-lineno-nr/.gitignore | 8 | ||||
-rw-r--r-- | tests/test-lineno-nr/Makefile.am | 45 | ||||
-rwxr-xr-x | tests/testwrapper.sh | 8 |
7 files changed, 20 insertions, 57 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index 7a853fc..853a1a8 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -49,6 +49,8 @@ include_by_push.direct include_by_push.direct.c include_by_reentrant.direct include_by_reentrant.direct.c +lineno_nr.one +lineno_nr.c mem_nr mem_nr.c mem_r diff --git a/tests/Makefile.am b/tests/Makefile.am index 8b38e8c..5847359 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,7 +27,7 @@ TESTS = $(check_PROGRAMS) options.cn # automake knows how to distinguish between the various kinds of tests # we have. -TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread +TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread .one LOG_COMPILER = $(srcdir)/testwrapper.sh AM_LOG_FLAGS = -d $(srcdir) -r @@ -50,9 +50,12 @@ AM_I3_LOG_FLAGS=-i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt -i $(src PTHREAD_LOG_COMPILER=$(srcdir)/testwrapper.sh AM_PTHREAD_LOG_FLAGS=-i $(srcdir)/pthread_1.txt -i $(srcdir)/pthread_2.txt -i $(srcdir)/pthread_3.txt -i $(srcdir)/pthread_4.txt -i $(srcdir)/pthread_5.txt +ONE_LOG_COMPILER = $(srcdir)/testwrapper.sh +AM_ONE_LOG_FLAGS = -1 -d $(srcdir) + AM_YFLAGS = -d -p test -check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) +check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) $(ONE_TESTS) simple_tests = \ alloc_extra \ @@ -110,6 +113,9 @@ DIRECT_TESTS = \ PTHREAD_TESTS = \ pthread.pthread +ONE_TESTS = \ + lineno_nr.one + alloc_extra_SOURCES = alloc_extra.l array_nr_SOURCES = array_nr.l array_r_SOURCES = array_r.l @@ -132,6 +138,7 @@ 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 +lineno_nr_one_SOURCES = lineno_nr.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 @@ -214,6 +221,7 @@ basic_nr.txt \ include_by_reentrant.direct.txt \ include_by_reentrant.direct_2.txt \ include_by_reentrant.direct_3.txt \ + lineno_nr.one.txt \ mem_nr.txt \ mem_r.txt \ noansi_nr.txt \ diff --git a/tests/test-lineno-nr/scanner.l b/tests/lineno_nr.l index 4341335..501ae1e 100644 --- a/tests/test-lineno-nr/scanner.l +++ b/tests/lineno_nr.l @@ -34,7 +34,7 @@ %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option nounput nomain noyywrap yylineno %option warn diff --git a/tests/test-lineno-nr/test.input b/tests/lineno_nr.one.txt index c1eb961..c1eb961 100644 --- a/tests/test-lineno-nr/test.input +++ b/tests/lineno_nr.one.txt diff --git a/tests/test-lineno-nr/.gitignore b/tests/test-lineno-nr/.gitignore deleted file mode 100644 index 19d329e..0000000 --- a/tests/test-lineno-nr/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-lineno-nr -OUTPUT -.deps diff --git a/tests/test-lineno-nr/Makefile.am b/tests/test-lineno-nr/Makefile.am deleted file mode 100644 index 2db8e64..0000000 --- a/tests/test-lineno-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.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-lineno-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - test `./$(testname)$(EXEEXT) < $(srcdir)/test.input` -eq \ - `./$(testname)$(EXEEXT) 1 < $(srcdir)/test.input` || exit 1 - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/testwrapper.sh b/tests/testwrapper.sh index 2d0b7b7..014ee0a 100755 --- a/tests/testwrapper.sh +++ b/tests/testwrapper.sh @@ -9,7 +9,7 @@ INPUT_NAME="" INPUT_COUNT=0 USE_REDIRECT=0 -while getopts :d:i:rt OPTION ; do +while getopts :d:i:rt1 OPTION ; do case $OPTION in d) INPUT_DIRECTORY=$OPTARG ;; i) @@ -22,6 +22,7 @@ while getopts :d:i:rt OPTION ; do ;; r) USE_REDIRECT=1 ;; t) USE_TABLES=1 ;; + 1) DO_COMPARISON=1 ;; esac done @@ -29,6 +30,11 @@ TESTNAME="${!OPTIND}" INPUT_NAME=${INPUT_NAME:-`basename $TESTNAME`.txt} +if [ "$DO_COMPARISON" == "1" ] ; then + test `$TESTNAME 1 < $INPUT_DIRECTORY/$INPUT_NAME` -eq `$TESTNAME < $INPUT_DIRECTORY/$INPUT_NAME` + exit $? + fi + if [ $INPUT_COUNT -gt 1 ] ; then $TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME}.tables} ${INPUT_NAME} exit $? |