4 Commits

Author SHA1 Message Date
Jim Meyering
31b43733d4 tests: use "compare exp out", not "compare out exp"
Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name.  Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154

Run these commands:

  git grep -l -E 'compare [^ ]+ exp' \
    |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
  git grep -l -E 'compare [^ ]+ /dev/null' \
    |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'

But manually convert this one:

  -compare out exp-$(echo $opt|tr ' ' _)
  +compare exp-$(echo $opt|tr ' ' _) out

and avoid an inappropriate change to cfg.mk.
2011-11-29 17:17:10 +01:00
Stefano Lattarini
366adeb73d tests: make test runner a script, not a shell function
All the test scripts in the diffutils testsuite are shell scripts,
so the current definition of TESTS_ENVIRONMENT, which adaptively
run tests using either perl or the shell depending on their kind,
is an overkill.

Moreover, this change is required in order for the testsuite to
continue to work with the new testsuite harness that is planned
to be introduced in Automake 1.12 (which, as of the writing date,
is still under development and in late alpha state).

See also related discussion on bug-coreutils:
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>

* tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the
`shell_or_perl_' shell function, which is not required anymore.
(LOG_COMPILER): New, define to `$(SHELL)'.
* tests/binary: Make executable.
* tests/colliding-file-names: Likewise.
* tests/excess-slash: Likewise.
* tests/no-newline-at-eof: Likewise.
2011-10-11 16:40:12 +02:00
Jim Meyering
361b3b13da maint: adjust init.sh use to conform
* tests/help-version: Use one line: "${srcdir=.}/init.sh"; ...
* tests/basic: Likewise.
* tests/binary: Likewise.
* tests/colliding-file-names: Likewise.
* tests/excess-slash: Likewise.
* tests/function-line-vs-leading-space: Likewise.
* tests/help-version: Likewise.
* tests/label-vs-func: Likewise.
* tests/no-newline-at-eof: Likewise.
* tests/stdin: Likewise.
2010-09-04 09:15:32 +02:00
Jim Meyering
53de393ca3 diff -r: avoid printing excess slashes in concatenated file names
* bootstrap.conf (gnulib_modules): Add filenamecat.
* src/diff.c: Include "filenamecat.h".
(compare_files): Use file_name_concat, rather than dir_file_pathname.
* src/util.c (dir_file_pathname): Remove now-unused function.
* src/diff.h: Remove its declaration.
* tests/excess-slash: New script to test for this.
* tests/Makefile.am (TESTS): Add it.
Forwarded by Santiago Vila from <bugs.debian.org/586301a>,
reported by Jari Aalto.
2010-08-14 17:15:57 -05:00