# # Automated Testing Framework (atf) # # Copyright (c) 2007, 2008, 2009, 2010 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. # create_helpers() { mkdir dir1 cp $(atf_get_srcdir)/pass_helper dir1/tp1 cp $(atf_get_srcdir)/fail_helper dir1/tp2 cp $(atf_get_srcdir)/pass_helper tp3 cp $(atf_get_srcdir)/fail_helper tp4 cat >tp5 <Atffile <dir1/Atffile <etc/atf-run.hooks <tps.out 2>/dev/null rm -rf etc } atf_test_case default default_head() { atf_set "descr" "Checks that the default output uses the ticker" \ "format" } default_body() { create_helpers run_helpers # Check that the default output uses the ticker format. atf_check -s eq:0 -o match:'test cases' -o match:'Failed test cases' \ -o match:'Summary for' -e empty -x 'atf-report Atffile <expout <expout <expout <>'; expected \`:' EOF # NO_CHECK_STYLE_END atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o csv:- expout <>'; expected \`:'' Failed (bogus) test programs: tp5 Failed test cases: dir1/tp2:main, tp4:main Summary for 5 test programs: 2 passed test cases. 2 failed test cases. 0 expected failed test cases. 0 skipped test cases. EOF atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o ticker:- expout < A value This always fails This always fails Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:' Another value EOF # NO_CHECK_STYLE_END atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o xml:- Atffile <expout < A value --- a 2007-11-04 14:00:41.000000000 +0100 +++ b 2007-11-04 14:00:48.000000000 +0100 @@ -1,7 +1,7 @@ This test is meant to simulate a diff. Blank space at beginning of context lines must be preserved. -First original line. -Second original line. +First modified line. +Second modified line. EOF Another value EOF # NO_CHECK_STYLE_END run_helpers atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o xml:-