Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/atf/dist/tests/atf/atf-report Test that xfail f...
details: https://anonhg.NetBSD.org/src/rev/877eaef7855f
branches: trunk
changeset: 755746:877eaef7855f
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Jun 18 16:13:16 2010 +0000
description:
Test that xfail failures are reported as xfails and xfail passes
are reported as pure fails.
diffstat:
external/bsd/atf/dist/tests/atf/atf-report/h_xfail.cpp | 58 +++++++++++++
external/bsd/atf/dist/tests/atf/atf-report/t_integration.sh | 35 +++++--
2 files changed, 84 insertions(+), 9 deletions(-)
diffs (151 lines):
diff -r 0620a59a7f82 -r 877eaef7855f external/bsd/atf/dist/tests/atf/atf-report/h_xfail.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/atf/dist/tests/atf/atf-report/h_xfail.cpp Fri Jun 18 16:13:16 2010 +0000
@@ -0,0 +1,58 @@
+//
+// Automated Testing Framework (atf)
+//
+// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+// CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+#include "atf-c++/macros.hpp"
+
+ATF_TEST_CASE(xfail_yes);
+ATF_TEST_CASE_HEAD(xfail_yes)
+{
+ set_md_var("descr", "Helper test case that expectedly fails");
+ set_md_var("xfail", "xfailmen");
+}
+ATF_TEST_CASE_BODY(xfail_yes)
+{
+ atf_tc_fail("Expected Fail");
+}
+
+
+ATF_TEST_CASE(xfail_no);
+ATF_TEST_CASE_HEAD(xfail_no)
+{
+ set_md_var("descr", "Helper test case that unexpectedly does not fails");
+ set_md_var("xfail", "xfailmen2");
+}
+ATF_TEST_CASE_BODY(xfail_no)
+{
+}
+
+ATF_INIT_TEST_CASES(tcs)
+{
+ ATF_ADD_TEST_CASE(tcs, xfail_yes);
+ ATF_ADD_TEST_CASE(tcs, xfail_no);
+}
diff -r 0620a59a7f82 -r 877eaef7855f external/bsd/atf/dist/tests/atf/atf-report/t_integration.sh
--- a/external/bsd/atf/dist/tests/atf/atf-report/t_integration.sh Fri Jun 18 15:55:33 2010 +0000
+++ b/external/bsd/atf/dist/tests/atf/atf-report/t_integration.sh Fri Jun 18 16:13:16 2010 +0000
@@ -34,6 +34,7 @@
cp $(atf_get_srcdir)/h_fail dir1/tp2
cp $(atf_get_srcdir)/h_pass tp3
cp $(atf_get_srcdir)/h_fail tp4
+ cp $(atf_get_srcdir)/h_xfail tp6
cat >tp5 <<EOF
#! $(atf-config -t atf_shell)
@@ -50,6 +51,7 @@
tp: tp3
tp: tp4
tp: tp5
+tp: tp6
EOF
cat >dir1/Atffile <<EOF
@@ -180,6 +182,9 @@
tc, tp4, main, failed, This always fails
tp, tp4, failed
tp, tp5, bogus, Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:'
+tc, tp6, xfail_no, failed, Test case is expected to fail but reported success
+tc, tp6, xfail_yes, xfail, xfailmen
+tp, tp6, failed
EOF
# NO_CHECK_STYLE_END
@@ -199,31 +204,35 @@
# NO_CHECK_STYLE_BEGIN
cat >expout <<EOF
-dir1/tp1 (1/5): 1 test cases
+dir1/tp1 (1/6): 1 test cases
main: Passed.
-dir1/tp2 (2/5): 1 test cases
+dir1/tp2 (2/6): 1 test cases
main: Failed: This always fails
-tp3 (3/5): 1 test cases
+tp3 (3/6): 1 test cases
main: Passed.
-tp4 (4/5): 1 test cases
+tp4 (4/6): 1 test cases
main: Failed: This always fails
-tp5 (5/5): 0 test cases
+tp5 (5/6): 0 test cases
tp5: BOGUS TEST PROGRAM: Cannot trust its results because of \`Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:''
+tp6 (6/6): 2 test cases
+ xfail_no: Failed: Test case is expected to fail but reported success
+ xfail_yes: Expected failure: xfailmen
+
Failed (bogus) test programs:
tp5
Failed test cases:
- dir1/tp2:main, tp4:main
+ dir1/tp2:main, tp4:main, tp6:xfail_no
-Summary for 5 test programs:
+Summary for 6 test programs:
2 passed test cases.
- 2 failed test cases.
- 0 expected failures.
+ 3 failed test cases.
+ 1 expected failures.
0 skipped test cases.
EOF
@@ -272,6 +281,14 @@
<tp id="tp5">
<failed>Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:'</failed>
</tp>
+<tp id="tp6">
+<tc id="xfail_no">
+<failed>Test case is expected to fail but reported success</failed>
+</tc>
+<tc id="xfail_yes">
+<xfail>xfailmen</xfail>
+</tc>
+</tp>
<info class="endinfo">Another value</info>
</tests-results>
EOF
Home |
Main Index |
Thread Index |
Old Index