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/>.
17 # Check that an example given in the documentation really works.
18 # See section "Simple Tests" subsection "Script-based Testsuites".
24 cat >> configure.ac
<<END
29 cat > Makefile.am
<< 'END'
30 TESTS
= foo.sh zardoz.tap bar.sh mu.tap
31 TEST_EXTENSIONS
= .sh .tap
32 TAP_LOG_DRIVER
= $
(srcdir
)/tap-driver
33 ## Ensure the test scripts are run in the correct order.
49 cat > zardoz.tap
<< 'END'
52 echo 'ok 1 - Daemon started'
53 echo 'ok 2 - Daemon responding'
54 echo 'ok 3 - Daemon uses /proc # SKIP /proc is not mounted'
55 echo 'ok 4 - Daemon stopped'
62 echo 'not ok # TODO frobnication not yet implemented'
73 $MAKE check
>stdout ||
{ cat stdout
; exit 1; }
78 PASS: zardoz.tap 1 - Daemon started
79 PASS: zardoz.tap 2 - Daemon responding
80 SKIP: zardoz.tap 3 - Daemon uses /proc # SKIP /proc is not mounted
81 PASS: zardoz.tap 4 - Daemon stopped
84 XFAIL: mu.tap 2 # TODO frobnication not yet implemented
87 sed -n '/^PASS: foo\.sh/,/^XFAIL: mu\.tap/p' stdout
> t
89 # Strip extra "informative" lines that could be printed by Solaris
91 LC_ALL
=C
$EGREP -v ' --> ([0-9][0-9]* job|[Jj]ob output)' t
> got