1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-16 01:22:18 +03:00
Commit Graph

78 Commits

Author SHA1 Message Date
Paul Eggert
a3fd683de3 version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
2017-01-01 02:59:23 +00:00
Bruno Haible
3044ae7f43 init.sh: Add possibility to not delete temporary files.
* tests/init.sh (remove_tmp_): If the environment variable KEEP is set
to yes, don't erase the temporary directory.
2016-12-16 19:21:23 +01:00
Paul Eggert
fce9b3f0e2 tests/init.sh: port Alpine fix to AIX 7.1
* tests/init.sh (compare_): When attempting to use diff -U3,
prefer diff -u to -U3 to -c to plain diff.  Do not insist on
2016-09-24 20:17:14 -07:00
Jim Meyering
42354a8ce8 tests/init.sh: exclude dash with bad "local" semantics
* tests/init.sh (gl_shell_test_script_): Add a function to
eliminate a shell like "dash" (unlike bash, zsh) that has
surprising/risky "local var='...'" semantics.  Inspired by
the problem and discussion in https://bugs.gnu.org/24116#11.
2016-08-08 08:20:08 -07:00
Paul Eggert
e91c0d4f94 test-framework-sh: minor cleanups
* tests/init.sh (testdir_prefix_): Output a trailing newline,
since strictly speaking POSIX requires this.
(setup_): Do not use the variable 'fail', as that makes the
trace output harder to read ('fail' is typically used by
tests to mean the test failed).  Treat // portably.
Check that new directory is not merely a sibling of the tmp dir.
Avoid unnecessary invocation of tr.
2016-03-25 12:26:03 -07:00
Paul Eggert
4515da0d71 test-framework-sh: revert port to NetBSD 7.0
It was a false alarm; I misinterpreted Assaf Gordon's report.
* tests/init.sh (testdir_prefix_, pfx_, template_length_):
Restore.
(test_dir_): Adjust to mktempd_ change.
(mktempd_): Restore 2nd arg.  Use -t again.
(base_template_, template_, nx_): Resurrect old code.
2016-03-25 12:26:03 -07:00
Paul Eggert
7347cbf5a4 Port better to Alpine Linux
Its diff implementation does not support -c, but does support -U3.
Problem reported by Assaf Gordon in: http://bugs.gnu.org/23107#13
* tests/init.sh (diff_opt_): New var.
(compare_): Prefer diff -U3 to diff -c to plain diff.
2016-03-25 00:20:37 -07:00
Paul Eggert
d240000283 test-framework-sh: port to NetBSD 7.0
Problem reported by Assaf Gordon in: http://bugs.gnu.org/23107#13
* tests/init.sh (testdir_prefix_, pfx_, template_length_):
Remove.  All uses removed.
(test_dir_): Adjust to mktempd_ change.
(mktempd_): Omit 2nd arg.  Stop using -t, as it is not portable.
(base_template_, template_, nx_): Simplify by hardcoding.
2016-03-25 00:20:37 -07:00
Pádraig Brady
9b3899a94d tests: for compare_(), use cmp -s where available
* tests/init.sh (compare_): Only fall back to cmp without
the POSIX defined -s option, where this is not available.
2016-01-01 14:06:29 +00:00
Paul Eggert
71090a2a31 version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
2016-01-01 00:57:21 -08:00
Pádraig Brady
d03962a999 tests: restrict shells to those that support 'local'
The local keyword is very widely supported and used
in tests in coreutils and grep at least.  Therefore
restrict to testing with shells that support it.
This mainly excludes /bin/sh on Solaris.
Note standard ksh also doesn't support this keyword,
but that wasn't in the list of considered shells anyway.
For discussion on adding 'local' to POSIX, see:
http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/122267/focus=3271

* tests/init.sh (gl_shell_test_script_): Add a test for 'local'.
2015-07-03 15:29:30 +01:00
Pádraig Brady
0d3024546a tests: support stderr verification with returns_()
* tests/init.sh (returns_): Disable tracing for this wrapper
function, so that stderr of the wrapped command is unchanged,
allowing for verification of the contents.
2015-02-24 17:38:01 +00:00
Pádraig Brady
c61e31c4e5 tests: provide returns_() to simplify exit status checking
* tests/init.sh (returns_): A new function for use in tests,
to allow for easier checking of return values, where you expect
a command to exit with failure status.  By checking for a particular
exit code, you don't hide any crashes for example.
2015-02-11 00:20:34 +00:00
Paul Eggert
b9bfe78424 version-etc: new year
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
2014-12-31 17:47:54 -08:00
Paul Eggert
efc854066a tests: fix export bug in previous patch
Problem reported by Jim Meyering.
* tests/init.sh (re_shell): New var, which is exported instead of
re_shell_.
2014-01-07 21:43:31 -08:00
Paul Eggert
490acbe0bb tests: simplify porting to Solaris 10 /bin/sh
Some test cases in 'grep' need a shell that groks '$(';
export re_shell_ for their benefit.  Problem reported for 'grep'
by Dagobert Michelsen in <http://bugs.gnu.org/16380>.
* tests/init.sh (re_shell_): Export if it's used.
2014-01-07 11:46:59 -08:00
Eric Blake
1276a2c5f2 maint: update copyright
I ran 'make update-copyright'.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-01-01 00:07:10 -07:00
Eric Blake
9fc81090f6 maint: update all copyright year number ranges
Run "make update-copyright".  Compare to commit 1602f0a from last year.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-01-01 00:50:58 +00:00
Paul Eggert
c8485c4160 init.sh: do not rely on autoupated PWD
This addresses symptoms of the problem reported by Nelson H.F. Beebe in
<http://lists.gnu.org/archive/html/bug-gzip/2012-06/msg00008.html>.
Although Nelson's bug was not necessarily fixed by this patch,
it seems wise to make the change for safety.
* tests/init.sh (path_prepend_): Do not rely on PWD updating
automagically after 'cd'; this is not reliable on older shells.
(setup_): Fail if we cannot cd to temporary directory.
2012-06-20 07:08:43 -07:00
Jim Meyering
a3a049672d init.sh: explain why $EXEEXT support uses aliases rather than functions
* tests/init.sh: Add a comment.
2012-05-08 14:56:49 +02:00
Jim Meyering
a396e72968 init.sh: don't let bash aliases interfere with tests
* tests/init.sh: Undefine any pre-defined aliases if the selected shell
is bash.  This avoids problems for those who alias standard commands to
non-conforming uses, like those reported in http://bugs.gnu.org/11256.
Suggested by Tim Mooney <Tim.Mooney@ndsu.edu>.
2012-05-08 11:03:02 +02:00
Bruno Haible
8feea9a035 test-framework-sh: Fix test failure with AIX 7.1 diff.
* tests/init.sh (compare_): Don't use 'diff -u' if it inserts a space
in column 1, like 'diff -c' does.
* tests/test-init.sh (test_compare): Don't repeat the test from init.sh
whether 'diff -u' is used. Instead, test whether the output contains
some '@' character.
2012-01-28 23:31:18 +01:00
Paul Eggert
51e801f2f2 In commentary, do not use ` to quote. 2012-01-05 23:55:42 -08:00
Jim Meyering
b301fd3cf0 init.sh: don't waste a subshell just to redirect stderr
* tests/init.sh: In testing for diff -u and diff -c, use a
stderr-redirecting exec inside `...` rather than a subshell.
2012-01-05 17:47:28 +01:00
Jim Meyering
464f9e7b25 init.sh: do not try to accommodate compare arguments starting with "-"
* tests/init.sh (compare_dev_null_): Do not try to accommodate
compare arguments that start with "-".  Besides, we do not worry
about this when invoking diff or cmp; why start now with sed?
Using "--" to separate options from argument would trigger sed
failure in at least Solaris 7, HP-UX 11.00, IRIX 6.5, FreeBSD 6.4,
OpenBSD 4.9 and NetBSD 5.1.  Reported by Bruno Haible.
2012-01-03 08:23:43 +01:00
Jim Meyering
1602f0afed maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:04:58 +01:00
Jim Meyering
e1d1c41e3a init.sh: do not emit simulated diff output to stderr
* tests/init.sh (compare_dev_null_): Print to stdout, not stderr.
2011-12-23 10:47:18 +01:00
Jim Meyering
aa9f1d0904 init.sh: correct previous change
* tests/init.sh (compare): My previous change was wrong.
Don't clobber "$?".  Spotted by Stefano Lattarini and Pádraig Brady.
2011-12-22 13:12:19 +01:00
Jim Meyering
ed2ad64168 init.sh: avoid unwarranted test failure when using "set -x"
* tests/init.sh (compare): Ignore nonzero exit from compare_dev_null_.
Otherwise, in a test script that uses "set -x" (like many in vc-dwim)
a use like "compare exp out" would get evoke an unconditional failure.
2011-12-22 12:42:32 +01:00
Bruno Haible
c69114d482 tests: Avoid spurious error message on platforms without mktemp program.
* tests/init.sh (mktempd_): Run mktemp in a subcommand.
2011-12-05 02:58:55 +01:00
Jim Meyering
337977d216 init.sh: make "compare /dev/null FILE" output more readable
* tests/init.sh (compare_): Document the preferred order of arguments.
(emit_diff_u_header_): New function.
(compare_dev_null_): Emit a simulated diff, rather than just the
contents of the unexpected file.  Suggestion from Bruno Haible.
2011-11-22 20:24:22 +01:00
Jim Meyering
ff549c0784 init.sh: work around OSF/1 5.1's mishandling of /dev/null
* tests/init.sh: Make our compare function slightly more portable.
Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020
Much improved by Eric Blake.
2011-11-22 08:46:20 +01:00
Bruno Haible
fb6de052ba Silence successful tests that use 'compare' on AIX, HP-UX, Solaris.
* tests/init.sh (compare): Remove "No differences encountered" or
synonymous output from the 'diff' program.
2011-11-13 21:21:34 +01:00
Jim Meyering
8ee9e6df09 tests: use printf, not echo in init.sh's warn_ function
* tests/init.sh (warn_): Use printf, not echo.  The latter would
misbehave when given strings containing a backslash or starting
with e.g., -n.  James Youngman suggested setting IFS.
2011-09-19 19:29:55 +02:00
Bruno Haible
8b36fb12c3 tests: init.sh: Support any non-GNU diff.
* tests/init.sh (compare): If "diff -c" is supported but "diff -u" is
not, use "diff -c". Useful on AIX 6.1, HP-UX 11.31, OSF/1 5.1,
Solaris 8.
2011-09-02 18:27:55 +02:00
Bruno Haible
641823b464 tests: init.sh: work also with any non-GNU diff that supports -u
* tests/init.sh: Relax check for diff -u support.
Rather than checking for GNU diff via --version, simply check
for support for -u itself.  Useful at least on OpenBSD 4.9,
AIX 7.1, IRIX 6.5 and Solaris 10.
2011-09-02 15:17:09 +02:00
Jim Meyering
4af5eabfc0 init.sh: give more portable redirection-related advice in a comment
* tests/init.sh (stderr_fileno_): Update the advice in comments.
See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488
for lots of discussion.  Stefano Lattarini suggested the solution
of putting "9>&2" after the command.  Reported by Bruno Haible.
2011-06-14 15:40:43 +02:00
Stefano Lattarini
fba324553f tests: fix usage message in 'mktempd_'
* tests/init.sh (mktempd_): In the usage message, use literal
'mktempd_', not '$ME' (which is even undefined), as the name of
the subroutine.
2011-06-07 15:08:41 +02:00
Stefano Lattarini
b0579989e5 tests init: new function 'fatal_', for hard errors
Before this patch, the only way offered by tests/init.sh to
properly signal a hard error was the `framework_failure_'
function.  But the error message issued by that function,
as its name would suggest, refers to a set-up failure in the
testsuite, while hard errors can obviously also be due to
other reasons.  The best way to fix this inconsistency is to
introduce a new function with a more general error message.

* tests/init.sh (fatal_): New function.
2011-06-07 15:08:02 +02:00
Eric Blake
866bbaee7b tests: fix logic bug in init.sh
If the shell test loop first finds a marginal then a good shell, the
variable $gl_set_x_corrupts_stderr is still set to true and needlessly
drops $VERBOSE logging.

* tests/init.sh: (gl_set_x_corrupts_stderr_): Clear for successful
shell.

Signed-off-by: Eric Blake <eblake@redhat.com>
2011-05-24 11:05:24 -06:00
Pádraig Brady
76187a084b test-malloca: unset MALLOC_PERTURB_ to speed up test
* tests/test-malloca.c (main): Unset the environment variable
to greatly speed up the test.
* tests/init.sh: Don't say that MALLOC_PERTURB_ is cheap.
* modules/malloca-tests: Depend on unsetenv.
2011-01-21 11:40:16 +00:00
Jim Meyering
9f3a5624da init.sh: insert space between each function name and "()"
* tests/init.sh: Make it a little easier to see that a function's
name is "warn_", and not "warn" when looking at the first part of
its definition: "warn_ ()".  Suggested by Ralf Wildenhues.
2011-01-20 16:53:15 +01:00
Jim Meyering
d60f3b0c6b maint: update almost all copyright ranges to include 2011
Run the new "make update-copyright" rule.
2011-01-01 22:12:59 +01:00
Eric Blake
9dd43194a6 tests: avoid failing coreutils tests on cygwin
* tests/init.sh (find_exe_basenames_): Exempt [.exe.
(create_exe_shims_): Return 0 when skipping.

Signed-off-by: Eric Blake <eblake@redhat.com>
2010-12-31 09:44:58 -07:00
Paul Eggert
97de142d1c tests: minor indenting change
* tests/init.sh: Sync from coreutils housekeeping patch
<http://lists.gnu.org/archive/html/coreutils/2010-12/msg00116.html>
to keep lines within 80 columns.
2010-12-28 15:59:06 -08:00
Paul Eggert
15a8eaf23e tests: set fail=0 at start
* tests/init.sh (setup_): Move fail=0 initialization here ...
(mktempd_): ... from here, so that tests can rely on fail being
set to 0 initially.  This fixes a problem in coreutils; see:
http://lists.gnu.org/archive/html/coreutils/2010-12/msg00083.html
2010-12-18 19:55:00 -08:00
Jim Meyering
6383a3bbe1 init.sh: ensure that IFS is defined, just in case...
* tests/init.sh (setup_): Ensure that IFS is defined,
so that saving and restoring it works as expected.  This
appears to be useful at least for an old version of dash
from a long time ago (RH 6).  See here for details:
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/436/focus=455
2010-11-13 10:51:06 +01:00
Jim Meyering
441c6ed3f5 init.sh: correct an outdated comment
* tests/init.sh (create_exe_shims_):  s/function/alias/
2010-09-18 08:49:55 +02:00
Jim Meyering
ded759c279 init.sh: don't let an ephemeral "*.exe" make us skip all dir entries
Not that it's likely to happen, but if I were to remove from a PATH
directory a file named "*.exe" (yes, starting with an asterisk),
at just the right moment, it would have made init.sh ignore all
remaining .exe-suffixed names in that directory.

* tests/init.sh (find_exe_basenames_): Don't give up on a directory if
a file named "*.exe" is removed between the glob expansion and the
processing of that oddly named file.
2010-09-18 08:48:01 +02:00
Eric Blake
6bb1327e10 init.sh: accomodate directory with no .exes
Cygwin was failing test-vc-list-files-{cvs,git}.sh, because of
spurious output on stderr.

../../tests/test-vc-list-files-cvs.sh (exe_shim): skipping directory: /home/eblake/m4-branch/build-aux

All because build-aux was a directory containing just scripts, and
no .exe extensions.  This fixes it.

* tests/init.sh: Accomodate directory containing only scripts.

Signed-off-by: Eric Blake <eblake@redhat.com>
2010-09-17 15:32:09 -06:00