Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / parallel-tests-log-override-2.test
1 #! /bin/sh
2 # Copyright (C) 2011 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 parallel-tests features: runtime redefinition of:
18 #  - $(TEST_SUITE_LOG) and $(TESTS)
19 #  - $(TEST_SUITE_LOG) and $(TEST_LOGS)
20
21 parallel_tests=yes
22 . ./defs || Exit 1
23
24 set -e
25
26 cat >> configure.in <<'END'
27 AC_OUTPUT
28 END
29
30 cat > Makefile.am <<'END'
31 TESTS = pass.test pass2.test skip.test skip2.test fail.test
32 END
33
34 cat > pass.test <<'END'
35 #! /bin/sh
36 exit 0
37 END
38
39 cp pass.test pass2.test
40
41 cat > skip.test <<'END'
42 #! /bin/sh
43 echo "% skipped test %"
44 exit 77
45 END
46
47 cp skip.test skip2.test
48
49 cat > fail.test <<'END'
50 #! /bin/sh
51 exit 1
52 END
53
54 chmod a+x *.test
55
56 $ACLOCAL
57 $AUTOCONF
58 $AUTOMAKE -a
59
60 ./configure
61
62 for test_list_override in \
63   'TESTS=pass.test skip.test' \
64   'TEST_LOGS=pass.log skip.log'
65 do
66   env TEST_SUITE_LOG=partial.log "$test_list_override" \
67     $MAKE -e check >stdout || { cat stdout; Exit 1; }
68   cat stdout
69   ls -l
70   cat pass.log
71   cat skip.log
72   cat partial.log
73   test ! -f test-suite.log
74   test ! -f pass2.log
75   test ! -f skip2.log
76   test ! -f fail.log
77   grep '^PASS: .*pass\.test' stdout
78   grep '^SKIP: .*skip\.test' stdout
79   $FGREP 'skip.test' partial.log
80   $FGREP '% skipped test %' partial.log
81   for t in pass2 skip2 fail; do
82     $FGREP "$t.test" stdout && Exit 1
83     $FGREP "$t.test" partial.log && Exit 1
84   done
85   rm -f *.log
86 done
87
88 :