No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / atf / dist / tests / bootstrap / t_test_program_run.at
blob8df14850a0338cd22f08214d72a69d66ad4866c6
1 dnl
2 dnl Automated Testing Framework (atf)
3 dnl
4 dnl Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
5 dnl All rights reserved.
6 dnl
7 dnl Redistribution and use in source and binary forms, with or without
8 dnl modification, are permitted provided that the following conditions
9 dnl are met:
10 dnl 1. Redistributions of source code must retain the above copyright
11 dnl    notice, this list of conditions and the following disclaimer.
12 dnl 2. Redistributions in binary form must reproduce the above copyright
13 dnl    notice, this list of conditions and the following disclaimer in the
14 dnl    documentation and/or other materials provided with the distribution.
15 dnl
16 dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 dnl
30 AT_SETUP([test_program: output format and exit codes])
32 for h in tp_basic_c tp_basic_cpp tp_basic_sh; do
34 AT_CHECK([TEST_HELPER(${h})], 1, [stdout], [stderr])
35 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stdout], 3)], [0], [], [])
36 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stderr], 3)], [0], [], [])
37 CHECK_TCS_TCR(pass, passed, stdout)
38 CHECK_TCS_TCR(fail, failed, stdout)
39 CHECK_TCS_TCR(skip, skipped, stdout)
40 CHECK_TCS_TCR(default, passed, stdout)
42 dnl Check the -r flag to redirect the results output.
43 dnl (Same checks as above, as -r1 is the default.)
44 AT_CHECK([TEST_HELPER(${h}) -r1], 1, [stdout], [stderr])
45 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stdout], 3)], [0], [], [])
46 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stderr], 3)], [0], [], [])
47 CHECK_TCS_TCR(pass, passed, stdout)
48 CHECK_TCS_TCR(fail, failed, stdout)
49 CHECK_TCS_TCR(skip, skipped, stdout)
50 CHECK_TCS_TCR(default, passed, stdout)
52 dnl Check the -r flag to redirect the results output.
53 AT_CHECK([TEST_HELPER(${h}) -r2], 1, [ignore], [stderr])
54 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stdout], 3)], [0], [], [])
55 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stderr], 3)], [0], [], [])
56 CHECK_TCS_TCR(pass, passed, stderr)
57 CHECK_TCS_TCR(fail, failed, stderr)
58 CHECK_TCS_TCR(skip, skipped, stderr)
59 CHECK_TCS_TCR(default, passed, stderr)
61 dnl Check the -r flag to redirect the results output.
62 AT_DATA([expres], [Content-Type: application/X-atf-tcs; version="1"
64 tcs-count: 4
65 tc-start: pass
66 tc-end: pass, passed
67 tc-start: fail
68 tc-end: fail, failed, On purpose
69 tc-start: skip
70 tc-end: skip, skipped, By design
71 tc-start: default
72 tc-end: default, passed
74 AT_CHECK([TEST_HELPER(${h}) -r3 3>resout], 1, [stdout], [stderr])
75 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stdout], 3)], [0], [], [])
76 AT_CHECK([COUNT_IN_LINES([grep __atf_tc_separator__ stderr], 3)], [0], [], [])
77 AT_CHECK([cmp -s resout expres], 0, [], [])
79 AT_DATA([expres], [Content-Type: application/X-atf-tcs; version="1"
81 tcs-count: 1
82 tc-start: pass
83 tc-end: pass, passed
85 AT_CHECK([TEST_HELPER(${h}) -r3 pass 3>resout], 0, [stdout], [stderr])
86 AT_CHECK([grep __atf_tc_separator__ stdout], [1], [], [])
87 AT_CHECK([grep __atf_tc_separator__ stderr], [1], [], [])
88 AT_CHECK([cmp -s resout expres], 0, [], [])
90 AT_DATA([expres], [Content-Type: application/X-atf-tcs; version="1"
92 tcs-count: 1
93 tc-start: fail
94 tc-end: fail, failed, On purpose
96 AT_CHECK([TEST_HELPER(${h}) -r3 fail 3>resout], 1, [stdout], [stderr])
97 AT_CHECK([grep __atf_tc_separator__ stdout], [1], [], [])
98 AT_CHECK([grep __atf_tc_separator__ stderr], [1], [], [])
99 AT_CHECK([cmp -s resout expres], 0, [], [])
101 AT_DATA([expres], [Content-Type: application/X-atf-tcs; version="1"
103 tcs-count: 1
104 tc-start: skip
105 tc-end: skip, skipped, By design
107 AT_CHECK([TEST_HELPER(${h}) -r3 skip 3>resout], 0, [stdout], [stderr])
108 AT_CHECK([grep __atf_tc_separator__ stdout], [1], [], [])
109 AT_CHECK([grep __atf_tc_separator__ stderr], [1], [], [])
110 AT_CHECK([cmp -s resout expres], 0, [], [])
112 done
114 AT_CLEANUP()
116 dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4