m4-patches
[Top][All Lists]
Advanced

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

testsuite on mingw


From: Eric Blake
Subject: testsuite on mingw
Date: Mon, 04 Sep 2006 08:18:56 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When cross-compiling from cygwin to mingw, the testsuite is created by
cygwin with \n line endings, but executed by a mingw executable which
produces \r\n line endings.  I'm installing this to normalize mingw output
in the testsuite, so that it doesn't fail practically every test just
because of the line ending differences.

2006-09-04  Eric Blake  <address@hidden>

        * doc/m4.texinfo (Changeword): Skip test on mingw, where the
        native echo is braindead.
        * checks/check-them (strip_needed): Ignore \r in output.  Now the
        testsuite will pass when cross-compiling from cygwin to mingw.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/DXQ84KuGfSFAYARAu61AJ4/wVvZ+Kh65320ZfRzvLOs7kSqxACeP1Jh
oh0kmsMQT+tESUPvC0M5pUg=
=ZNpw
-----END PGP SIGNATURE-----
Index: checks/check-them
===================================================================
RCS file: /sources/m4/m4/checks/Attic/check-them,v
retrieving revision 1.1.1.1.2.11
diff -u -p -r1.1.1.1.2.11 check-them
--- checks/check-them   22 Aug 2006 19:56:09 -0000      1.1.1.1.2.11
+++ checks/check-them   4 Sep 2006 14:17:39 -0000
@@ -26,11 +26,22 @@ xout=$tmp/m4-xout
 xerr=$tmp/m4-xerr
 failed=
 skipped=
+strip_needed=false
 
 # Find out how the executable prints argv[0]
 m4=`m4 --help | sed -e 's/Usage: \(.*\) \[OPTION.*/\1/' \
     -e 's/\\\\/\\\\\\\\/g' -e 1q`
 
+# Find out if we should strip \r in the output
+m4 --version > $out
+m4 --version | tr -d '\015' > $xout
+if cmp -s $out $xout; then
+  :
+else
+  echo "Ignoring carriage returns"
+  strip_needed=:
+fi
+
 # Find out where the examples live.
 examples=.
 if test "x$1" = x-I ; then
@@ -57,6 +68,19 @@ do
 
   sed -e '/^dnl @result{}/!d' -e 's///' -e "s|\.\./examples|$examples|" \
     "$file" > $xout
+  sed -e '/^dnl @error{}/!d' -e 's///' -e "s|^m4:|$m4:|" "$file" > $xerr
+
+  # For the benefit of mingw, normalize \r\n line endings
+  if $strip_needed ; then
+    tr -d '\015' < $out > $out.t
+    mv $out.t $out
+    tr -d '\015' < $xout > $xout.t
+    mv $xout.t $xout
+    tr -d '\015' < $err > $err.t
+    mv $err.t $err
+    tr -d '\015' < $xerr > $xerr.t
+    mv $xerr.t $xerr
+  fi
 
   if cmp -s $out $xout; then
     :
@@ -67,8 +91,6 @@ do
     diff $xout $out
   fi
 
-  sed -e '/^dnl @error{}/!d' -e 's///' -e "s|^m4:|$m4:|" "$file" > $xerr
-
   if cmp -s $err $xerr; then
     :
   else
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.71
diff -u -p -r1.1.1.1.2.71 m4.texinfo
--- doc/m4.texinfo      4 Sep 2006 13:35:09 -0000       1.1.1.1.2.71
+++ doc/m4.texinfo      4 Sep 2006 14:17:40 -0000
@@ -2766,6 +2766,9 @@ the first of these is discarded before s
 @example
 ifdef(`changeword', `', `errprint(` skipping: no changeword support
 ')m4exit(`77')')dnl
+ifdef(`__unix__', ,
+      `errprint(` skipping: syscmd does not have unix semantics
+')m4exit(`77')')dnl
 changecom(`/*', `*/')dnl
 define(`foo', `bar')dnl
 changeword(`#\([_a-zA-Z0-9]*\)')

reply via email to

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