]> Savannah Git Hosting - gnulib.git/commitdiff
test-version-etc.sh: don't use diff directly: use init.sh's compare
authorJim Meyering <meyering@fb.com>
Sat, 24 Mar 2018 16:48:47 +0000 (09:48 -0700)
committerJim Meyering <meyering@fb.com>
Sat, 24 Mar 2018 17:15:09 +0000 (10:15 -0700)
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

ChangeLog
modules/version-etc-tests
tests/test-version-etc.sh

index 02508d69a8256bc785123c20451d381d15659fba..4b0890876841fa4e66f874b58fd6bd2fc7e9debd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2018-03-24  Jim Meyering  <meyering@fb.com>
+
+       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  <bruno@clisp.org>
 
        javacomp-script, javacomp: Add support for Java 10.
index d67bd22264bcc176aa45833985d0c4f5713d6b8b..347da5e866ba8ddde1020c0b905bea1632b733c4 100644 (file)
@@ -3,6 +3,7 @@ tests/test-version-etc.c
 tests/test-version-etc.sh
 
 Depends-on:
+test-framework-sh
 version-etc-fsf
 
 Makefile.am:
index 0b1f5be1fc68fdf38d4ed3c434764cd0f9ae8d9c..b796f3ee060510a7d28a1552d789f28c9f0775c9 100755 (executable)
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+. "${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