automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] New tests, for bugs in Yacc/Lex AM_FLAGS and FLAGS precedenc


From: Stefano Lattarini
Subject: [PATCH 1/2] New tests, for bugs in Yacc/Lex AM_FLAGS and FLAGS precedence.
Date: Sat, 1 May 2010 10:36:01 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; )

* tests/lflags.test: New test, check that user $(LFLAGS) takes
precedence over automake (AM_LFLAGS) and (foo_LFLAGS).  Still
xfailing.
* tests/lflags2.test: Likewise.
* tests/yflags.test: New test, check that user $(YFLAGS) takes
precedence over automake (AM_YFLAGS) and (foo_YFLAGS).  Still
xfailing.
* tests/yflags2.test: Likewise.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Extended accordingly.
---
From b887bc6e32ab5b770b7abdf8f7209cbcafe53579 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sat, 1 May 2010 01:54:56 +0200
Subject: [PATCH 1/2] New tests, for bugs in Yacc/Lex AM_FLAGS and FLAGS 
precedence.

* tests/lflags.test: New test, check that user $(LFLAGS) takes
precedence over automake (AM_LFLAGS) and (foo_LFLAGS).  Still
xfailing.
* tests/lflags2.test: Likewise.
* tests/yflags.test: New test, check that user $(YFLAGS) takes
precedence over automake (AM_YFLAGS) and (foo_YFLAGS).  Still
xfailing.
* tests/yflags2.test: Likewise.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Extended accordingly.
---
 ChangeLog          |   14 ++++++++++
 tests/Makefile.am  |   10 ++++++-
 tests/Makefile.in  |   10 ++++++-
 tests/lflags.test  |   70 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/lflags2.test |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/yflags.test  |   68 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/yflags2.test |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 310 insertions(+), 2 deletions(-)
 create mode 100755 tests/lflags.test
 create mode 100755 tests/lflags2.test
 create mode 100755 tests/yflags.test
 create mode 100755 tests/yflags2.test

diff --git a/ChangeLog b/ChangeLog
index 71b0d9b..762e9cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-05-01  Stefano Lattarini  <address@hidden>
+
+       New tests, exposing bugs in Automake Yacc/Lex support w.r.t.
+       $(AM_FLAGS) and $(FLAGS) precedence.
+       * tests/lflags.test: New test, check that user $(LFLAGS) takes
+       precedence over automake (AM_LFLAGS) and (foo_LFLAGS).  Still
+       xfailing.
+       * tests/lflags2.test: Likewise.
+       * tests/yflags.test: New test, check that user $(YFLAGS) takes
+       precedence over automake (AM_YFLAGS) and (foo_YFLAGS).  Still
+       xfailing.
+       * tests/yflags2.test: Likewise.
+       * tests/Makefile.am (TESTS, XFAIL_TESTS): Extended accordingly.
+
 2010-04-25  Ralf Wildenhues  <address@hidden>
 
        Warning and error message formatting cleanups.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cff34c5..ad40232 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -21,7 +21,11 @@ all.test                                     \
 auxdir2.test                                   \
 cond17.test                                    \
 gcj6.test                                      \
-txinfo5.test
+txinfo5.test                                   \
+lflags.test                                    \
+lflags2.test                                   \
+yflags.test                                    \
+yflags2.test
 
 include $(srcdir)/parallel-tests.am
 
@@ -403,6 +407,8 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lflags.test \
+lflags2.test \
 libexec.test \
 libobj2.test \
 libobj3.test \
@@ -779,6 +785,8 @@ yacc7.test \
 yacc8.test \
 yaccpp.test \
 yaccvpath.test \
+yflags.test \
+yflags2.test \
 $(parallel_tests)
 
 EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3ff9012..13d8a83 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -255,7 +255,11 @@ all.test                                   \
 auxdir2.test                                   \
 cond17.test                                    \
 gcj6.test                                      \
-txinfo5.test
+txinfo5.test                                   \
+lflags.test                                    \
+lflags2.test                                   \
+yflags.test                                    \
+yflags2.test
 
 parallel_tests = \
 check-p.test \
@@ -644,6 +648,8 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lflags.test \
+lflags2.test \
 libexec.test \
 libobj2.test \
 libobj3.test \
@@ -1020,6 +1026,8 @@ yacc7.test \
 yacc8.test \
 yaccpp.test \
 yaccvpath.test \
+yflags.test \
+yflags2.test \
 $(parallel_tests)
 
 EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
diff --git a/tests/lflags.test b/tests/lflags.test
new file mode 100755
index 0000000..5027f1c
--- /dev/null
+++ b/tests/lflags.test
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and
+# $(foo_LFLAGS).
+# Please keep this in sync with the sister tests lflags2.test, yflags.test
+# and yflags2.test
+
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-lex <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >lex.yy.c
+END
+chmod a+x fake-lex
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+# Simulate presence of Lex using our fake-lex script.
+AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex])
+AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
+AC_SUBST([LEXLIB], [''])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.c foo.l
+bar_SOURCES = main.c bar.l
+AM_LFLAGS = __am_flags__
+bar_LFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && Exit 1
+grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void){ return 0; }' > main.c
+: > foo.l
+: > bar.l
+
+$AUTOCONF
+./configure
+$MAKE LFLAGS=__user_flags__
+
+ls -l
+
+cat foo.c
+grep '__am_flags__.*__user_flags__' foo.c
+cat bar-bar.c
+grep '__bar_flags__.*__user_flags__' bar-bar.c
+
+:
diff --git a/tests/lflags2.test b/tests/lflags2.test
new file mode 100755
index 0000000..e50678e
--- /dev/null
+++ b/tests/lflags2.test
@@ -0,0 +1,71 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and
+# $(foo_LFLAGS).
+# Please keep this in sync with the sister tests lflags.test, yflags.test
+# and yflags2.test
+
+required=g++ # FIXME: any working C++ compiler should be OK
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-lex <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >lex.yy.c
+END
+chmod a+x fake-lex
+
+cat >> configure.in <<'END'
+AC_PROG_CXX
+# Simulate presence of Lex using our fake-lex script.
+AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex])
+AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
+AC_SUBST([LEXLIB], [''])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.cc foo.ll
+bar_SOURCES = main.cc bar.l++
+AM_LFLAGS = __am_flags__
+bar_LFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && Exit 1
+grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void) { return 0; }' > main.cc
+: > foo.ll
+: > bar.l++
+
+$AUTOCONF
+./configure
+$MAKE LFLAGS=__user_flags__
+
+ls -l
+
+cat foo.cc
+grep '__am_flags__.*__user_flags__' foo.cc
+cat bar-bar.c++
+grep '__bar_flags__.*__user_flags__' bar-bar.c++
+
+:
diff --git a/tests/yflags.test b/tests/yflags.test
new file mode 100755
index 0000000..d7d3fca
--- /dev/null
+++ b/tests/yflags.test
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and
+# $(foo_YFLAGS).
+# Please keep this in sync with the sister tests yflags2.test, lflags.test
+# and lflags2.test
+
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-yacc <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >y.tab.c
+END
+chmod a+x fake-yacc
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+# Simulate presence of Yacc using our fake-yacc script.
+AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.c foo.y
+bar_SOURCES = main.c bar.y
+AM_YFLAGS = __am_flags__
+bar_YFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && Exit 1
+grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void){ return 0; }' > main.c
+: > foo.y
+: > bar.y
+
+$AUTOCONF
+./configure
+$MAKE YFLAGS=__user_flags__
+
+ls -l
+
+cat foo.c
+grep '__am_flags__.*__user_flags__' foo.c
+cat bar-bar.c
+grep '__bar_flags__.*__user_flags__' bar-bar.c
+
+:
diff --git a/tests/yflags2.test b/tests/yflags2.test
new file mode 100755
index 0000000..5d5be1c
--- /dev/null
+++ b/tests/yflags2.test
@@ -0,0 +1,69 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and
+# $(foo_YFLAGS).
+# Please keep this in sync with the sister tests yflags.test, lflags.test
+# and lflags2.test
+
+required=g++ # FIXME: any working C++ compiler should be OK
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-yacc <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >y.tab.c
+END
+chmod a+x fake-yacc
+
+cat >> configure.in <<'END'
+AC_PROG_CXX
+# Simulate presence of Yacc using our fake-yacc script.
+AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.cc foo.yy
+bar_SOURCES = main.cc bar.y++
+AM_YFLAGS = __am_flags__
+bar_YFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && Exit 1
+grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void) { return 0; }' > main.cc
+: > foo.yy
+: > bar.y++
+
+$AUTOCONF
+./configure
+$MAKE YFLAGS=__user_flags__
+
+ls -l
+
+cat foo.cc
+grep '__am_flags__.*__user_flags__' foo.cc
+cat bar-bar.c++
+grep '__bar_flags__.*__user_flags__' bar-bar.c++
+
+:
-- 
1.6.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]