From: Will Estes Date: Mon, 30 Jun 2014 12:30:31 +0000 (-0400) Subject: Remove linedir_r test. X-Git-Tag: v2.6.0~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c28dcc469e132744cf3ae153aa9fa5efff3e0d1;p=flex Remove linedir_r test. The linedir_r test tested the implementation of line number tracking, not its results. --- diff --git a/tests/test-linedir-r/.gitignore b/tests/test-linedir-r/.gitignore deleted file mode 100644 index 8642445..0000000 --- a/tests/test-linedir-r/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -scanner.c -scanner.h -test-linedir-r -OUTPUT diff --git a/tests/test-linedir-r/Makefile.am b/tests/test-linedir-r/Makefile.am deleted file mode 100644 index d7f3bf7..0000000 --- a/tests/test-linedir-r/Makefile.am +++ /dev/null @@ -1,56 +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 - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input main.c check-lines.awk -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-linedir-r - -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)$(EXEEXT) < $(srcdir)/test.input - cat -n scanner.c | grep '#line' | grep scanner.c | $(AWK) -f $(srcdir)/check-lines.awk - cat -n scanner.h | grep '#line' | grep scanner.h | $(AWK) -f $(srcdir)/check-lines.awk - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -scanner.h: scanner.c -main.o: scanner.h diff --git a/tests/test-linedir-r/check-lines.awk b/tests/test-linedir-r/check-lines.awk deleted file mode 100644 index 6a1e5ec..0000000 --- a/tests/test-linedir-r/check-lines.awk +++ /dev/null @@ -1,7 +0,0 @@ -{ - if( /#line/ && $1 != ($3 - 1)) { - printf "Line directive mismatch at line %d: %s\n", NR, $0; - exit 1; - } -} - diff --git a/tests/test-linedir-r/main.c b/tests/test-linedir-r/main.c deleted file mode 100644 index 6ba9808..0000000 --- a/tests/test-linedir-r/main.c +++ /dev/null @@ -1,58 +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. - */ - -#include "scanner.h" - -int -main ( int argc, char** argv ) -{ - yyscan_t scanner; - FILE *fp; - char * extra = "EXTRA"; - - testlex_init(&scanner); - testset_in(stdin,scanner); - testset_out(stdout,scanner); - testset_extra(extra,scanner); - - fp = testget_in(scanner); - fp = testget_out(scanner); - - while(testlex(scanner)) { - char * text; - int line; - line = testget_lineno(scanner); - text = testget_text(scanner); - - if( (char*)testget_extra(scanner) != extra) - break; - - if ( !text || line < 0) - continue; - } - testlex_destroy(scanner); - return 0; -} - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-linedir-r/scanner.l b/tests/test-linedir-r/scanner.l deleted file mode 100644 index e87cc60..0000000 --- a/tests/test-linedir-r/scanner.l +++ /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. - */ - -%{ -/* Build "scanner.c". - The scanner is not important. - This test is really about getting the line directives correct. -*/ -#include -#include -#include "config.h" - -%} - -%option reentrant -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap -%option warn - -%% - -.|\n { } - -%% - diff --git a/tests/test-linedir-r/test.input b/tests/test-linedir-r/test.input deleted file mode 100644 index 2ce5001..0000000 --- a/tests/test-linedir-r/test.input +++ /dev/null @@ -1,3 +0,0 @@ -Any input is ok for this scanner. -We only care if it links. -