123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- #! /bin/sh
- . test-init.sh
- . tap-setup.sh
- cat > ok.test <<END
- 1..3
- ok 1
- not ok 2
- ok 3
- END
- cat > skip.test <<'END'
- 1..3
- ok 1
- ok 2
- ok 3
- END
- cat > skipall.test <<'END'
- 1..0
- foo
- END
- cat > fail.test <<'END'
- 1..1
- not ok 1
- END
- (sed '1s/.*/1..4/' ok.test && echo 'not ok 4') > fail2.test
- cat > xpass.test <<'END'
- 1..1
- ok 1
- END
- (sed '1s/.*/1..4/' ok.test && echo 'ok 4 # TODO') > xpass2.test
- echo 'Bail out!' > bail.test
- (cat ok.test && echo 'Bail out!') > bail2.test
- cat > bail3.test <<'END'
- 1..0
- Bail out!
- END
- cat > error.test <<'END'
- 1..2
- ok 1
- ok 2
- not ok 3
- not ok 4
- END
- cat > error2.test <<'END'
- 1..4
- ok 1
- not ok 2
- ok 3
- END
- cat > error3.test <<'END'
- 1..2
- 1..2
- ok 1
- ok 2
- END
- cat > error4.test <<'END'
- 1..0
- ok 1
- ok 2
- END
- cat > error5.test <<'END'
- 1..4
- not ok 1
- ok 3
- ok 2
- ok 4
- END
- cat > error6.test <<'END'
- 1..2
- ok 1
- ok 7
- END
- cat > error7.test <<'END'
- ok 1
- ok 2
- not ok 3
- ok 4
- END
- cat > hodgepodge.test <<'END'
- 1..2
- not ok 1
- ok 2
- Bail out!
- END
- cat > hodgepodge-all.test <<'END'
- 1..4
- ok 1
- ok 2
- not ok 2
- not ok 3
- ok 4
- Bail out!
- END
- tests=$(echo *.test)
- run_make -O -e FAIL TESTS="$tests" check
- for tst in $(echo " $tests " | sed 's/\.test / /'); do
- echo :copy-in-global-log: yes >> $tst.trs
- done
- rm -f test-suite.log
- run_make -e FAIL TESTS="$tests" test-suite.log
- cat test-suite.log
- have_rst_section ()
- {
- eqeq=$(echo "$1" | sed 's/./=/g')
-
- sed -n "/^$1$/,/^$eqeq$/p" test-suite.log > got
- (echo "$1" && echo "$eqeq") > exp
- cat exp
- cat got
- diff exp got
- }
- have_rst_section 'PASS: ok'
- have_rst_section 'SKIP: skip'
- have_rst_section 'SKIP: skipall'
- have_rst_section 'FAIL: fail'
- have_rst_section 'FAIL: fail2'
- have_rst_section 'FAIL: xpass'
- have_rst_section 'FAIL: xpass2'
- have_rst_section 'ERROR: bail'
- have_rst_section 'ERROR: bail2'
- have_rst_section 'ERROR: bail3'
- have_rst_section 'ERROR: error'
- have_rst_section 'ERROR: error2'
- have_rst_section 'ERROR: error3'
- have_rst_section 'ERROR: error4'
- have_rst_section 'ERROR: error5'
- have_rst_section 'ERROR: error6'
- have_rst_section 'ERROR: error7'
- have_rst_section 'ERROR: hodgepodge'
- have_rst_section 'ERROR: hodgepodge-all'
- :
|