summaryrefslogtreecommitdiff
path: root/tests/init.sh
Commit message (Collapse)AuthorAgeFilesLines
* test-framework-sh: work around AIX 7.2 diff bugsPaul Eggert2023-01-141-3/+4
| | | | | | | * tests/init.sh (compare_dev_null_): Run diff in the C locale. AIX 7.2 diff messes up in UTF-8 locales; for example, ‘printf '\360\220\200\200\n' | diff - /dev/null’ incorrectly outputs nothing and exits with status 0 when LC_ALL=en_US.UTF-8.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* In 'trap' commands, prefer symbolic to numeric signal names.Bruno Haible2022-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Mike Fulton <fultonm@ca.ibm.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-11/msg00130.html>. * gnulib-tool: Use symbolic signal names. * posix-modules: Likewise. * MODULES.html.sh: Likewise. * build-aux/bootstrap (prepare_GNULIB_SRCDIR): Likewise. * build-aux/csharpcomp.sh.in: Likewise. * build-aux/gnu-web-doc-update: Likewise. * top/autogen.sh: Likewise. * top/bootstrap-funclib.sh: Likewise. * top/gitsub.sh: Likewise. * lib/t-idcache: Likewise. * tests/havelib/rpath-1: Likewise. * tests/havelib/rpath-2_a: Likewise. * tests/havelib/rpath-2_b: Likewise. * tests/havelib/rpath-3_a: Likewise. * tests/havelib/rpath-3_b: Likewise. * tests/init.sh: Likewise. * tests/test-binary-io.sh: Likewise. * tests/test-c-stack.sh: Likewise. * tests/test-c-stack2.sh: Likewise. * tests/test-dprintf-posix.sh: Likewise. * tests/test-fpending.sh: Likewise. * tests/test-fprintf-posix.sh: Likewise. * tests/test-lseek.sh: Likewise. * tests/test-printf-posix.sh: Likewise. * tests/test-select-in.sh: Likewise. * tests/test-select-out.sh: Likewise. * tests/test-sigpipe.sh: Likewise. * tests/test-tsearch.sh: Likewise. * tests/test-update-copyright.sh: Likewise. * tests/test-vdprintf-posix.sh: Likewise. * tests/test-vfprintf-posix.sh: Likewise. * tests/test-vprintf-posix.sh: Likewise. * tests/test-xprintf-posix.sh: Likewise. * tests/uniwidth/test-uc_width2.sh: Likewise.
* init.sh: don’t assume gzipPaul Eggert2022-04-041-19/+24
| | | | | | | | | * tests/init.sh (rand_bytes_): Don’t assume gzip is installed. I found this while testing gzip installation on a platform where I had removed the installed gzip. gzip is executed only on platforms lacking mktemp and /dev/urandom so this code is rarely used; however, these platforms might also lack gzip since gzip is neither specified by POSIX or required by the GNU Coding Standards.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* test-framework-sh: remove unsafe entries from PATHBernhard Voelker2021-11-261-0/+17
| | | | | | | | | Running tests with '.' in the PATH may yield unspecified results, and is deemed unsafe per se. This includes empty entries as well which are treated like a '.' entry as per POSIX. * tests/init.sh (setup_): Add snippet to remove relative and non- accessible entries from the PATH environment variable.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* Remove some of the support for obsolete IRIX 4 and 5.Bruno Haible2020-12-201-1/+1
| | | | | | * m4/mountlist.m4 (AC_FUNC_GETMNTENT): Don't test for getmntent in libsun. * tests/init.sh (setup_): Don't talk about IRIX 5.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* test-framework-sh: tighten an internal grep regexpJim Meyering2019-12-261-2/+2
| | | | | * tests/init.sh (gl_shell_test_script_): Tighten the grep regexp that helps test for a working printf.
* test-framework-sh: Avoid /bin/sh on AIX 7.2 due to its printf built-in.Bruno Haible2019-12-271-0/+8
| | | | | | | | | Reported by Paul Eggert in <https://lists.gnu.org/archive/html/grep-devel/2019-12/msg00020.html>. Simplification by Jim Meyering. * tests/init.sh (gl_shell_test_script_): Add a test of printf of an octal escape sequence in a UTF-8 locale.
* test-framework-sh: Improve maintainability.Bruno Haible2019-01-271-241/+281
| | | | * tests/init.sh: Clarify what belongs together. Reorder definitions.
* tests: Accommodate a shell that is not in /bin/sh.Bruno Haible2019-01-271-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | * tests/init.sh (setup_): Set srcdir and builddir. (BOURNE_SHELL): New variable. * modules/acl-tests (Depends-on): Add 'test-framework-sh'. * modules/file-has-acl-tests (Depends-on): Likewise. * modules/copy-file-tests (Depends-on): Likewise. * tests/test-set-mode-acl-1.sh: Use the test framework. Invoke shell scripts through $BOURNE_SHELL. * tests/test-set-mode-acl-2.sh: Likewise. * tests/test-copy-acl-1.sh: Likewise. * tests/test-copy-acl-2.sh: Likewise. * tests/test-file-has-acl-1.sh: Likewise. * tests/test-file-has-acl-2.sh: Likewise. * tests/test-copy-file-1.sh: Likewise. * tests/test-copy-file-2.sh: Likewise. * tests/test-set-mode-acl.sh (builddir): Consider value set by the invoker. * tests/test-copy-acl.sh (builddir): Likewise. * tests/test-file-has-acl.sh (builddir): Likewise. * tests/test-copy-file.sh (builddir): Likewise. * tests/test-vc-list-files-cvs.sh: Don't create shims for executables in build-aux/. Instead, invoke shell scripts through $BOURNE_SHELL. * tests/test-vc-list-files-git.sh: Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* test-framework-sh: ‘ps -ef’, not ‘ps ef’Paul Eggert2018-01-031-1/+1
| | | | | | * tests/init.sh (rand_bytes_): Put ‘-’ before new-style ps options. Suggested by Bob Proulx (Bug#29968). * build-aux/mktempd (rand_bytes): Make it like tests/init.sh.
* test-framework-sh: avoid netstatPaul Eggert2018-01-021-1/+1
| | | | | | Problem reported by Kristýna Streitová (Bug#29947). * tests/init.sh (rand_bytes_): Stop using netstat, as it's deprecated on SuSE and it's not that important anyway.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* tests: fix 'invalid path dir' errorKO Myung-Hun2017-10-071-3/+16
| | | | | | | | | | | | On OS/2, a path separator is ';' not ':'. And ':' is used as a separator between a drive letter and directory parts. As a result, an absolute path such as x:/path/to/dir on OS/2 is treated as an invalid path dir. * tests/init.sh (PATH_SEPARATOR): Set at startup. (path_prepend_): '?:*' is also an absolute path. Use $PATH_SEPARATOR instead of hard coded ':'.
* test-framework-sh: Don't require bash on Windows and OS/2.Bruno Haible2017-10-071-1/+1
| | | | | | Reported by KO Myung-Hun. * tests/test-init.sh: Use 'shopt' only when running in bash.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * 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'.
* init.sh: Add possibility to not delete temporary files.Bruno Haible2016-12-161-5/+12
| | | | | * tests/init.sh (remove_tmp_): If the environment variable KEEP is set to yes, don't erase the temporary directory.
* tests/init.sh: port Alpine fix to AIX 7.1Paul Eggert2016-09-241-39/+13
| | | | | * tests/init.sh (compare_): When attempting to use diff -U3, prefer diff -u to -U3 to -c to plain diff. Do not insist on
* tests/init.sh: exclude dash with bad "local" semanticsJim Meyering2016-08-081-0/+8
| | | | | | | * 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.
* test-framework-sh: minor cleanupsPaul Eggert2016-03-251-11/+8
| | | | | | | | | | * 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.
* test-framework-sh: revert port to NetBSD 7.0Paul Eggert2016-03-251-11/+26
| | | | | | | | | 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.
* Port better to Alpine LinuxPaul Eggert2016-03-251-3/+9
| | | | | | | 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.
* test-framework-sh: port to NetBSD 7.0Paul Eggert2016-03-251-26/+11
| | | | | | | | | 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.
* tests: for compare_(), use cmp -s where availablePádraig Brady2016-01-011-1/+1
| | | | | * tests/init.sh (compare_): Only fall back to cmp without the POSIX defined -s option, where this is not available.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * 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'.
* tests: restrict shells to those that support 'local'Pádraig Brady2015-07-031-0/+1
| | | | | | | | | | | | | 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'.
* tests: support stderr verification with returns_()Pádraig Brady2015-02-241-1/+9
| | | | | | * 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.
* tests: provide returns_() to simplify exit status checkingPádraig Brady2015-02-111-0/+13
| | | | | | | * 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.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* tests: fix export bug in previous patchPaul Eggert2014-01-071-1/+2
| | | | | | Problem reported by Jim Meyering. * tests/init.sh (re_shell): New var, which is exported instead of re_shell_.
* tests: simplify porting to Solaris 10 /bin/shPaul Eggert2014-01-071-0/+1
| | | | | | | 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.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* init.sh: do not rely on autoupated PWDPaul Eggert2012-06-201-3/+2
| | | | | | | | | | 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.
* init.sh: explain why $EXEEXT support uses aliases rather than functionsJim Meyering2012-05-081-0/+5
| | | | * tests/init.sh: Add a comment.
* init.sh: don't let bash aliases interfere with testsJim Meyering2012-05-081-0/+3
| | | | | | | * 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>.
* test-framework-sh: Fix test failure with AIX 7.1 diff.Bruno Haible2012-01-281-1/+4
| | | | | | | | * 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.
* In commentary, do not use ` to quote.Paul Eggert2012-01-051-2/+2
|
* init.sh: don't waste a subshell just to redirect stderrJim Meyering2012-01-051-2/+2
| | | | | * tests/init.sh: In testing for diff -u and diff -c, use a stderr-redirecting exec inside `...` rather than a subshell.
* init.sh: do not try to accommodate compare arguments starting with "-"Jim Meyering2012-01-031-2/+2
| | | | | | | | | * 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.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* init.sh: do not emit simulated diff output to stderrJim Meyering2011-12-231-2/+2
| | | | * tests/init.sh (compare_dev_null_): Print to stdout, not stderr.
* init.sh: correct previous changeJim Meyering2011-12-221-5/+11
| | | | | * tests/init.sh (compare): My previous change was wrong. Don't clobber "$?". Spotted by Stefano Lattarini and Pádraig Brady.
* init.sh: avoid unwarranted test failure when using "set -x"Jim Meyering2011-12-221-1/+1
| | | | | | * 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.
* tests: Avoid spurious error message on platforms without mktemp program.Bruno Haible2011-12-051-1/+1
| | | | * tests/init.sh (mktempd_): Run mktemp in a subcommand.