From dd7eda5be09771a831a80215e0e44dd0c47823c2 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Tue, 1 Jul 2014 20:56:44 -0400 Subject: [PATCH] refactor lineno_r test for new test suite layout --- tests/.gitignore | 2 + tests/Makefile.am | 5 ++- tests/{test-lineno-r/scanner.l => lineno_r.l} | 2 +- .../test.input => lineno_r.one.txt} | 0 tests/test-lineno-r/.gitignore | 8 ---- tests/test-lineno-r/Makefile.am | 45 ------------------- 6 files changed, 7 insertions(+), 55 deletions(-) rename tests/{test-lineno-r/scanner.l => lineno_r.l} (98%) rename tests/{test-lineno-r/test.input => lineno_r.one.txt} (100%) delete mode 100644 tests/test-lineno-r/.gitignore delete mode 100644 tests/test-lineno-r/Makefile.am diff --git a/tests/.gitignore b/tests/.gitignore index 853a1a8..618c6af 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -51,6 +51,8 @@ include_by_reentrant.direct include_by_reentrant.direct.c lineno_nr.one lineno_nr.c +lineno_r.one +lineno_r.c mem_nr mem_nr.c mem_r diff --git a/tests/Makefile.am b/tests/Makefile.am index 5847359..03fd1a3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -114,7 +114,8 @@ PTHREAD_TESTS = \ pthread.pthread ONE_TESTS = \ - lineno_nr.one + lineno_nr.one \ + lineno_r.one alloc_extra_SOURCES = alloc_extra.l array_nr_SOURCES = array_nr.l @@ -139,6 +140,7 @@ 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 +lineno_r_one_SOURCES = lineno_r.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 @@ -222,6 +224,7 @@ basic_nr.txt \ include_by_reentrant.direct_2.txt \ include_by_reentrant.direct_3.txt \ lineno_nr.one.txt \ + lineno_r.one.txt \ mem_nr.txt \ mem_r.txt \ noansi_nr.txt \ diff --git a/tests/test-lineno-r/scanner.l b/tests/lineno_r.l similarity index 98% rename from tests/test-lineno-r/scanner.l rename to tests/lineno_r.l index 8933f5f..4132ed3 100644 --- a/tests/test-lineno-r/scanner.l +++ b/tests/lineno_r.l @@ -34,7 +34,7 @@ %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option nounput nomain noyywrap yylineno reentrant %option warn diff --git a/tests/test-lineno-r/test.input b/tests/lineno_r.one.txt similarity index 100% rename from tests/test-lineno-r/test.input rename to tests/lineno_r.one.txt diff --git a/tests/test-lineno-r/.gitignore b/tests/test-lineno-r/.gitignore deleted file mode 100644 index 9c9f4d0..0000000 --- a/tests/test-lineno-r/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-lineno-r -OUTPUT -.deps diff --git a/tests/test-lineno-r/Makefile.am b/tests/test-lineno-r/Makefile.am deleted file mode 100644 index 8ded4b3..0000000 --- a/tests/test-lineno-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.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-lineno-r - -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) $< -- 2.40.0