Merge branch 'test-protocols' into tap-testsuite-work
[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 cat >> configure.in <<'END'
25 AC_OUTPUT
26 END
27
28 cat > Makefile.am <<'END'
29 TESTS = pass.test pass2.test skip.test skip2.test fail.test
30 END
31
32 cat > pass.test <<'END'
33 #! /bin/sh
34 exit 0
35 END
36
37 cp pass.test pass2.test
38
39 cat > skip.test <<'END'
40 #! /bin/sh
41 echo "% skipped test %"
42 exit 77
43 END
44
45 cp skip.test skip2.test
46
47 cat > fail.test <<'END'
48 #! /bin/sh
49 exit 1
50 END
51
52 chmod a+x *.test
53
54 $ACLOCAL
55 $AUTOCONF
56 $AUTOMAKE -a
57
58 ./configure
59
60 for test_list_override in \
61   'TESTS=pass.test skip.test' \
62   'TEST_LOGS=pass.log skip.log'
63 do
64   env TEST_SUITE_LOG=partial.log "$test_list_override" \
65     $MAKE -e check >stdout || { cat stdout; Exit 1; }
66   cat stdout
67   ls -l
68   count_test_results total=2 pass=1 fail=0 skip=1 xfail=0 xpass=0 error=0
69   cat pass.log
70   cat skip.log
71   cat partial.log
72   test ! -f test-suite.log
73   test ! -f pass2.log
74   test ! -f skip2.log
75   test ! -f fail.log
76   grep '^PASS: pass\.test$' stdout
77   grep '^SKIP: skip\.test$' stdout
78   $FGREP 'skip.test' partial.log
79   $FGREP '% skipped test %' partial.log
80   $EGREP '(pass2|skip2|fail)\.test' stdout partial.log && Exit 1
81   rm -f *.log
82 done
83
84 :