From: Akim Demaille Date: Fri, 18 Feb 2000 10:01:25 +0000 (+0000) Subject: * tests/atgeneral.m4 (at_diff): Don't use `cmp -s', on DOS it X-Git-Tag: autoconf-2.50~1131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a315556948bdce48f0449dd4ac8a36b2cf8fdbc;p=thirdparty%2Fautoconf.git * tests/atgeneral.m4 (at_diff): Don't use `cmp -s', on DOS it makes the difference between Unix and DOS EOL. `diff' does not. Reported by Eli Zaretski. Also, be ready to use a diff that does not support `-u'. --- diff --git a/ChangeLog b/ChangeLog index 56d613e4b..83f96c8fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-02-18 Akim Demaille + + * tests/atgeneral.m4 (at_diff): Don't use `cmp -s', on DOS it + makes the difference between Unix and DOS EOL. `diff' does not. + Reported by Eli Zaretski. + Also, be ready to use a diff that does not support `-u'. + 2000-02-18 Akim Demaille * tests/tools.m4 (Syntax of the scripts): Be robust to shells that diff --git a/THANKS b/THANKS index 402641751..6c4ee42bb 100644 --- a/THANKS +++ b/THANKS @@ -15,6 +15,7 @@ Christian Krone krischan@sql.de Dave Adams adams@hpesdwa.fc.hp.com Didier Verna verna@inf.enst.fr Doug Evans dje@canuck.cygnus.com +Eli Zaretskii eliz@gnu.org Erez Zadok ezk@cs.columbia.edu Eric Mumpower nocturne@mit.edu Felix Lee flee@cygnus.com diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index e828a2973..ce6c6cf15 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -131,17 +131,24 @@ while test [$][#] -gt 0; do esac done -# In the testing suite, we only want to know if the test succeeded or failed. -# But in debugging scripts, we want more information, so we prefer `diff -u' -# to the silent `cmp', even if it may happen that we compare binary files. -# Option `-u' might be less portable, so either change it or use GNU `diff'. -if test -n "$at_verbose"; then +# To check whether a test succeeded or not, we compare an expected +# output with a reference. In the testing suite, we just need `cmp' +# but in debugging scripts, we want more information, so we prefer +# `diff -u'. Nonetheless we will use `diff' only, because in DOS +# environments, `diff' considers that two files are equal included +# when there are only differences on the coding of new lines. `cmp' +# does not. +# Finally, not all the `diff' support `-u'. + +if diff -u /dev/null /dev/null >/dev/null 2>&1; then at_diff='diff -u' else - at_diff='cmp -s' + at_diff='diff' fi + + # Each generated debugging script, containing a single test group, cleans # up files at the beginning only, not at the end. This is so we can repeat # the script many times and browse left over files. To cope with such left diff --git a/tests/atgeneral.m4 b/tests/atgeneral.m4 index e828a2973..ce6c6cf15 100644 --- a/tests/atgeneral.m4 +++ b/tests/atgeneral.m4 @@ -131,17 +131,24 @@ while test [$][#] -gt 0; do esac done -# In the testing suite, we only want to know if the test succeeded or failed. -# But in debugging scripts, we want more information, so we prefer `diff -u' -# to the silent `cmp', even if it may happen that we compare binary files. -# Option `-u' might be less portable, so either change it or use GNU `diff'. -if test -n "$at_verbose"; then +# To check whether a test succeeded or not, we compare an expected +# output with a reference. In the testing suite, we just need `cmp' +# but in debugging scripts, we want more information, so we prefer +# `diff -u'. Nonetheless we will use `diff' only, because in DOS +# environments, `diff' considers that two files are equal included +# when there are only differences on the coding of new lines. `cmp' +# does not. +# Finally, not all the `diff' support `-u'. + +if diff -u /dev/null /dev/null >/dev/null 2>&1; then at_diff='diff -u' else - at_diff='cmp -s' + at_diff='diff' fi + + # Each generated debugging script, containing a single test group, cleans # up files at the beginning only, not at the end. This is so we can repeat # the script many times and browse left over files. To cope with such left