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
23 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
25 # -------------------------------------------------------------------------
27 cat > leading-repeated.test <<END
33 cat > trailing-repeated.test <<END
39 for pos in leading trailing; do
40 TESTS="$pos-repeated.test" $MAKE -e check >stdout \
41 && { cat stdout; Exit 1; }
43 count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
44 grep "^ERROR: $pos-repeated\\.test - multiple test plans$" stdout
47 # -------------------------------------------------------------------------
49 cat > leading-repeated.test <<END
56 cat > trailing-repeated.test <<END
63 env TESTS="leading-repeated.test trailing-repeated.test" \
64 $MAKE -e check >stdout && { cat stdout; Exit 1; }
66 count_test_results total=6 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=3
67 grep "^ERROR: leading-repeated\\.test - multiple test plans$" stdout
68 grep "^ERROR: trailing-repeated\\.test - multiple test plans$" stdout
69 grep "^ERROR: trailing-repeated\\.test 2 # AFTER LATE PLAN$" stdout
70 grep "leading .*AFTER LATE PLAN" stdout && Exit 1
72 # -------------------------------------------------------------------------
94 env TESTS="1.test 2.test 3.test 4.test" \
95 $MAKE -e check >stdout && { cat stdout; Exit 1; }
97 count_test_results total=8 pass=0 fail=0 xpass=0 xfail=0 skip=4 error=4
99 grep "^ERROR: $i\\.test - multiple test plans$" stdout
102 # -------------------------------------------------------------------------
116 $MAKE -e check >stdout && { cat stdout; Exit 1; }
118 count_test_results total=8 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=3
123 ERROR: all.test - multiple test plans
125 ERROR: all.test - multiple test plans
127 ERROR: all.test - multiple test plans
131 $FGREP ': all.test' stdout > got
137 # -------------------------------------------------------------------------
147 $MAKE -e check >stdout && { cat stdout; Exit 1; }
149 count_test_results total=5 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=3
154 ERROR: all.test - multiple test plans
155 ERROR: all.test 3 # UNPLANNED
156 ERROR: all.test - too many tests run (expected 2, got 3)
159 $FGREP ': all.test' stdout > got
165 # -------------------------------------------------------------------------
178 $MAKE -e check >stdout && { cat stdout; Exit 1; }
180 count_test_results total=7 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=4
186 ERROR: all.test - multiple test plans
187 ERROR: all.test 4 # AFTER LATE PLAN
188 ERROR: all.test - multiple test plans
189 ERROR: all.test 5 # AFTER LATE PLAN
192 $FGREP ': all.test' stdout > got