2 # Copyright (C) 2011-2012 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)
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 <http://www.gnu.org/licenses/>.
18 # - some corner cases for TAP plan
24 # -------------------------------------------------------------------------
26 cat > leading-repeated.
test <<END
32 cat > trailing-repeated.
test <<END
38 for pos
in leading trailing
; do
39 TESTS
="$pos-repeated.test" $MAKE -e check
>stdout \
40 && { cat stdout
; exit 1; }
42 count_test_results total
=2 pass
=1 fail
=0 xpass
=0 xfail
=0 skip
=0 error
=1
43 grep "^ERROR: $pos-repeated\\.test - multiple test plans$" stdout
46 # -------------------------------------------------------------------------
48 cat > leading-repeated.
test <<END
55 cat > trailing-repeated.
test <<END
62 env TESTS
="leading-repeated.test trailing-repeated.test" \
63 $MAKE -e check
>stdout
&& { cat stdout
; exit 1; }
65 count_test_results total
=6 pass
=3 fail
=0 xpass
=0 xfail
=0 skip
=0 error
=3
66 grep "^ERROR: leading-repeated\\.test - multiple test plans$" stdout
67 grep "^ERROR: trailing-repeated\\.test - multiple test plans$" stdout
68 grep "^ERROR: trailing-repeated\\.test 2 # AFTER LATE PLAN$" stdout
69 grep "leading .*AFTER LATE PLAN" stdout
&& exit 1
71 # -------------------------------------------------------------------------
93 env TESTS
="1.test 2.test 3.test 4.test" \
94 $MAKE -e check
>stdout
&& { cat stdout
; exit 1; }
96 count_test_results total
=8 pass
=0 fail
=0 xpass
=0 xfail
=0 skip
=4 error
=4
98 grep "^ERROR: $i\\.test - multiple test plans$" stdout
101 # -------------------------------------------------------------------------
115 $MAKE -e check
>stdout
&& { cat stdout
; exit 1; }
117 count_test_results total
=8 pass
=5 fail
=0 xpass
=0 xfail
=0 skip
=0 error
=3
122 ERROR: all.test - multiple test plans
124 ERROR: all.test - multiple test plans
126 ERROR: all.test - multiple test plans
130 $FGREP ': all.test' stdout
> got
136 # -------------------------------------------------------------------------
146 $MAKE -e check
>stdout
&& { cat stdout
; exit 1; }
148 count_test_results total
=5 pass
=2 fail
=0 xpass
=0 xfail
=0 skip
=0 error
=3
153 ERROR: all.test - multiple test plans
154 ERROR: all.test 3 # UNPLANNED
155 ERROR: all.test - too many tests run (expected 2, got 3)
158 $FGREP ': all.test' stdout
> got
164 # -------------------------------------------------------------------------
177 $MAKE -e check
>stdout
&& { cat stdout
; exit 1; }
179 count_test_results total
=7 pass
=3 fail
=0 xpass
=0 xfail
=0 skip
=0 error
=4
185 ERROR: all.test - multiple test plans
186 ERROR: all.test 4 # AFTER LATE PLAN
187 ERROR: all.test - multiple test plans
188 ERROR: all.test 5 # AFTER LATE PLAN
191 $FGREP ': all.test' stdout
> got