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 # - which global test result derives from different test results
19 # mixed in a single script?
32 cat > skip.test <<'END'
39 cat > skipall.test <<'END'
45 cat > fail.test <<'END'
50 (sed '1s/.*/1..4/' ok.test && echo 'not ok 4') > fail2.test
52 cat > xpass.test <<'END'
57 (sed '1s/.*/1..4/' ok.test && echo 'ok 4 # TODO') > xpass2.test
59 echo 'Bail out!' > bail.test
61 (cat ok.test && echo 'Bail out!') > bail2.test
63 cat > bail3.test <<'END'
69 cat > error.test <<'END'
78 cat > error2.test <<'END'
86 cat > error3.test <<'END'
93 # Too many tests, after a "SKIP" plan.
94 cat > error4.test <<'END'
100 # Tests out of order.
101 cat > error5.test <<'END'
110 cat > error6.test <<'END'
117 cat > error7.test <<'END'
124 cat > hodgepodge.test <<'END'
131 cat > hodgepodge-all.test <<'END'
141 tests=$(echo *.test) # Also required later.
143 run_make -O -e FAIL TESTS="$tests" check
145 # Dirty trick required here.
146 for tst in $(echo " $tests " | sed 's/\.test / /'); do
147 echo :copy-in-global-log: yes >> $tst.trs
151 run_make -e FAIL TESTS="$tests" test-suite.log
156 eqeq=$(echo "$1" | sed 's/./=/g')
157 # Assume $1 contains no RE metacharacters.
158 sed -n "/^$1$/,/^$eqeq$/p" test-suite.log > got
159 (echo "$1" && echo "$eqeq") > exp
165 have_rst_section 'PASS: ok'
166 have_rst_section 'SKIP: skip'
167 have_rst_section 'SKIP: skipall'
168 have_rst_section 'FAIL: fail'
169 have_rst_section 'FAIL: fail2'
170 have_rst_section 'FAIL: xpass'
171 have_rst_section 'FAIL: xpass2'
172 have_rst_section 'ERROR: bail'
173 have_rst_section 'ERROR: bail2'
174 have_rst_section 'ERROR: bail3'
175 have_rst_section 'ERROR: error'
176 have_rst_section 'ERROR: error2'
177 have_rst_section 'ERROR: error3'
178 have_rst_section 'ERROR: error4'
179 have_rst_section 'ERROR: error5'
180 have_rst_section 'ERROR: error6'
181 have_rst_section 'ERROR: error7'
182 have_rst_section 'ERROR: hodgepodge'
183 have_rst_section 'ERROR: hodgepodge-all'