bug-texinfo
[Top][All Lists]
Advanced

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

diff wrapper for install-info tests


From: Gavin Smith
Subject: diff wrapper for install-info tests
Date: Sun, 23 Oct 2022 12:43:47 +0100

On Sun, Oct 23, 2022 at 12:30:23PM +0200, Bruno Haible wrote:
> Eli Zaretskii wrote:
> > > - nearly all of the 'ii-????-test' tests fail,
> > 
> > This could be due to Diff.  I have long ago replaced the MSYS Diff
> > with the following shell script (and gladly forgot about this issue):
> > 
> >   #! /bin/sh
> >   # diff --- like diff.exe but ignore trailing CR characters
> >   /bin/real_diff --strip-trailing-cr $*
> > 
> > where 'real_diff' is the original Diff program, renamed.
> 
> Indeed, the ii-0045-test for example failed because the actual output has
> lines ending in <CR><LF> not just <LF>.
> 

Could you try a change like the one at the end of this mail?

If that works, then we can make this change throughout the install-info
test suite.

The test for mingw may need tweaking to include/exclude MinGW, MSYS,
cygwin...

The --strip-trailing-cr option is specific to GNU diff (not in POSIX) but
it may be ok for mingw.


iff --git a/install-info/tests/defs.in b/install-info/tests/defs.in
index cf372ce4c2..c0d8df726e 100644
--- a/install-info/tests/defs.in
+++ b/install-info/tests/defs.in
@@ -72,6 +72,11 @@ else
   path_sep=":"
 fi
 
+diff=diff
+if uname | $EGREP -iv 'mingw' >/dev/null; then
+  diff='diff --strip-trailing-cr'
+fi
+
 # Return true if PROG is somewhere in PATH, else false.
 findprog ()
 {
diff --git a/install-info/tests/ii-0045-test b/install-info/tests/ii-0045-test
index 8c9d874d43..221f540f70 100755
--- a/install-info/tests/ii-0045-test
+++ b/install-info/tests/ii-0045-test
@@ -21,7 +21,7 @@ if [ "x$retval" != "x0" ]; then
   exit $retval
 fi
 
-diff ${testdir}/ii-0045-expected-dir-file $outputdirfile
+${diff} ${testdir}/ii-0045-expected-dir-file $outputdirfile
 retval=$?
 
 rm -f $outputdirfile




reply via email to

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