summaryrefslogtreecommitdiff
path: root/defs
blob: 217665eaf4de012ec91c760b3de2a3338046a986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- shell-script -*-
#
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# *** IMPORTANT NOTE ***
# This file should execute correctly with any system's /bin/sh (which
# might be just a Bourne shell, non POSIX-conforming, like on Solaris
# up to version 11 at least).

# Source the shell static setup and variable definitions.
. ./defs-static
test $? -eq 0 || exit 99

# Make sure we run with the shell detected at configure time or forced
# by the user (unless the user forbids it).  That is assumed to be a
# proper POSIX shell.
case ${AM_TESTS_REEXEC-yes} in
  n|no|false|0)
    ;;
  *)
    # Ensure we can find ourselves.
    if test ! -f "$argv0"; then
      echo "$argv0: unable to find myself" >&2
      exit 99
    fi
    AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
    # Cannot simply do "opts=$-", since the content of $- is not
    # portable among different shells.  So try to propagate only
    # the portable and interesting options.
    case $- in
      *x*v*|*v*x) opts=-vx;;
      *v*) opts=-v;;
      *x*) opts=-x;;
      *) opts=;;
    esac
    echo exec $AM_TEST_RUNNER_SHELL $opts "$argv0" "$*"
    exec $AM_TEST_RUNNER_SHELL $opts "$argv0" ${1+"$@"}
    # This should be dead code, unless some strange error happened. 
    echo "$argv0: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
    exit 99
    ;;
esac

# Source the actual test initialization and setup code, and return
# control to the test script that is sourcing us.
. "$am_testauxdir/test-init.sh"