Merge branch 'fix-pr13514' into branch-1.13.2
[platform/upstream/automake.git] / t / testsuite-summary-reference-log.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Check that the global testsuite log file referenced in the testsuite
18 # summary and in the global testsuite log itself is correct.
19
20 . test-init.sh
21
22 mv configure.ac configure.stub
23
24 cat > fail << 'END'
25 #!/bin/sh
26 exit 1
27 END
28 chmod a+x fail
29
30 cat configure.stub - > configure.ac <<'END'
31 AC_OUTPUT
32 END
33
34 cat > Makefile.am << 'END'
35 TEST_SUITE_LOG = my_test_suite.log
36 TESTS = fail
37 END
38
39 $ACLOCAL
40 $AUTOCONF
41 $AUTOMAKE -a
42
43 mkdir build
44 cd build
45
46 ../configure
47
48 $MAKE check >stdout && { cat stdout; exit 1; }
49 cat stdout
50 grep '^See \./my_test_suite\.log$' stdout
51
52 mkdir bar
53 TEST_SUITE_LOG=bar/bar.log $MAKE -e check >stdout && { cat stdout; exit 1; }
54 cat stdout
55 grep '^See \./bar/bar\.log$' stdout
56
57 cd ..
58
59 echo SUBDIRS = sub > Makefile.am
60 mkdir sub
61 echo TESTS = fail > sub/Makefile.am
62 mv fail sub
63
64 cat configure.stub - > configure.ac <<'END'
65 AC_CONFIG_FILES([sub/Makefile])
66 AC_OUTPUT
67 END
68
69 $ACLOCAL --force
70 $AUTOCONF --force
71 $AUTOMAKE
72
73 ./configure
74 $MAKE check >stdout && { cat stdout; exit 1; }
75 cat stdout
76 grep '^See sub/test-suite\.log$' stdout
77 cd sub
78 $MAKE check >stdout && { cat stdout; exit 1; }
79 cat stdout
80 grep '^See sub/test-suite\.log$' stdout
81 cd ..
82
83 TEST_SUITE_LOG=foo.log $MAKE -e check >stdout && { cat stdout; exit 1; }
84 cat stdout
85 grep '^See sub/foo\.log$' stdout
86
87 :