From 1968c439d9077a1b5a846a86b98b1a5e60e0ed08 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 27 Jan 2019 16:01:23 +0100 Subject: tests: Accommodate a shell that is not in /bin/sh. * 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. --- tests/test-copy-file.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/test-copy-file.sh') diff --git a/tests/test-copy-file.sh b/tests/test-copy-file.sh index 98da280efb..cd2868d243 100755 --- a/tests/test-copy-file.sh +++ b/tests/test-copy-file.sh @@ -35,7 +35,12 @@ func_tmpdir () } func_tmpdir -builddir=`pwd` +# builddir may already be set by the script that invokes this one. +case "$builddir" in + '') builddir=`pwd` ;; + /* | ?:*) ;; + *) builddir=`pwd`/$builddir ;; +esac cd "$builddir" || { echo "$0: cannot determine build directory (unreadable parent dir?)" >&2 -- cgit v1.2.1