ylwrap: preserve subdirectories in "#line" munging
[platform/upstream/automake.git] / t / testsuite-summary-reference-log.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2012 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 am_parallel_tests=yes
21 . ./defs || Exit 1
22
23 mv configure.ac configure.stub
24
25 cat > fail << 'END'
26 #!/bin/sh
27 exit 1
28 END
29 chmod a+x fail
30
31 cat configure.stub - > configure.ac <<'END'
32 AC_OUTPUT
33 END
34
35 cat > Makefile.am << 'END'
36 TEST_SUITE_LOG = my_test_suite.log
37 TESTS = fail
38 END
39
40 $ACLOCAL
41 $AUTOCONF
42 $AUTOMAKE -a
43
44 mkdir build
45 cd build
46
47 ../configure
48
49 $MAKE check >stdout && { cat stdout; Exit 1; }
50 cat stdout
51 grep '^See \./my_test_suite\.log$' stdout
52
53 mkdir bar
54 TEST_SUITE_LOG=bar/bar.log $MAKE -e check >stdout && { cat stdout; Exit 1; }
55 cat stdout
56 grep '^See \./bar/bar\.log$' stdout
57
58 cd ..
59
60 echo SUBDIRS = sub > Makefile.am
61 mkdir sub
62 echo TESTS = fail > sub/Makefile.am
63 mv fail sub
64
65 cat configure.stub - > configure.ac <<'END'
66 AC_CONFIG_FILES([sub/Makefile])
67 AC_OUTPUT
68 END
69
70 $ACLOCAL --force
71 $AUTOCONF --force
72 $AUTOMAKE
73
74 ./configure
75 $MAKE check >stdout && { cat stdout; Exit 1; }
76 cat stdout
77 grep '^See sub/test-suite\.log$' stdout
78 cd sub
79 $MAKE check >stdout && { cat stdout; Exit 1; }
80 cat stdout
81 grep '^See sub/test-suite\.log$' stdout
82 cd ..
83
84 TEST_SUITE_LOG=foo.log $MAKE -e check >stdout && { cat stdout; Exit 1; }
85 cat stdout
86 grep '^See sub/foo\.log$' stdout
87
88 :