]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/atf/bootstrap/t_test_program_filter.at
Merge ATF 0.16 from vendor/atf/dist.
[FreeBSD/FreeBSD.git] / contrib / atf / bootstrap / t_test_program_filter.at
1 dnl
2 dnl Automated Testing Framework (atf)
3 dnl
4 dnl Copyright (c) 2007 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
29
30 AT_SETUP([test_program: filter test cases by name])
31
32 for h in tp_basic_c tp_basic_cpp tp_basic_sh; do
33
34 dnl Try an invalid test case name.
35 AT_CHECK([TEST_HELPER(${h}) invalid], 1, [], [stderr])
36 AT_CHECK([grep "Unknown test case .invalid'" stderr],
37          [0], [ignore], [])
38
39 dnl Try a glob as a test case name.
40 AT_CHECK([TEST_HELPER(${h}) "*p*"], 1, [], [stderr])
41 AT_CHECK([grep "Unknown test case .\\*p\\*'" stderr],
42          [0], [ignore], [])
43
44 AT_DATA([expres], [passed
45 ])
46 AT_CHECK([TEST_HELPER(${h}) -r resout pass], 0, [ignore], [ignore])
47 AT_CHECK([cmp -s resout expres], [0], [], [])
48
49 AT_DATA([expres], [skipped: By design
50 ])
51 AT_CHECK([TEST_HELPER(${h}) -r resout skip], 0, [ignore], [ignore])
52 AT_CHECK([cmp -s resout expres], [0], [], [])
53
54 AT_DATA([expres], [failed: On purpose
55 ])
56 AT_CHECK([TEST_HELPER(${h}) -r resout fail], 1, [ignore], [ignore])
57 AT_CHECK([cmp -s resout expres], [0], [], [])
58
59 done
60
61 AT_CLEANUP()
62
63 dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4