automake
[Top][All Lists]
Advanced

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

Re: problem with a test that is expected to fail, on cygwin only...


From: Ralf Wildenhues
Subject: Re: problem with a test that is expected to fail, on cygwin only...
Date: Thu, 18 Jan 2007 22:22:28 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Ed Hartnett wrote on Tue, Jan 16, 2007 at 03:17:00AM CET:
> 
> I am having a problem on cygwin only. 
> 
> I have a test which is expected to fail. In the Makefile.am I have
> this:
> 
> TESTFILES = nctst tst_failure
> check_PROGRAMS = $(TESTFILES)
> nctst_SOURCES = nctst.cpp
> tst_failure_SOURCES = tst_failure.cpp
> TESTS = $(TESTFILES) run_nc_tests.sh
> XFAIL_TESTS = tst_failure

OK to apply this patch to fix this issue?

Cheers,
Ralf

2007-01-18  Ralf Wildenhues  <address@hidden>

        * automake.in (handle_tests): Rewrite XFAIL_TESTS just like
        TESTS, appending $(EXEEXT), so that matching continues to work
        on w32.
        * NEWS: Mention this.
        * doc/automake.texi (EXEEXT, Extending): Update.
        * tests/check7.test: New test.
        * tests/Makefile.am: Adjust.
        Bug report by Ed Hartnett.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.323
diff -u -r1.323 NEWS
--- NEWS        10 Jan 2007 17:57:24 -0000      1.323
+++ NEWS        18 Jan 2007 21:16:44 -0000
@@ -15,6 +15,10 @@
   - install-sh supports -C, which does not update the installed file
     (and its time stamps) if the contents did not change.
 
+  - $(EXEEXT) is automatically appended to filenames of XFAIL_TESTS
+    that have been declared as programs in the same Makefile.
+    This is for consistency with the analogous change to TESTS in 1.10.
+
 
 New in 1.10:
 
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1641
diff -u -r1.1641 automake.in
--- automake.in 16 Oct 2006 05:24:17 -0000      1.1641
+++ automake.in 18 Jan 2007 21:16:49 -0000
@@ -4606,7 +4606,10 @@
       $output_rules .= &file_contents ('check', new Automake::Location);
 
       # Tests that are known programs should have $(EXEEXT) appended.
+      # For matching purposes, we need to adjust XFAIL_TESTS as well.
       append_exeext { exists $known_programs{$_[0]} } 'TESTS';
+      append_exeext { exists $known_programs{$_[0]} } 'XFAIL_TESTS'
+        if (var ('XFAIL_TESTS'));
     }
 }
 
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.162
diff -u -r1.162 automake.texi
--- doc/automake.texi   19 Dec 2006 23:52:55 -0000      1.162
+++ doc/automake.texi   18 Jan 2007 21:16:56 -0000
@@ -6572,10 +6572,10 @@
 The targets Automake generates are likewise given the @samp{$(EXEEXT)}
 extension.
 
-The variable @code{TESTS} (@pxref{Tests}) is also rewritten if it
-contains filenames that have been declared as programs in the same
address@hidden  (This is mostly useful when some programs from
address@hidden are listed in @code{TESTS}.)
+The variables @code{TESTS}, @code{XFAIL_TESTS} (@pxref{Tests}) are also
+rewritten if it contains filenames that have been declared as programs
+in the same @file{Makefile}.  (This is mostly useful when some programs
+from @code{check_PROGRAMS} are listed in @code{TESTS}.)
 
 However, Automake cannot apply this rewriting to @command{configure}
 substitutions.  This means that if you are conditionally building a
@@ -9055,9 +9055,9 @@
 @node Extending
 @section Extending Automake Rules
 
-With some minor exceptions (like @code{_PROGRAMS} variables being
-rewritten to append @samp{$(EXEEXT)}), the contents of a
address@hidden is copied to @file{Makefile.in} verbatim.
+With some minor exceptions (like @code{_PROGRAMS} variables, @code{TESTS},
+or @code{XFAIL_TESTS}) being rewritten to append @samp{$(EXEEXT)}), the
+contents of a @file{Makefile.am} is copied to @file{Makefile.in} verbatim.
 
 @cindex copying semantics
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.617
diff -u -r1.617 Makefile.am
--- tests/Makefile.am   16 Oct 2006 05:24:17 -0000      1.617
+++ tests/Makefile.am   18 Jan 2007 21:16:56 -0000
@@ -86,6 +86,7 @@
 check4.test \
 check5.test \
 check6.test \
+check7.test \
 checkall.test \
 clean.test \
 clean2.test \
--- /dev/null   2007-01-18 22:42:25.684343747 +0100
+++ tests/check7.test   2007-01-18 22:15:09.000000000 +0100
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Copyright (C) 2007  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Check EXEEXT extension for XFAIL_TESTS.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS = $(XFAIL_TESTS)
+XFAIL_TESTS = a b c d
+check_PROGRAMS = a c d
+check_SCRIPTS = b
+
+print-xfail-tests:
+       @echo BEG: $(XFAIL_TESTS) :END
+END
+
+cat >>b <<'END'
+#! /bin/sh
+exit 1
+END
+chmod a+x b
+
+cat >>a.c <<'END'
+#include <stdlib.h>
+int main() { return EXIT_FAILURE; }
+END
+
+cp a.c c.c
+cp a.c d.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE check
+EXEEXT=.bin $MAKE -e print-xfail-tests >foo
+cat foo
+grep 'BEG: a.bin b c.bin d.bin :END' foo
+
+$MAKE distclean
+mkdir build
+cd build
+../configure
+$MAKE check




reply via email to

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