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 # Check that DejaGnu testsuites have 'srcdir' defined to a relative path
18 # (both as TCL variable and as environment variable).
23 cat >> configure.ac << 'END'
27 cat > Makefile.am << 'END'
28 AUTOMAKE_OPTIONS = dejagnu
30 EXTRA_DIST = env.test/env.exp tcl.test/tcl.exp lib/tcl.exp
33 mkdir env.test tcl.test lib
35 # DejaGnu can change $srcdir behind our backs, so we have to
36 # save its original value. Thanks to Ian Lance Taylor for the
38 cat > lib/tcl.exp << 'END'
39 send_user "tcl_lib_srcdir: $srcdir\n"
40 set orig_srcdir $srcdir
43 cat > env.test/env.exp << 'END'
44 set env_srcdir $env(srcdir)
45 send_user "env_srcdir: $env_srcdir\n"
46 if { [ regexp "^\.\.?$" $env_srcdir ] } {
53 cat > tcl.test/tcl.exp << 'END'
54 send_user "tcl_srcdir: $srcdir\n"
55 if { [ regexp "^\.\.?$" $srcdir ] } {
60 send_user "tcl_orig_srcdir: $orig_srcdir\n"
61 if { [ regexp "^\.\.?$" $orig_srcdir ] } {
62 pass "test_tcl_orig_src"
64 fail "test_tcl_orig_src"
70 $AUTOMAKE --add-missing
72 ./configure --srcdir=.
76 # Sanity check: all tests have run.