| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 | #! /bin/sh# Copyright (C) 2011-2017 Free Software Foundation, Inc.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program.  If not, see <http://www.gnu.org/licenses/>.# TAP support:#  - all input (valid TAP lines, invalid TAP lines, non-TAP lines)#    are passed through in the log file#  - TAP errors are reported in the log file too# See also related test 'tap-passthrough-exit.sh'.. test-init.shweirdchars=\''"\$@!&()[]<>#;,:.^?*/'. tap-setup.sh## Only successful tests.## The whitespace in this test might be normalized in the testsuite# progress output, but should be copied verbatim in the log files.cat > ok.test <<END1..6TAP plan in the previous line.ok${tab}ok     2ok - foook 4 - x  This is not a TAP line, but should still be copied in the log file!# some diagnostic${tab}not ok # TODO low priorityok # SKIP who cares?$weirdcharsENDrun_make TESTS=ok.test check || { cat ok.log; exit 1; }cat ok.logfor rx in \  '1\.\.6' \  'TAP plan in the previous line\.' \  "ok${tab}" \  'ok     2' \  'ok - foo' \  'ok 4 - x' \  '  This is not a TAP line, but should still be copied in the log file!' \  "# some diagnostic${tab}" \  'not ok # TODO low priority' \  'ok # SKIP who cares?' \; do  grep "^$rx$" ok.logdone$FGREP "$weirdchars" ok.log## Mixed failing/successful tests.#cat > tiny.test <<END1..1okENDcat > ok.test <<END1..1okonly one success hereENDcat > ko.test <<END1..5foo foo foook${tab}ok     2not ok - foonot ok 4 - x# diagnostic ko  bar${tab}bar${tab}barok # TODO dunno$weirdcharsENDcat > bail.test <<ENDBail out! Test is taking too long!ENDcat > skip.test <<END1..0 # Skipped: WWW::Mechanize not installedENDcat > err.test <<END1..3ok 1Invalid test countok 23Misplaced plan1..13okExtra testokLast lineENDst=0run_make check \  TESTS='tiny.test ok.test ko.test bail.test skip.test err.test' || st=$?cat tiny.logcat ok.logcat ko.logcat bail.logcat skip.logcat err.logtest $st -gt 0 || exit 1grep '^1\.\.1$' tiny.loggrep '^ok$' tiny.loggrep '^only one success here$' ok.logfor rx in \  '1\.\.5' \  'foo foo foo' \  "ok${tab}" \  'ok     2' \  'not ok - foo' \  'not ok 4 - x' \  '# diagnostic ko' \  "  bar${tab}bar${tab}bar" \  'ok # TODO dunno' \; do  grep "^$rx$" ko.logdone$FGREP "$weirdchars" ko.loggrep '^Bail out! Test is taking too long!$' bail.loggrep '^1\.\.0 # Skipped: WWW::Mechanize not installed$' skip.logfor rx in \  '^1\.\.3$' \  '^Invalid test count$' \  '^ok 23$' \  '^Misplaced plan$' \  '^1\.\.13$' \  '^ERROR:.* multiple test plans' \   '^Extra test$' \  '^Last line$' \  '^ERROR:.* [tT]oo many tests run.*expected 3, got 4' \  '^ERROR:.* err\.test 23 .*OUT[ -]OF[ -]ORDER.*expecting 2' \; do  grep "$rx" err.logdone:
 |