automake: info about Automake and Libtool being in different prefixes.
[automake.git] / t / dejagnu-siteexp-useredit.sh
blob616e90dfa0c073715b5ee31aea2f373735adfa88
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Check that the user can edit the Makefile-generated site.exp, and
18 # have its edits survive to the remaking of that file.
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AC_CONFIG_FILES([testsuite/Makefile])
24 AC_OUTPUT
25 END
27 cat > Makefile.am << 'END'
28 SUBDIRS = testsuite
29 END
31 mkdir testsuite
33 cat > testsuite/Makefile.am << 'END'
34 AUTOMAKE_OPTIONS = dejagnu
35 DEJATOOL = foo
36 END
38 # Deliberately select a variable defined automatically by
39 # the Makefile-generated site.exp.
40 mkdir testsuite/foo.test
41 cat > testsuite/foo.test/foo.exp << 'END'
42 send_user "objdir: $objdir\n"
43 set pipe "|"
44 if { $objdir == "${pipe}objdir${pipe}" } {
45 pass "test_obj"
46 } else {
47 fail "test_obj"
49 END
51 $ACLOCAL
52 $AUTOCONF
53 $AUTOMAKE --add-missing
55 ./configure
57 (cd testsuite/ && $MAKE site.exp)
58 echo 'set objdir "|objdir|"' >> testsuite/site.exp
59 cat testsuite/site.exp
60 $sleep
61 touch testsuite/Makefile
62 (cd testsuite/ && $MAKE site.exp)
63 cat testsuite/site.exp
64 is_newest testsuite/site.exp testsuite/Makefile # Sanity check.
65 grep '|objdir|' testsuite/site.exp
66 test $($FGREP -c '|objdir|' testsuite/site.exp) -eq 1
68 # We can do a "more semantic" check if DejaGnu is available.
69 if runtest SOMEPROGRAM=someprogram --version; then
70 $MAKE check
71 grep 'PASS: test_obj' testsuite/foo.sum