m4-patches
[Top][All Lists]
Advanced

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

head - testsuite on cygwin


From: Eric Blake
Subject: head - testsuite on cygwin
Date: Wed, 5 Jul 2006 20:52:36 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

This patch allows ALL tests to pass on cygwin.  (Thanks, Gary, for fixing the 
erenamesym failure).  Previously, I was getting the following failures:

35-40 (--module-directory) - skipped.  The testsuite was looking for 
top_builddir, but Makefile was not exporting it to the environment.  Not to 
mention the fact that until autotest is patched, we are doing a cd before 
invoking the testsuite, which invalidates relative paths from make's 
perspective.

12 (gmp), 34 (freezing modules), 41-44 (modules:*) - failed.  On cygwin, 
libtool refuses to create .dlls unless -no-undefined was specified.  (Even 
after my patch, if you do ./configure --enable-debug, then no dynamic libraries 
are built and all loading tests fail.  We really should change --enable-debug 
to statically preload all modules, or make the testsuite able to skip tests 
that require dynamic loading; but that is for a later day).

31 (misc) - failed.  On a default cygwin installation, /etc/passwd does not 
contain a root user.  Not to mention that POSIX does not require the existence 
of /etc/passwd, so the test was too fragile.  However, it looked like the goal 
of the test was to test maketemp, so I just forward ported my maketemp test 
from branch-1_4.  And by putting it here instead of in an ugly @ignore section 
in m4.texinfo, I am avoiding the hack that I had to use in branch-1_4 to test 
something more complex than was worth documenting in the manual.

79 (esyscmd) - sporadic.  Once I patched dynamic loading, this started 
failing.  I traced it to the fact that the libtool wrapper for testing 
uninstalled m4 prepends to PATH, so the m4 invoked by esyscmd was my installed 
1.4.4c rather than the uninstalled m4 testsuite wrapper, which had a different 
author's line.  Besides, this example didn't do anything to contrast syscmd vs. 
esyscmd, so I just forward ported these two nodes from branch-1_4.

Now don't cheer too loudly - there are a number of tests still to be forward 
ported where branch-1_4 is sane but CVS head core-dumps or has other bad 
behavior.  But it is sure nice to do forward-porting with a clean slate, where 
the only failures are in newly added tests.  Plus, I fixed some minor 
annoyances with testnames appearing in [] because they were overquoted.

2006-07-05  Eric Blake  <address@hidden>

        Fix all testsuite failures on cygwin.
        * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
        branch-1_4.  Solves testsuite failure when uninstalled m4 is
        shadowed by redefinition of PATH in libtool wrapper.
        * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
        contains the -no-undefined required by cygwin.
        (TESTS_ENVIRONMENT): Export abs_top_builddir.
        * tests/others.at (misc): Port to platforms where /etc/passwd
        does not exist or does not contain user named root.
        * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
        directory.
        * tests/builtins.at (define, divert): Avoid overquoting.
        * tests/generate.awk (new_group): Likewise.

Index: Makefile.am
===================================================================
RCS file: /sources/m4/m4/Makefile.am,v
retrieving revision 1.36
diff -u -r1.36 Makefile.am
--- Makefile.am 4 Jul 2006 16:29:34 -0000       1.36
+++ Makefile.am 5 Jul 2006 20:49:59 -0000
@@ -126,7 +126,7 @@
 
 ETAGS_ARGS     = --regex='/M4BUILTIN_HANDLER[ \t]*)\([^)]*\)/\1/'
 
-module_ldflags = -module
+module_ldflags = -module $(AM_LDFLAGS)
 module_libadd  = m4/libm4.la
 
 pkgmodinclude_HEADERS = modules/m4.h
@@ -369,6 +369,7 @@
        CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
        LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" CONFIG_SHELL="$(SHELL)" \
+       abs_top_builddir="$(abs_top_builddir)" \
        CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
        F77="$(F77)" FFLAGS="$(FFLAGS)" \
        GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)"
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.22
diff -u -r1.22 m4.texinfo
--- doc/m4.texinfo      7 Jul 2005 11:14:21 -0000       1.22
+++ doc/m4.texinfo      5 Jul 2006 20:50:00 -0000
@@ -22,8 +22,8 @@
 @ifinfo
 This file documents GNU @code{m4} @value{VERSION}
 
-Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2001, 
2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000,
+2001, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1
@@ -49,7 +49,8 @@
 
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 
2001, 2004, 2005 Free Software Foundation, Inc.
+Copyright @copyright{} 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999,
+2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1
@@ -3489,6 +3490,19 @@
 The builtin macro @code{syscmd} is recognized only when given arguments.
 @end deffn
 
address@hidden
+define(`foo', `FOO')
address@hidden
+syscmd(`echo foo')
address@hidden
address@hidden
address@hidden example
+
+Note how the expansion of @code{syscmd} keeps the trailing newline of
+the command, as well as using the newline that appeared after the macro.
+
+The builtin macro @code{syscmd} is recognized only when given arguments.
+
 @node Esyscmd
 @section Reading the output of commands
 
@@ -3504,21 +3518,21 @@
 is not a part of the expansion: it will appear along with the error
 output of @code{m4}.
 
-The builtin macro @code{esyscmd} is recognized only when given
-arguments.
address@hidden deffn
-
-For instance:
 
 @example
-define(`authors', `esyscmd(`m4 --version | grep Written')')
+define(`foo', `FOO')
 @result{}
-authors
address@hidden by Rene' Seindal and Gary V. Vaughan.
+esyscmd(`echo foo')
address@hidden
 @result{}
 @end example
 
-Note how the expansion of @code{esyscmd} has a trailing newline.
+Note how the expansion of @code{esyscmd} keeps the trailing newline of
+the command, as well as using the newline that appeared after the macro.
+
+The builtin macro @code{esyscmd} is recognized only when given
+arguments.
address@hidden deffn
 
 @node Sysval
 @section Exit codes
Index: tests/builtins.at
===================================================================
RCS file: /sources/m4/m4/tests/builtins.at,v
retrieving revision 1.9
diff -u -r1.9 builtins.at
--- tests/builtins.at   1 May 2005 11:10:06 -0000       1.9
+++ tests/builtins.at   5 Jul 2006 20:50:00 -0000
@@ -1,5 +1,5 @@
 # Hand crafted tests for GNU M4.                               -*- Autotest -*-
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2006 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
@@ -23,7 +23,7 @@
 ## define ##
 ## ------ ##
 
-AT_SETUP([[define]])
+AT_SETUP([define])
 
 AT_DATA([[define.m4]],
 [[undefine(`macro')dnl
@@ -61,7 +61,7 @@
 ## divert ##
 ## ------ ##
 
-AT_SETUP([[divert]])
+AT_SETUP([divert])
 
 AT_DATA([[divert.m4]],
 [[divert(1)Text diverted a first time.
Index: tests/generate.awk
===================================================================
RCS file: /sources/m4/m4/tests/generate.awk,v
retrieving revision 1.11
diff -u -r1.11 generate.awk
--- tests/generate.awk  8 May 2005 00:37:44 -0000       1.11
+++ tests/generate.awk  5 Jul 2006 20:50:00 -0000
@@ -1,7 +1,7 @@
 # Extract all examples from the manual source.            -*- AWK -*-
 
 # This file is part of GNU M4
-# Copyright 1992, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1992, 2000, 2001, 2006 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
@@ -65,9 +65,9 @@
   if ($0 ~ /address@hidden/)
     {
       if (seq == 0)
-        new_group(node);
+       new_group(node);
       if (!file)
-        seq++;
+       seq++;
       printf ("# %s:%d\n", FILENAME, NR)
       next;
     }
@@ -75,21 +75,21 @@
   if ($0 ~ /address@hidden example$/)
     {
       if (file != "")
-        {
-           if (output || error)
-             {
-               fatal("while getting file " file      \
+       {
+          if (output || error)
+            {
+              fatal("while getting file " file      \
                     " found output = " output ","  \
                     " found error = " error);
-             }
-           input = normalize(input);
-           printf ("AT_DATA([[%s]],\n[[%s]])\n\n", file, input);
-        }
+            }
+          input = normalize(input);
+          printf ("AT_DATA([[%s]],\n[[%s]])\n\n", file, input);
+       }
       else
-        {
-           new_test(input, status, output, error);
-           status = 0;
-        }
+       {
+          new_test(input, status, output, error);
+          status = 0;
+       }
       file = input = output = error = "";
       next;
     }
@@ -143,7 +143,7 @@
   printf ("## %s.  ##\n", node);
   printf ("## %s ##\n", banner);
   printf ("\n");
-  printf ("AT_SETUP([[%s]])\n", node);
+  printf ("AT_SETUP([%s])\n", node);
   printf ("AT_KEYWORDS([[documentation]])\n\n");
 }
 
Index: tests/modules.at
===================================================================
RCS file: /sources/m4/m4/tests/modules.at,v
retrieving revision 1.12
diff -u -r1.12 modules.at
--- tests/modules.at    1 May 2005 11:10:06 -0000       1.12
+++ tests/modules.at    5 Jul 2006 20:50:00 -0000
@@ -1,5 +1,5 @@
 # Hand crafted tests for GNU M4.                               -*- Autotest -*-
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2006 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
@@ -77,7 +77,7 @@
 [AT_SETUP([$1])
 AT_KEYWORDS([module])
 
-AT_CHECK([test -f $top_builddir/modules/modtest.la || exit 77])
+AT_CHECK([test -f "$abs_top_builddir/modules/modtest.la" || exit 77])
 
 AT_DATA([input.m4],
 [[load(`modtest')
Index: tests/others.at
===================================================================
RCS file: /sources/m4/m4/tests/others.at,v
retrieving revision 1.16
diff -u -r1.16 others.at
--- tests/others.at     1 May 2005 11:10:06 -0000       1.16
+++ tests/others.at     5 Jul 2006 20:50:00 -0000
@@ -1,5 +1,5 @@
 # Hand crafted tests for GNU M4.                               -*- Autotest -*-
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2006 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
@@ -293,20 +293,20 @@
 AT_SETUP([misc])
 
 [cat >expout <<EOF
+different
 
-`sed -n '/^root:/{ s/^root:[^:]*://;s/:.*$//;p;q;}' /etc/passwd`
-
+0
 EOF]
 
 AT_DATA([[misc.m4]],
-[[divert(-1)
-define(`USER', `root')
-define(`TMP', maketemp(`/tmp/hejXXXXXX'))
-syscmd(`grep "^'USER`:" /etc/passwd | awk -F: "{print \$3}"'  > TMP)
-define(`UID', include(TMP))
-syscmd(`rm -f' TMP)
-divert
-UID
+[[dnl This test assumes /tmp is a valid directory name, which is not true
+dnl for native Windows.
+ifdef(`__unix__', , `m4exit(`77')')dnl
+define(`file1', maketemp(`/tmp/m4-fooXXXXXX'))dnl
+define(`file2', maketemp(`/tmp/m4-fooXXXXXX'))dnl
+ifelse(file1, file2, `same', `different')
+syscmd(`rm 'file1 file2)
+sysval
 ]])
 
 AT_CHECK_M4([misc.m4], 0, expout)






reply via email to

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