]> granicus.if.org Git - flex/commitdiff
refactor posixly_correct test for new test suite layout
authorWill Estes <westes575@gmail.com>
Sat, 14 Jun 2014 18:41:32 +0000 (14:41 -0400)
committerWill Estes <westes575@gmail.com>
Wed, 12 Nov 2014 10:14:27 +0000 (05:14 -0500)
tests/.gitignore
tests/Makefile.am
tests/posixly_correct.l [moved from tests/test-posixly-correct/scanner.l with 97% similarity]
tests/test-posixly-correct/.gitignore [deleted file]
tests/test-posixly-correct/Makefile.am [deleted file]

index ba408e91ebdd5688c9cc8d320f5ef55ddf4b1274..2576821dac4aa1e9b531464100d66fd6690cb459 100644 (file)
@@ -42,6 +42,8 @@ noansi_r
 noansi_r.c
 posix
 posix.c
+posixly_correct
+posixly_correct.c
 prefix_nr
 prefix_nr.c
 prefix_r
index 6e706b36e3d8129b7b1890a2cc74260968cb884f..c2e943b164d5699424f7dfb9443155273b1273dd 100644 (file)
@@ -46,6 +46,7 @@ check_PROGRAMS = \
        noansi_nr \
        noansi_r \
        posix \
+       posixly_correct \
        prefix_nr \
        prefix_r \
        string_nr \
@@ -72,6 +73,7 @@ mem_r_SOURCES = mem_r.l
 noansi_nr_SOURCES = noansi_nr.l
 noansi_r_SOURCES = noansi_r.l
 posix_SOURCES = posix.l
+posixly_correct_SOURCES = posixly_correct.l
 prefix_nr_SOURCES = prefix_nr.l
 prefix_r_SOURCES = prefix_r.l
 string_nr_SOURCES = string_nr.l
@@ -144,5 +146,8 @@ header_nr_scanner.h: header_nr_scanner.c
 header_r_main$(objext): header_r_scanner.h
 header_r_scanner.h: header_r_scanner.c
 
+posixly_correct.c: posixly_correct.l
+       POSIXLY_CORRECT=1 $(FLEX) -o $@ $<
+
 top_main$(objext): top.h
 top.h: top.c
similarity index 97%
rename from tests/test-posixly-correct/scanner.l
rename to tests/posixly_correct.l
index 20912dfd275272269945443f112e1c5a380a0a0b..7999fbfab174d3f8f4c1a93cb795addf590cca2d 100644 (file)
@@ -40,7 +40,7 @@ int tests_ok[NUM_TESTS] =  { 0 };
 
 %}
 
-%option 8bit outfile="scanner.c" prefix="test"
+%option 8bit prefix="test"
 %option nounput nomain noyywrap
 %option warn
 
diff --git a/tests/test-posixly-correct/.gitignore b/tests/test-posixly-correct/.gitignore
deleted file mode 100644 (file)
index d28d3cb..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Makefile
-Makefile.in
-parser.c
-parser.h
-scanner.c
-TEMPLATE
-OUTPUT
-.deps
-test-posixly-correct
diff --git a/tests/test-posixly-correct/Makefile.am b/tests/test-posixly-correct/Makefile.am
deleted file mode 100644 (file)
index 6821cf7..0000000
+++ /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
-CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS)
-OBJS = scanner.o 
-
-AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir)
-#LDFLAGS = $(top_srcdir)/libfl.a 
-#LFLAGS = --header="scanner.h"
-
-testname = test-posixly-correct
-
-scanner.c: $(srcdir)/scanner.l
-       POSIXLY_CORRECT=1 $(FLEX) $(LFLAGS) $<
-
-$(testname)$(EXEEXT): $(OBJS)
-       $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES)
-
-test: $(testname)$(EXEEXT)
-       ./$(testname)$(EXEEXT)
-
-.c.o:
-       $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<