From: Jim Meyering Date: Sat, 24 Mar 2018 16:48:47 +0000 (-0700) Subject: test-version-etc.sh: don't use diff directly: use init.sh's compare X-Git-Tag: v1.0~5690 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8326a2e524119decf07d07a072a6c15bebefef0e;p=gnulib.git test-version-etc.sh: don't use diff directly: use init.sh's compare We'd rather not sacrifice readable "diff -u" output even for "diff -c" output (not supported by busybox) or for even less readable ed-style "diff" output. So use init.sh's compare function * tests/test-version-etc.sh: Source init.sh and add "." to path. Remove "./" from invocation of test-version-etc, so we use path. And s/diff/compare/. * modules/version-etc-tests (Depends-on): Add test-framework-sh, to get init.sh. Prompted by Eric Blake's comments in https://lists.gnu.org/r/sed-devel/2018-03/msg00015.html --- diff --git a/ChangeLog b/ChangeLog index 02508d69a8..4b08908768 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2018-03-24 Jim Meyering + + test-version-etc.sh: don't use diff directly: use init.sh's compare + We'd rather not sacrifice readable "diff -u" output even for + "diff -c" output (not supported by busybox) or for even less + readable ed-style "diff" output. So use init.sh's compare function + * tests/test-version-etc.sh: Source init.sh and add "." to path. + Remove "./" from invocation of test-version-etc, so we use path. + And s/diff/compare/. + * modules/version-etc-tests (Depends-on): Add test-framework-sh, + to get init.sh. + Prompted by Eric Blake's comments in + https://lists.gnu.org/r/sed-devel/2018-03/msg00015.html + 2018-03-24 Bruno Haible javacomp-script, javacomp: Add support for Java 10. diff --git a/modules/version-etc-tests b/modules/version-etc-tests index d67bd22264..347da5e866 100644 --- a/modules/version-etc-tests +++ b/modules/version-etc-tests @@ -3,6 +3,7 @@ tests/test-version-etc.c tests/test-version-etc.sh Depends-on: +test-framework-sh version-etc-fsf Makefile.am: diff --git a/tests/test-version-etc.sh b/tests/test-version-etc.sh index 0b1f5be1fc..b796f3ee06 100755 --- a/tests/test-version-etc.sh +++ b/tests/test-version-etc.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +. "${srcdir=.}/init.sh"; path_prepend_ . + TMP=ve-expected.tmp LC_ALL=C export LC_ALL @@ -31,12 +33,12 @@ There is NO WARRANTY, to the extent permitted by law. Written by Sergey Poznyakoff and Eric Blake. EOT -./test-version-etc${EXEEXT} --version | +test-version-etc${EXEEXT} --version | sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/ /^Packaged by/d 2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' | tr -d '\015' | - diff $TMP - || ERR=1 + compare $TMP - || ERR=1 rm $TMP