#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Sanity check for the automake testsuite.
-# Make sure that $me gets automatically defined by './defs'.
+# Make sure that $me gets automatically defined by 'test-init.sh'.
am_create_testdir=no
-. ./defs || exit 1
+. test-init.sh
plan_ 12
-AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
-
# This test becomes cumbersome if we keep the 'errexit' shell flag set.
# And removing it is no big deal, as this test is a TAP-based one, so
# that false positives remain very unlikely.
do_check ()
{
- $AM_TEST_RUNNER_SHELL -c '. ./defs && echo me=$me' "$1" | grep "^me=$2$"
+ $AM_TEST_RUNNER_SHELL -c '
+ am_create_testdir=no # Do not pollute the top-level directory.
+ . test-init.sh
+ echo me=$me
+ ' "$1" | grep "^me=$2$"
command_ok_ "me=$1" test $? -eq 0
}
# A definition of $me in the environment should be ignored.
-s=$(me=bad $AM_TEST_RUNNER_SHELL -c '. ./defs && echo me=$me' foo.sh)
-command_ok_ "override of \$me before ./defs causes no error" \
+s=$(me=bad $AM_TEST_RUNNER_SHELL -c '
+ # Do not pollute the top-level directory.
+ am_create_testdir=no
+ . test-init.sh
+ echo me=$me
+' foo.sh)
+command_ok_ "override of \$me before test-init.sh causes no error" \
test $? -eq 0
r='ok'