2 # Copyright (C) 2011-2013 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 run_make -O -e FAIL TESTS="$pos-repeated.test" check
40 count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
41 grep "^ERROR: $pos-repeated\\.test - multiple test plans$" stdout
44 # -------------------------------------------------------------------------
46 cat > leading-repeated.test <<END
53 cat > trailing-repeated.test <<END
60 run_make -O -e FAIL check \
61 TESTS='leading-repeated.test trailing-repeated.test'
62 count_test_results total=6 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=3
63 grep "^ERROR: leading-repeated\\.test - multiple test plans$" stdout
64 grep "^ERROR: trailing-repeated\\.test - multiple test plans$" stdout
65 grep "^ERROR: trailing-repeated\\.test 2 # AFTER LATE PLAN$" stdout
66 grep "leading .*AFTER LATE PLAN" stdout && exit 1
68 # -------------------------------------------------------------------------
90 run_make -O -e FAIL check TESTS='1.test 2.test 3.test 4.test'
91 count_test_results total=8 pass=0 fail=0 xpass=0 xfail=0 skip=4 error=4
93 grep "^ERROR: $i\\.test - multiple test plans$" stdout
96 # -------------------------------------------------------------------------
110 run_make -O -e FAIL check
111 count_test_results total=8 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=3
116 ERROR: all.test - multiple test plans
118 ERROR: all.test - multiple test plans
120 ERROR: all.test - multiple test plans
124 $FGREP ': all.test' stdout > got
130 # -------------------------------------------------------------------------
140 run_make -O -e FAIL check
141 count_test_results total=5 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=3
146 ERROR: all.test - multiple test plans
147 ERROR: all.test 3 # UNPLANNED
148 ERROR: all.test - too many tests run (expected 2, got 3)
151 $FGREP ': all.test' stdout > got
157 # -------------------------------------------------------------------------
170 run_make -O -e FAIL check
171 count_test_results total=7 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=4
177 ERROR: all.test - multiple test plans
178 ERROR: all.test 4 # AFTER LATE PLAN
179 ERROR: all.test - multiple test plans
180 ERROR: all.test 5 # AFTER LATE PLAN
183 $FGREP ': all.test' stdout > got