2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Sanity check for the automake testsuite.
18 # Test the sanity checks performed by the 'defs' script. Also check
19 # that we can use 'defs' elsewhere, when we duplicate some of the
20 # infrastructure from the automake/tests subdirectory.
22 am_create_testdir=empty
25 # Avoid to confuse traces from child processed with our own traces.
28 sed 's/^/ | /' stderr >&2
31 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
33 if $SHELL -c '. ../defs' dummy.test 2>stderr; then
38 grep 'defs-static: not found in current directory' stderr
41 sed 's|^testsrcdir=.*|testsrcdir=foo|' ../defs-static > defs-static
42 if $SHELL -c '. ../defs' dummy.test 2>stderr; then
47 grep 'foo/defs-static\.in not found.*check \$testsrcdir' stderr
50 sed 's|^testbuilddir=.*|testbuilddir=foo|' ../defs-static > defs-static
51 if $SHELL -c '. ../defs' dummy.test 2>stderr; then
56 grep 'foo/defs-static not found.*check \$testbuilddir' stderr
59 # We still need a little hack to make ./defs work outside automake's
60 # tree 'tests' subdirectory. Not a big deal.
61 sed "s|^testbuilddir=.*|testbuilddir='`pwd`'|" ../defs-static >defs-static
62 # Redefining *srcdir and *builddir variables in the environment shouldn't
65 builddir=bad-dir srcdir=bad-dir \
66 top_builddir=bad-dir top_srcdir=bad-dir \
67 abs_builddir=bad-dir abs_srcdir=bad-dir \
68 abs_top_builddir=bad-dir abs_top_srcdir=bad-dir \
69 $SHELL -c '. ../defs && echo "!OK!" > ../foo' dummy.test