Mercurial > gnulib
comparison tests/init.sh @ 40156:066c585853e5
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.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 27 Jan 2019 16:01:23 +0100 |
parents | b06060465f09 |
children | 383f7a766b7c |
comparison
equal
deleted
inserted
replaced
40155:84fd38f4932c | 40156:066c585853e5 |
---|---|
473 fi | 473 fi |
474 fi | 474 fi |
475 | 475 |
476 initial_cwd_=$PWD | 476 initial_cwd_=$PWD |
477 | 477 |
478 # Create and enter the temporary directory. | |
478 pfx_=`testdir_prefix_` | 479 pfx_=`testdir_prefix_` |
479 test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ | 480 test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ |
480 || fail_ "failed to create temporary directory in $initial_cwd_" | 481 || fail_ "failed to create temporary directory in $initial_cwd_" |
481 cd "$test_dir_" || fail_ "failed to cd to temporary directory" | 482 cd "$test_dir_" || fail_ "failed to cd to temporary directory" |
483 # Set variables srcdir, builddir, for the convenience of the test. | |
484 case $srcdir in | |
485 /* | ?:*) ;; | |
486 *) srcdir="../$srcdir" ;; | |
487 esac | |
488 builddir=".." | |
489 export srcdir builddir | |
482 | 490 |
483 # As autoconf-generated configure scripts do, ensure that IFS | 491 # As autoconf-generated configure scripts do, ensure that IFS |
484 # is defined initially, so that saving and restoring $IFS works. | 492 # is defined initially, so that saving and restoring $IFS works. |
485 gl_init_sh_nl_=' | 493 gl_init_sh_nl_=' |
486 ' | 494 ' |
605 i_=`expr $i_ + 1` | 613 i_=`expr $i_ + 1` |
606 done | 614 done |
607 fail_ "$err_" | 615 fail_ "$err_" |
608 } | 616 } |
609 | 617 |
618 # The interpreter for Bourne-shell scripts. | |
619 # No special standards compatibility requirements. | |
620 # Some environments, such as Android, don't have /bin/sh. | |
621 if test -f /bin/sh$EXEEXT; then | |
622 BOURNE_SHELL=/bin/sh | |
623 else | |
624 BOURNE_SHELL=sh | |
625 fi | |
626 | |
610 # If you want to override the testdir_prefix_ function, | 627 # If you want to override the testdir_prefix_ function, |
611 # or to add more utility functions, use this file. | 628 # or to add more utility functions, use this file. |
612 test -f "$srcdir/init.cfg" \ | 629 test -f "$srcdir/init.cfg" \ |
613 && . "$srcdir/init.cfg" | 630 && . "$srcdir/init.cfg" |
614 | 631 |