Import atf 0.15: the major goal of this import is to reconcile any local
changes to the atf codebase with upstream code. All local changes should have been backported, with appropriate portability workarounds where necessary. This new release also includes other changes though, such as performance improvements and bug fixes, and also a major new feature partially implemented by pgoyette@: the time to execute each test cases and test program is now recorded and included in the output reports. The import into NetBSD has been tested natively on amd64 and macppc, and the full test suite has also been run through anita on amd64 and i386. No regressions observed... but you never know. From the NEWS file, the changes in this version are as follows: Experimental version released on January 16th, 2012. * Respect stdin in atf-check. The previous release silenced stdin for any processes spawned by atf, not only test programs, which caused breakage in tests that pipe data through atf-check. * Performance improvements to atf-sh. * Enabled detection of unused parameters and variables in the code and fixed all warnings. * Changed the behavior of "developer mode". Compiler warnings are now enabled unconditionally regardless of whether we are in developer mode or not; developer mode is now only used to perform strict warning checks and to enable assertions. Additionally, developer mode is now only automatically enabled when building from the repository, not for formal releases. * Added new Autoconf M4 macros (ATF_ARG_WITH, ATF_CHECK_C and ATF_CHECK_CXX) to provide a consistent way of defining a --with-arg flag in configure scripts and detecting the presence of any of the ATF bindings. Note that ATF_CHECK_SH was already introduced in 0.14, but it has now been modified to also honor --with-atf if instantiated. * Added timing support to atf-run / atf-report. * Added support for a 'require.memory' property, to specify the minimum amount of physical memory needed by the test case to yield valid results. * PR bin/45690: Force an ISO-8859-1 encoding in the XML files generated by atf-report so that invalid data in the output of test cases does not mangle our report.
This commit is contained in:
parent
dc7062b2b8
commit
a551a20f66
5
external/bsd/atf/dist/AUTHORS
vendored
5
external/bsd/atf/dist/AUTHORS
vendored
@ -20,6 +20,11 @@ Authors and contributors Automated Testing Framework
|
||||
initial version of the atf-check utility and started the addition of the
|
||||
ATF_REQUIRE family of macros in the C interface.
|
||||
|
||||
* Paul Goyette <pgoyette@NetBSD.org>
|
||||
|
||||
Implemented timestamping of test programs and test cases so that
|
||||
atf-report can provide timings for their execution.
|
||||
|
||||
|
||||
===========================================================================
|
||||
vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2
|
||||
|
32
external/bsd/atf/dist/COPYING
vendored
32
external/bsd/atf/dist/COPYING
vendored
@ -5,7 +5,7 @@ Redistribution terms Automated Testing Framework
|
||||
License
|
||||
*******
|
||||
|
||||
Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
|
||||
Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 The NetBSD Foundation, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -31,6 +31,36 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Copyright 2011, 2012 Google 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:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* 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.
|
||||
|
||||
* Neither the name of Google Inc. nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
|
||||
|
||||
|
||||
Relicensed code
|
||||
***************
|
||||
|
||||
|
37
external/bsd/atf/dist/NEWS
vendored
37
external/bsd/atf/dist/NEWS
vendored
@ -2,6 +2,43 @@ Major changes between releases Automated Testing Framework
|
||||
===========================================================================
|
||||
|
||||
|
||||
Changes in version 0.15
|
||||
***********************
|
||||
|
||||
Experimental version released on January 16th, 2012.
|
||||
|
||||
* Respect stdin in atf-check. The previous release silenced stdin for any
|
||||
processes spawned by atf, not only test programs, which caused breakage
|
||||
in tests that pipe data through atf-check.
|
||||
|
||||
* Performance improvements to atf-sh.
|
||||
|
||||
* Enabled detection of unused parameters and variables in the code and
|
||||
fixed all warnings.
|
||||
|
||||
* Changed the behavior of "developer mode". Compiler warnings are now
|
||||
enabled unconditionally regardless of whether we are in developer mode or
|
||||
not; developer mode is now only used to perform strict warning checks and
|
||||
to enable assertions. Additionally, developer mode is now only
|
||||
automatically enabled when building from the repository, not for formal
|
||||
releases.
|
||||
|
||||
* Added new Autoconf M4 macros (ATF_ARG_WITH, ATF_CHECK_C and
|
||||
ATF_CHECK_CXX) to provide a consistent way of defining a --with-arg flag
|
||||
in configure scripts and detecting the presence of any of the ATF
|
||||
bindings. Note that ATF_CHECK_SH was already introduced in 0.14, but it
|
||||
has now been modified to also honor --with-atf if instantiated.
|
||||
|
||||
* Added timing support to atf-run / atf-report.
|
||||
|
||||
* Added support for a 'require.memory' property, to specify the minimum
|
||||
amount of physical memory needed by the test case to yield valid results.
|
||||
|
||||
* PR bin/45690: Force an ISO-8859-1 encoding in the XML files generated by
|
||||
atf-report so that invalid data in the output of test cases does not
|
||||
mangle our report.
|
||||
|
||||
|
||||
Changes in version 0.14
|
||||
***********************
|
||||
|
||||
|
2
external/bsd/atf/dist/atf-c++.hpp
vendored
2
external/bsd/atf/dist/atf-c++.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/atf-c++-api.3
vendored
2
external/bsd/atf/dist/atf-c++/atf-c++-api.3
vendored
@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/check.cpp
vendored
2
external/bsd/atf/dist/atf-c++/check.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/check.hpp
vendored
2
external/bsd/atf/dist/atf-c++/check.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/check_test.cpp
vendored
2
external/bsd/atf/dist/atf-c++/check_test.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/config.cpp
vendored
2
external/bsd/atf/dist/atf-c++/config.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/config.hpp
vendored
2
external/bsd/atf/dist/atf-c++/config.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010, 2011 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -41,6 +41,10 @@ extern "C" {
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
extern "C" {
|
||||
#include "atf-c/defs.h"
|
||||
}
|
||||
|
||||
#include "application.hpp"
|
||||
#include "sanity.hpp"
|
||||
#include "ui.hpp"
|
||||
@ -151,7 +155,8 @@ impl::app::specific_options(void)
|
||||
}
|
||||
|
||||
void
|
||||
impl::app::process_option(int ch, const char* arg)
|
||||
impl::app::process_option(int ch ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const char* arg ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
ATF_REQUIRE(zflag);
|
||||
ATF_REQUIRE_EQ(1, argc - optind);
|
||||
ATF_REQUIRE_EQ(std::string("foo"), argv[optind]);
|
||||
|
||||
|
2
external/bsd/atf/dist/atf-c++/detail/env.cpp
vendored
2
external/bsd/atf/dist/atf-c++/detail/env.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/detail/env.hpp
vendored
2
external/bsd/atf/dist/atf-c++/detail/env.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/detail/fs.cpp
vendored
2
external/bsd/atf/dist/atf-c++/detail/fs.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/detail/fs.hpp
vendored
2
external/bsd/atf/dist/atf-c++/detail/fs.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -65,7 +65,7 @@ build_check_cxx_o(const atf::tests::tc& tc, const char* sfile,
|
||||
}
|
||||
|
||||
void
|
||||
header_check(const atf::tests::tc& tc, const char *hdrname)
|
||||
header_check(const char *hdrname)
|
||||
{
|
||||
std::ofstream srcfile("test.c");
|
||||
ATF_REQUIRE(srcfile);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -53,7 +53,7 @@
|
||||
} \
|
||||
ATF_TEST_CASE_BODY(name) \
|
||||
{ \
|
||||
header_check(*this, hdrname); \
|
||||
header_check(hdrname); \
|
||||
}
|
||||
|
||||
#define BUILD_TC(name, sfile, descr, failmsg) \
|
||||
@ -73,7 +73,7 @@ class tc;
|
||||
}
|
||||
}
|
||||
|
||||
void header_check(const atf::tests::tc&, const char*);
|
||||
void header_check(const char*);
|
||||
void build_check_cxx_o(const atf::tests::tc&, const char*, const char*);
|
||||
atf::fs::path get_process_helpers_path(const atf::tests::tc&);
|
||||
bool grep_file(const char*, const char*);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -310,6 +310,29 @@ ATF_TEST_CASE_BODY(to_bool)
|
||||
ATF_REQUIRE_THROW(std::runtime_error, to_bool("false2"));
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(to_bytes);
|
||||
ATF_TEST_CASE_HEAD(to_bytes)
|
||||
{
|
||||
set_md_var("descr", "Tests the to_bytes function");
|
||||
}
|
||||
ATF_TEST_CASE_BODY(to_bytes)
|
||||
{
|
||||
using atf::text::to_bytes;
|
||||
|
||||
ATF_REQUIRE_EQ(0, to_bytes("0"));
|
||||
ATF_REQUIRE_EQ(12345, to_bytes("12345"));
|
||||
ATF_REQUIRE_EQ(2 * 1024, to_bytes("2k"));
|
||||
ATF_REQUIRE_EQ(4 * 1024 * 1024, to_bytes("4m"));
|
||||
ATF_REQUIRE_EQ(int64_t(8) * 1024 * 1024 * 1024, to_bytes("8g"));
|
||||
ATF_REQUIRE_EQ(int64_t(16) * 1024 * 1024 * 1024 * 1024, to_bytes("16t"));
|
||||
|
||||
ATF_REQUIRE_THROW_RE(std::runtime_error, "Empty", to_bytes(""));
|
||||
ATF_REQUIRE_THROW_RE(std::runtime_error, "Unknown size unit 'd'",
|
||||
to_bytes("12d"));
|
||||
ATF_REQUIRE_THROW(std::runtime_error, to_bytes(" "));
|
||||
ATF_REQUIRE_THROW(std::runtime_error, to_bytes(" k"));
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(to_string);
|
||||
ATF_TEST_CASE_HEAD(to_string)
|
||||
{
|
||||
@ -335,6 +358,7 @@ ATF_TEST_CASE_BODY(to_type)
|
||||
|
||||
ATF_REQUIRE_EQ(to_type< int >("0"), 0);
|
||||
ATF_REQUIRE_EQ(to_type< int >("1234"), 1234);
|
||||
ATF_REQUIRE_THROW(std::runtime_error, to_type< int >(" "));
|
||||
ATF_REQUIRE_THROW(std::runtime_error, to_type< int >("0 a"));
|
||||
ATF_REQUIRE_THROW(std::runtime_error, to_type< int >("a"));
|
||||
|
||||
@ -360,6 +384,7 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
ATF_ADD_TEST_CASE(tcs, split_delims);
|
||||
ATF_ADD_TEST_CASE(tcs, trim);
|
||||
ATF_ADD_TEST_CASE(tcs, to_bool);
|
||||
ATF_ADD_TEST_CASE(tcs, to_bytes);
|
||||
ATF_ADD_TEST_CASE(tcs, to_string);
|
||||
ATF_ADD_TEST_CASE(tcs, to_type);
|
||||
}
|
||||
|
2
external/bsd/atf/dist/atf-c++/detail/ui.cpp
vendored
2
external/bsd/atf/dist/atf-c++/detail/ui.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/detail/ui.hpp
vendored
2
external/bsd/atf/dist/atf-c++/detail/ui.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/macros.hpp
vendored
2
external/bsd/atf/dist/atf-c++/macros.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
52
external/bsd/atf/dist/atf-c++/macros_test.cpp
vendored
52
external/bsd/atf/dist/atf-c++/macros_test.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -51,7 +51,7 @@ extern "C" {
|
||||
|
||||
static
|
||||
void
|
||||
create_ctl_file(const atf::tests::tc& tc, const char *name)
|
||||
create_ctl_file(const char *name)
|
||||
{
|
||||
ATF_REQUIRE(open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644) != -1);
|
||||
}
|
||||
@ -67,9 +67,9 @@ ATF_TEST_CASE_HEAD(h_pass)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_pass)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_PASS();
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_fail);
|
||||
@ -79,9 +79,9 @@ ATF_TEST_CASE_HEAD(h_fail)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_fail)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_FAIL("Failed on purpose");
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_skip);
|
||||
@ -91,9 +91,9 @@ ATF_TEST_CASE_HEAD(h_skip)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_skip)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_SKIP("Skipped on purpose");
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require);
|
||||
@ -105,9 +105,9 @@ ATF_TEST_CASE_BODY(h_require)
|
||||
{
|
||||
bool condition = atf::text::to_bool(get_config_var("condition"));
|
||||
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_REQUIRE(condition);
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_eq);
|
||||
@ -120,9 +120,9 @@ ATF_TEST_CASE_BODY(h_require_eq)
|
||||
long v1 = atf::text::to_type< long >(get_config_var("v1"));
|
||||
long v2 = atf::text::to_type< long >(get_config_var("v2"));
|
||||
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_REQUIRE_EQ(v1, v2);
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_in);
|
||||
@ -139,9 +139,9 @@ ATF_TEST_CASE_BODY(h_require_in)
|
||||
collection.insert("bar");
|
||||
collection.insert("baz");
|
||||
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_REQUIRE_IN(element, collection);
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_match);
|
||||
@ -154,9 +154,9 @@ ATF_TEST_CASE_BODY(h_require_match)
|
||||
const std::string regexp = get_config_var("regexp");
|
||||
const std::string string = get_config_var("string");
|
||||
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_REQUIRE_MATCH(regexp, string);
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_not_in);
|
||||
@ -173,9 +173,9 @@ ATF_TEST_CASE_BODY(h_require_not_in)
|
||||
collection.insert("bar");
|
||||
collection.insert("baz");
|
||||
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
ATF_REQUIRE_NOT_IN(element, collection);
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_throw);
|
||||
@ -185,7 +185,7 @@ ATF_TEST_CASE_HEAD(h_require_throw)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_require_throw)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
|
||||
if (get_config_var("what") == "throw_int")
|
||||
ATF_REQUIRE_THROW(std::runtime_error, if (1) throw int(5));
|
||||
@ -196,7 +196,7 @@ ATF_TEST_CASE_BODY(h_require_throw)
|
||||
ATF_REQUIRE_THROW(std::runtime_error,
|
||||
if (0) throw std::runtime_error("e"));
|
||||
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_throw_re);
|
||||
@ -206,7 +206,7 @@ ATF_TEST_CASE_HEAD(h_require_throw_re)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_require_throw_re)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
|
||||
if (get_config_var("what") == "throw_int")
|
||||
ATF_REQUIRE_THROW_RE(std::runtime_error, "5", if (1) throw int(5));
|
||||
@ -220,7 +220,7 @@ ATF_TEST_CASE_BODY(h_require_throw_re)
|
||||
ATF_REQUIRE_THROW_RE(std::runtime_error, "e",
|
||||
if (0) throw std::runtime_error("e"));
|
||||
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
static int
|
||||
@ -243,7 +243,7 @@ ATF_TEST_CASE_HEAD(h_check_errno)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_check_errno)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
|
||||
if (get_config_var("what") == "no_error")
|
||||
ATF_CHECK_ERRNO(-1, errno_ok_stub() == -1);
|
||||
@ -254,7 +254,7 @@ ATF_TEST_CASE_BODY(h_check_errno)
|
||||
else
|
||||
UNREACHABLE;
|
||||
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
ATF_TEST_CASE(h_require_errno);
|
||||
@ -264,7 +264,7 @@ ATF_TEST_CASE_HEAD(h_require_errno)
|
||||
}
|
||||
ATF_TEST_CASE_BODY(h_require_errno)
|
||||
{
|
||||
create_ctl_file(*this, "before");
|
||||
create_ctl_file("before");
|
||||
|
||||
if (get_config_var("what") == "no_error")
|
||||
ATF_REQUIRE_ERRNO(-1, errno_ok_stub() == -1);
|
||||
@ -275,7 +275,7 @@ ATF_TEST_CASE_BODY(h_require_errno)
|
||||
else
|
||||
UNREACHABLE;
|
||||
|
||||
create_ctl_file(*this, "after");
|
||||
create_ctl_file("after");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||
# Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/tests_test.cpp
vendored
2
external/bsd/atf/dist/atf-c++/tests_test.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c++/utils.hpp
vendored
2
external/bsd/atf/dist/atf-c++/utils.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
8
external/bsd/atf/dist/atf-c++/utils_test.cpp
vendored
8
external/bsd/atf/dist/atf-c++/utils_test.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -29,6 +29,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "atf-c/defs.h"
|
||||
|
||||
#include "macros.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
@ -51,7 +53,7 @@ public:
|
||||
return atf::utils::auto_array< test_array >(ta);
|
||||
}
|
||||
|
||||
void* operator new(size_t size)
|
||||
void* operator new(size_t size ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ATF_FAIL("New called but should have been new[]");
|
||||
return new int(5);
|
||||
@ -65,7 +67,7 @@ public:
|
||||
return mem;
|
||||
}
|
||||
|
||||
void operator delete(void* mem)
|
||||
void operator delete(void* mem ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ATF_FAIL("Delete called but should have been delete[]");
|
||||
}
|
||||
|
2
external/bsd/atf/dist/atf-c/atf-c-api.3
vendored
2
external/bsd/atf/dist/atf-c/atf-c-api.3
vendored
@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/atf_c_test.c
vendored
2
external/bsd/atf/dist/atf-c/atf_c_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
5
external/bsd/atf/dist/atf-c/check.c
vendored
5
external/bsd/atf/dist/atf-c/check.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -301,14 +301,11 @@ atf_check_result_init(atf_check_result_t *r, const char *const *argv,
|
||||
const atf_fs_path_t *dir)
|
||||
{
|
||||
atf_error_t err;
|
||||
const char *workdir;
|
||||
|
||||
r->pimpl = malloc(sizeof(struct atf_check_result_impl));
|
||||
if (r->pimpl == NULL)
|
||||
return atf_no_memory_error();
|
||||
|
||||
workdir = atf_config_get("atf_workdir");
|
||||
|
||||
err = array_to_list(argv, &r->pimpl->m_argv);
|
||||
if (atf_is_error(err))
|
||||
goto out;
|
||||
|
2
external/bsd/atf/dist/atf-c/check.h
vendored
2
external/bsd/atf/dist/atf-c/check.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/check_test.c
vendored
2
external/bsd/atf/dist/atf-c/check_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/config.c
vendored
2
external/bsd/atf/dist/atf-c/config.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/config_test.c
vendored
2
external/bsd/atf/dist/atf-c/config_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/dynstr.c
vendored
2
external/bsd/atf/dist/atf-c/detail/dynstr.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/dynstr.h
vendored
2
external/bsd/atf/dist/atf-c/detail/dynstr.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/env.c
vendored
2
external/bsd/atf/dist/atf-c/detail/env.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
5
external/bsd/atf/dist/atf-c/detail/fs.c
vendored
5
external/bsd/atf/dist/atf-c/detail/fs.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -46,6 +46,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "atf-c/defs.h"
|
||||
#include "atf-c/error.h"
|
||||
|
||||
#include "fs.h"
|
||||
@ -584,7 +585,7 @@ atf_fs_stat_copy(atf_fs_stat_t *dest, const atf_fs_stat_t *src)
|
||||
}
|
||||
|
||||
void
|
||||
atf_fs_stat_fini(atf_fs_stat_t *st)
|
||||
atf_fs_stat_fini(atf_fs_stat_t *st ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/fs.h
vendored
2
external/bsd/atf/dist/atf-c/detail/fs.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/fs_test.c
vendored
2
external/bsd/atf/dist/atf-c/detail/fs_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/list.c
vendored
2
external/bsd/atf/dist/atf-c/detail/list.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/list.h
vendored
2
external/bsd/atf/dist/atf-c/detail/list.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/map.c
vendored
2
external/bsd/atf/dist/atf-c/detail/map.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/map.h
vendored
2
external/bsd/atf/dist/atf-c/detail/map.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -52,7 +52,7 @@ struct atf_fs_path;
|
||||
} \
|
||||
ATF_TC_BODY(name, tc) \
|
||||
{ \
|
||||
header_check(tc, hdrname); \
|
||||
header_check(hdrname); \
|
||||
}
|
||||
|
||||
#define BUILD_TC(name, sfile, descr, failmsg) \
|
||||
@ -67,7 +67,7 @@ struct atf_fs_path;
|
||||
}
|
||||
|
||||
void build_check_c_o(const atf_tc_t *, const char *, const char *);
|
||||
void header_check(const atf_tc_t *, const char *);
|
||||
void header_check(const char *);
|
||||
void get_process_helpers_path(const atf_tc_t *, const bool,
|
||||
struct atf_fs_path *);
|
||||
bool grep_string(const struct atf_dynstr *, const char *);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/text.c
vendored
2
external/bsd/atf/dist/atf-c/detail/text.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/text.h
vendored
2
external/bsd/atf/dist/atf-c/detail/text.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -97,7 +97,7 @@ word_acum(const char *word, void *data)
|
||||
|
||||
static
|
||||
atf_error_t
|
||||
word_count(const char *word, void *data)
|
||||
word_count(const char *word ATF_DEFS_ATTRIBUTE_UNUSED, void *data)
|
||||
{
|
||||
size_t *counter = data;
|
||||
|
||||
@ -113,7 +113,7 @@ struct fail_at {
|
||||
|
||||
static
|
||||
atf_error_t
|
||||
word_fail_at(const char *word, void *data)
|
||||
word_fail_at(const char *word ATF_DEFS_ATTRIBUTE_UNUSED, void *data)
|
||||
{
|
||||
struct fail_at *fa = data;
|
||||
atf_error_t err;
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/tp_main.c
vendored
2
external/bsd/atf/dist/atf-c/detail/tp_main.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/user.c
vendored
2
external/bsd/atf/dist/atf-c/detail/user.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/detail/user.h
vendored
2
external/bsd/atf/dist/atf-c/detail/user.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/error.c
vendored
2
external/bsd/atf/dist/atf-c/error.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/error.h
vendored
2
external/bsd/atf/dist/atf-c/error.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
6
external/bsd/atf/dist/atf-c/error_test.c
vendored
6
external/bsd/atf/dist/atf-c/error_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -34,6 +34,7 @@
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include "atf-c/defs.h"
|
||||
#include "atf-c/error.h"
|
||||
|
||||
#include "detail/test_helpers.h"
|
||||
@ -44,7 +45,8 @@
|
||||
|
||||
static
|
||||
void
|
||||
test_format(const atf_error_t err, char *buf, size_t buflen)
|
||||
test_format(const atf_error_t err ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
char *buf, size_t buflen)
|
||||
{
|
||||
snprintf(buf, buflen, "Test formatting function");
|
||||
}
|
||||
|
7
external/bsd/atf/dist/atf-c/macros.h
vendored
7
external/bsd/atf/dist/atf-c/macros.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -30,6 +30,7 @@
|
||||
#if !defined(ATF_C_MACROS_H)
|
||||
#define ATF_C_MACROS_H
|
||||
|
||||
#include <atf-c/defs.h>
|
||||
#include <atf-c/tc.h>
|
||||
#include <atf-c/tp.h>
|
||||
#include <atf-c/utils.h>
|
||||
@ -84,7 +85,7 @@
|
||||
#define ATF_TC_BODY(tc, tcptr) \
|
||||
static \
|
||||
void \
|
||||
atfu_ ## tc ## _body(const atf_tc_t *tcptr)
|
||||
atfu_ ## tc ## _body(const atf_tc_t *tcptr ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
|
||||
#define ATF_TC_BODY_NAME(tc) \
|
||||
(atfu_ ## tc ## _body)
|
||||
@ -92,7 +93,7 @@
|
||||
#define ATF_TC_CLEANUP(tc, tcptr) \
|
||||
static \
|
||||
void \
|
||||
atfu_ ## tc ## _cleanup(const atf_tc_t *tcptr)
|
||||
atfu_ ## tc ## _cleanup(const atf_tc_t *tcptr ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
|
||||
#define ATF_TC_CLEANUP_NAME(tc) \
|
||||
(atfu_ ## tc ## _cleanup)
|
||||
|
14
external/bsd/atf/dist/atf-c/macros_h_test.c
vendored
14
external/bsd/atf/dist/atf-c/macros_h_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -84,20 +84,20 @@ atf_require_errno_semicolons(void)
|
||||
#define TEST_MACRO_2 invalid + name
|
||||
#define TEST_MACRO_3 invalid + name
|
||||
ATF_TC(TEST_MACRO_1);
|
||||
ATF_TC_HEAD(TEST_MACRO_1, tc) { }
|
||||
ATF_TC_BODY(TEST_MACRO_1, tc) { }
|
||||
ATF_TC_HEAD(TEST_MACRO_1, tc) { if (tc != NULL) {} }
|
||||
ATF_TC_BODY(TEST_MACRO_1, tc) { if (tc != NULL) {} }
|
||||
atf_tc_t *test_name_1 = &ATF_TC_NAME(TEST_MACRO_1);
|
||||
void (*head_1)(atf_tc_t *) = ATF_TC_HEAD_NAME(TEST_MACRO_1);
|
||||
void (*body_1)(const atf_tc_t *) = ATF_TC_BODY_NAME(TEST_MACRO_1);
|
||||
ATF_TC_WITH_CLEANUP(TEST_MACRO_2);
|
||||
ATF_TC_HEAD(TEST_MACRO_2, tc) { }
|
||||
ATF_TC_BODY(TEST_MACRO_2, tc) { }
|
||||
ATF_TC_CLEANUP(TEST_MACRO_2, tc) { }
|
||||
ATF_TC_HEAD(TEST_MACRO_2, tc) { if (tc != NULL) {} }
|
||||
ATF_TC_BODY(TEST_MACRO_2, tc) { if (tc != NULL) {} }
|
||||
ATF_TC_CLEANUP(TEST_MACRO_2, tc) { if (tc != NULL) {} }
|
||||
atf_tc_t *test_name_2 = &ATF_TC_NAME(TEST_MACRO_2);
|
||||
void (*head_2)(atf_tc_t *) = ATF_TC_HEAD_NAME(TEST_MACRO_2);
|
||||
void (*body_2)(const atf_tc_t *) = ATF_TC_BODY_NAME(TEST_MACRO_2);
|
||||
void (*cleanup_2)(const atf_tc_t *) = ATF_TC_CLEANUP_NAME(TEST_MACRO_2);
|
||||
ATF_TC_WITHOUT_HEAD(TEST_MACRO_3);
|
||||
ATF_TC_BODY(TEST_MACRO_3, tc) { }
|
||||
ATF_TC_BODY(TEST_MACRO_3, tc) { if (tc != NULL) {} }
|
||||
atf_tc_t *test_name_3 = &ATF_TC_NAME(TEST_MACRO_3);
|
||||
void (*body_3)(const atf_tc_t *) = ATF_TC_BODY_NAME(TEST_MACRO_3);
|
||||
|
12
external/bsd/atf/dist/atf-c/macros_test.c
vendored
12
external/bsd/atf/dist/atf-c/macros_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
static
|
||||
void
|
||||
create_ctl_file(const atf_tc_t *tc, const char *name)
|
||||
create_ctl_file(const char *name)
|
||||
{
|
||||
atf_fs_path_t p;
|
||||
|
||||
@ -100,9 +100,9 @@ init_and_run_h_tc(const char *name, void (*head)(atf_tc_t *),
|
||||
} \
|
||||
ATF_TC_BODY(h_ ## id, tc) \
|
||||
{ \
|
||||
create_ctl_file(tc, "before"); \
|
||||
create_ctl_file("before"); \
|
||||
macro; \
|
||||
create_ctl_file(tc, "after"); \
|
||||
create_ctl_file("after"); \
|
||||
}
|
||||
|
||||
#define H_CHECK_HEAD_NAME(id) ATF_TC_HEAD_NAME(h_check_ ## id)
|
||||
@ -678,14 +678,14 @@ ATF_TC_BODY(require_streq, tc)
|
||||
|
||||
static
|
||||
bool
|
||||
aux_bool(const char *fmt)
|
||||
aux_bool(const char *fmt ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static
|
||||
const char *
|
||||
aux_str(const char *fmt)
|
||||
aux_str(const char *fmt ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return "foo";
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
|
||||
# Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
|
10
external/bsd/atf/dist/atf-c/tc_test.c
vendored
10
external/bsd/atf/dist/atf-c/tc_test.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -39,6 +39,10 @@
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
ATF_TC_HEAD(empty, tc)
|
||||
{
|
||||
if (tc != NULL) {}
|
||||
}
|
||||
ATF_TC_BODY(empty, tc)
|
||||
{
|
||||
}
|
||||
|
||||
@ -47,10 +51,6 @@ ATF_TC_HEAD(test_var, tc)
|
||||
atf_tc_set_md_var(tc, "test-var", "Test text");
|
||||
}
|
||||
|
||||
ATF_TC_BODY(empty, tc)
|
||||
{
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
* Test cases for the "atf_tc_t" type.
|
||||
* --------------------------------------------------------------------- */
|
||||
|
2
external/bsd/atf/dist/atf-c/tp.c
vendored
2
external/bsd/atf/dist/atf-c/tp.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-c/tp.h
vendored
2
external/bsd/atf/dist/atf-c/tp.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Automated Testing Framework (atf)
|
||||
*
|
||||
* Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
1
external/bsd/atf/dist/atf-c/tp_test.c
vendored
1
external/bsd/atf/dist/atf-c/tp_test.c
vendored
@ -73,6 +73,7 @@ ATF_TC_BODY(getopt, tc)
|
||||
}
|
||||
}
|
||||
|
||||
ATF_REQUIRE(zflag);
|
||||
ATF_REQUIRE_EQ_MSG(1, argc - optind, "Invalid number of arguments left "
|
||||
"after the call to getopt(3)");
|
||||
ATF_CHECK_STREQ_MSG("foo", argv[optind], "The non-option argument is "
|
||||
|
@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -32,6 +32,10 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
extern "C" {
|
||||
#include "atf-c/defs.h"
|
||||
}
|
||||
|
||||
#include "atf-c++/config.hpp"
|
||||
|
||||
#include "atf-c++/detail/application.hpp"
|
||||
@ -67,7 +71,7 @@ atf_config::atf_config(void) :
|
||||
}
|
||||
|
||||
void
|
||||
atf_config::process_option(int ch, const char* arg)
|
||||
atf_config::process_option(int ch, const char* arg ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
switch (ch) {
|
||||
case 't':
|
||||
|
12
external/bsd/atf/dist/atf-report/atf-report.1
vendored
12
external/bsd/atf/dist/atf-report/atf-report.1
vendored
@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
@ -26,7 +26,7 @@
|
||||
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd October 29, 2007
|
||||
.Dd December 16, 2011
|
||||
.Dt ATF-REPORT 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -98,7 +98,7 @@ A machine-parseable Comma-Separated Values (CSV) file.
|
||||
This file contains the results for all test cases and test programs.
|
||||
Test cases are logged using the following syntax:
|
||||
.Bd -literal -offset indent
|
||||
tc, test-program, test-case, result[, reason]
|
||||
tc, duration, test-program, test-case, result[, reason]
|
||||
.Ed
|
||||
.Pp
|
||||
The
|
||||
@ -112,7 +112,7 @@ The last two are always followed by a reason.
|
||||
.Pp
|
||||
Test programs are logged with the following syntax:
|
||||
.Bd -literal -offset indent
|
||||
tp, test-program, result[, reason]
|
||||
tp, duration, test-program, result[, reason]
|
||||
.Ed
|
||||
.Pp
|
||||
In this case, the
|
||||
@ -125,8 +125,10 @@ which refers to test programs in which one or more test cases failed;
|
||||
or
|
||||
.Sq bogus ,
|
||||
which mentions those test programs that failed to execute by some reason.
|
||||
The reason file is only available in the last case.
|
||||
The reason field is only available in the last case.
|
||||
.Pp
|
||||
The time required to execute each test case and test program is
|
||||
also provided.
|
||||
You should not rely on the order of the entries in the resulting output.
|
||||
.It ticker
|
||||
A user-friendly report that shows the progress of the test suite's
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
159
external/bsd/atf/dist/atf-report/integration_test.sh
vendored
159
external/bsd/atf/dist/atf-report/integration_test.sh
vendored
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automated Testing Framework (atf)
|
||||
#
|
||||
# Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
# Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -117,48 +117,51 @@ EOF
|
||||
|
||||
# NO_CHECK_STYLE_BEGIN
|
||||
cat >expout <<EOF
|
||||
tc, expect_helpers, death_and_exit, expected_death, Exit case
|
||||
tc, expect_helpers, death_and_signal, expected_death, Signal case
|
||||
tc, expect_helpers, death_but_pass, failed, Test case was expected to terminate abruptly but it continued execution
|
||||
tc, expect_helpers, exit_any_and_exit, expected_exit, Call will exit
|
||||
tc, expect_helpers, exit_but_pass, failed, Test case was expected to exit cleanly but it continued execution
|
||||
tc, expect_helpers, exit_code_and_exit, expected_exit, Call will exit
|
||||
tc, expect_helpers, fail_and_fail_check, expected_failure, And fail again: 2 checks failed as expected; see output for more details
|
||||
tc, expect_helpers, fail_and_fail_requirement, expected_failure, Fail reason: The failure
|
||||
tc, expect_helpers, fail_but_pass, failed, Test case was expecting a failure but none were raised
|
||||
tc, expect_helpers, pass_and_pass, passed
|
||||
tc, expect_helpers, pass_but_fail_check, failed, 1 checks failed; see output for more details
|
||||
tc, expect_helpers, pass_but_fail_requirement, failed, Some reason
|
||||
tc, expect_helpers, signal_any_and_signal, expected_signal, Call will signal
|
||||
tc, expect_helpers, signal_but_pass, failed, Test case was expected to receive a termination signal but it continued execution
|
||||
tc, expect_helpers, signal_no_and_signal, expected_signal, Call will signal
|
||||
tc, expect_helpers, timeout_and_hang, expected_timeout, Will overrun
|
||||
tc, expect_helpers, timeout_but_pass, failed, Test case was expected to hang but it continued execution
|
||||
tp, expect_helpers, failed
|
||||
tc, #.#, expect_helpers, death_and_exit, expected_death, Exit case
|
||||
tc, #.#, expect_helpers, death_and_signal, expected_death, Signal case
|
||||
tc, #.#, expect_helpers, death_but_pass, failed, Test case was expected to terminate abruptly but it continued execution
|
||||
tc, #.#, expect_helpers, exit_any_and_exit, expected_exit, Call will exit
|
||||
tc, #.#, expect_helpers, exit_but_pass, failed, Test case was expected to exit cleanly but it continued execution
|
||||
tc, #.#, expect_helpers, exit_code_and_exit, expected_exit, Call will exit
|
||||
tc, #.#, expect_helpers, fail_and_fail_check, expected_failure, And fail again: 2 checks failed as expected; see output for more details
|
||||
tc, #.#, expect_helpers, fail_and_fail_requirement, expected_failure, Fail reason: The failure
|
||||
tc, #.#, expect_helpers, fail_but_pass, failed, Test case was expecting a failure but none were raised
|
||||
tc, #.#, expect_helpers, pass_and_pass, passed
|
||||
tc, #.#, expect_helpers, pass_but_fail_check, failed, 1 checks failed; see output for more details
|
||||
tc, #.#, expect_helpers, pass_but_fail_requirement, failed, Some reason
|
||||
tc, #.#, expect_helpers, signal_any_and_signal, expected_signal, Call will signal
|
||||
tc, #.#, expect_helpers, signal_but_pass, failed, Test case was expected to receive a termination signal but it continued execution
|
||||
tc, #.#, expect_helpers, signal_no_and_signal, expected_signal, Call will signal
|
||||
tc, #.#, expect_helpers, timeout_and_hang, expected_timeout, Will overrun
|
||||
tc, #.#, expect_helpers, timeout_but_pass, failed, Test case was expected to hang but it continued execution
|
||||
tp, #.#, expect_helpers, failed
|
||||
EOF
|
||||
# NO_CHECK_STYLE_END
|
||||
atf_check -s eq:0 -o file:expout -e empty -x "atf-report -o csv:- <tps.out"
|
||||
atf_check -s eq:0 -o file:expout -e empty -x \
|
||||
"atf-report -o csv:- <tps.out | " \
|
||||
"sed -E -e 's/[0-9]+.[0-9]{6}, /#.#, /'"
|
||||
|
||||
# NO_CHECK_STYLE_BEGIN
|
||||
cat >expout <<EOF
|
||||
expect_helpers (1/1): 17 test cases
|
||||
death_and_exit: Expected failure: Exit case
|
||||
death_and_signal: Expected failure: Signal case
|
||||
death_but_pass: Failed: Test case was expected to terminate abruptly but it continued execution
|
||||
exit_any_and_exit: Expected failure: Call will exit
|
||||
exit_but_pass: Failed: Test case was expected to exit cleanly but it continued execution
|
||||
exit_code_and_exit: Expected failure: Call will exit
|
||||
fail_and_fail_check: Expected failure: And fail again: 2 checks failed as expected; see output for more details
|
||||
fail_and_fail_requirement: Expected failure: Fail reason: The failure
|
||||
fail_but_pass: Failed: Test case was expecting a failure but none were raised
|
||||
pass_and_pass: Passed.
|
||||
pass_but_fail_check: Failed: 1 checks failed; see output for more details
|
||||
pass_but_fail_requirement: Failed: Some reason
|
||||
signal_any_and_signal: Expected failure: Call will signal
|
||||
signal_but_pass: Failed: Test case was expected to receive a termination signal but it continued execution
|
||||
signal_no_and_signal: Expected failure: Call will signal
|
||||
timeout_and_hang: Expected failure: Will overrun
|
||||
timeout_but_pass: Failed: Test case was expected to hang but it continued execution
|
||||
death_and_exit: [#.#s] Expected failure: Exit case
|
||||
death_and_signal: [#.#s] Expected failure: Signal case
|
||||
death_but_pass: [#.#s] Failed: Test case was expected to terminate abruptly but it continued execution
|
||||
exit_any_and_exit: [#.#s] Expected failure: Call will exit
|
||||
exit_but_pass: [#.#s] Failed: Test case was expected to exit cleanly but it continued execution
|
||||
exit_code_and_exit: [#.#s] Expected failure: Call will exit
|
||||
fail_and_fail_check: [#.#s] Expected failure: And fail again: 2 checks failed as expected; see output for more details
|
||||
fail_and_fail_requirement: [#.#s] Expected failure: Fail reason: The failure
|
||||
fail_but_pass: [#.#s] Failed: Test case was expecting a failure but none were raised
|
||||
pass_and_pass: [#.#s] Passed.
|
||||
pass_but_fail_check: [#.#s] Failed: 1 checks failed; see output for more details
|
||||
pass_but_fail_requirement: [#.#s] Failed: Some reason
|
||||
signal_any_and_signal: [#.#s] Expected failure: Call will signal
|
||||
signal_but_pass: [#.#s] Failed: Test case was expected to receive a termination signal but it continued execution
|
||||
signal_no_and_signal: [#.#s] Expected failure: Call will signal
|
||||
timeout_and_hang: [#.#s] Expected failure: Will overrun
|
||||
timeout_but_pass: [#.#s] Failed: Test case was expected to hang but it continued execution
|
||||
[#.#s]
|
||||
|
||||
Test cases for known bugs:
|
||||
expect_helpers:death_and_exit: Exit case
|
||||
@ -182,7 +185,8 @@ Summary for 1 test programs:
|
||||
EOF
|
||||
# NO_CHECK_STYLE_END
|
||||
atf_check -s eq:0 -o file:expout -e empty -x \
|
||||
"atf-report -o ticker:- <tps.out"
|
||||
"atf-report -o ticker:- <tps.out | " \
|
||||
"sed -E -e 's/[0-9]+.[0-9]{6}/#.#/'"
|
||||
|
||||
# Just ensure that this does not crash for now...
|
||||
atf_check -s eq:0 -o ignore -e empty -x "atf-report -o xml:- <tps.out"
|
||||
@ -253,19 +257,20 @@ output_csv_body()
|
||||
|
||||
# NO_CHECK_STYLE_BEGIN
|
||||
cat >expout <<EOF
|
||||
tc, dir1/tp1, main, passed
|
||||
tp, dir1/tp1, passed
|
||||
tc, dir1/tp2, main, failed, This always fails
|
||||
tp, dir1/tp2, failed
|
||||
tc, tp3, main, passed
|
||||
tp, tp3, passed
|
||||
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, #.#, dir1/tp1, main, passed
|
||||
tp, #.#, dir1/tp1, passed
|
||||
tc, #.#, dir1/tp2, main, failed, This always fails
|
||||
tp, #.#, dir1/tp2, failed
|
||||
tc, #.#, tp3, main, passed
|
||||
tp, #.#, tp3, passed
|
||||
tc, #.#, tp4, main, failed, This always fails
|
||||
tp, #.#, tp4, failed
|
||||
tp, #.#, tp5, bogus, Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:'
|
||||
EOF
|
||||
# NO_CHECK_STYLE_END
|
||||
|
||||
atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o csv:- <tps.out'
|
||||
atf_check -s eq:0 -o file:expout -e empty -x \
|
||||
"atf-report -o csv:- <tps.out | sed -E -e 's/[0-9]+.[0-9]{6}, /#.#, /'"
|
||||
}
|
||||
|
||||
atf_test_case output_ticker
|
||||
@ -281,19 +286,24 @@ output_ticker_body()
|
||||
# NO_CHECK_STYLE_BEGIN
|
||||
cat >expout <<EOF
|
||||
dir1/tp1 (1/5): 1 test cases
|
||||
main: Passed.
|
||||
main: [#.#s] Passed.
|
||||
[#.#s]
|
||||
|
||||
dir1/tp2 (2/5): 1 test cases
|
||||
main: Failed: This always fails
|
||||
main: [#.#s] Failed: This always fails
|
||||
[#.#s]
|
||||
|
||||
tp3 (3/5): 1 test cases
|
||||
main: Passed.
|
||||
main: [#.#s] Passed.
|
||||
[#.#s]
|
||||
|
||||
tp4 (4/5): 1 test cases
|
||||
main: Failed: This always fails
|
||||
main: [#.#s] Failed: This always fails
|
||||
[#.#s]
|
||||
|
||||
tp5 (5/5): 0 test cases
|
||||
tp5: BOGUS TEST PROGRAM: Cannot trust its results because of \`Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:''
|
||||
[#.#s]
|
||||
|
||||
Failed (bogus) test programs:
|
||||
tp5
|
||||
@ -308,7 +318,8 @@ Summary for 5 test programs:
|
||||
0 skipped test cases.
|
||||
EOF
|
||||
|
||||
atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o ticker:- <tps.out'
|
||||
atf_check -s eq:0 -o file:expout -e empty -x \
|
||||
"atf-report -o ticker:- <tps.out | sed -E -e 's/[0-9]+.[0-9]{6}/#.#/'"
|
||||
}
|
||||
# NO_CHECK_STYLE_END
|
||||
|
||||
@ -324,7 +335,7 @@ output_xml_body()
|
||||
|
||||
# NO_CHECK_STYLE_BEGIN
|
||||
cat >expout <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE tests-results PUBLIC "-//NetBSD//DTD ATF Tests Results 0.1//EN" "http://www.NetBSD.org/XML/atf/tests-results.dtd">
|
||||
|
||||
<tests-results>
|
||||
@ -332,32 +343,33 @@ output_xml_body()
|
||||
<tp id="dir1/tp1">
|
||||
<tc id="main">
|
||||
<passed />
|
||||
</tc>
|
||||
</tp>
|
||||
<tc-time>#.#</tc-time></tc>
|
||||
<tp-time>#.#</tp-time></tp>
|
||||
<tp id="dir1/tp2">
|
||||
<tc id="main">
|
||||
<failed>This always fails</failed>
|
||||
</tc>
|
||||
</tp>
|
||||
<tc-time>#.#</tc-time></tc>
|
||||
<tp-time>#.#</tp-time></tp>
|
||||
<tp id="tp3">
|
||||
<tc id="main">
|
||||
<passed />
|
||||
</tc>
|
||||
</tp>
|
||||
<tc-time>#.#</tc-time></tc>
|
||||
<tp-time>#.#</tp-time></tp>
|
||||
<tp id="tp4">
|
||||
<tc id="main">
|
||||
<failed>This always fails</failed>
|
||||
</tc>
|
||||
</tp>
|
||||
<tc-time>#.#</tc-time></tc>
|
||||
<tp-time>#.#</tp-time></tp>
|
||||
<tp id="tp5">
|
||||
<failed>Invalid format for test case list: 1: Unexpected token \`<<NEWLINE>>'; expected \`:'</failed>
|
||||
</tp>
|
||||
<tp-time>#.#</tp-time></tp>
|
||||
<info class="endinfo">Another value</info>
|
||||
</tests-results>
|
||||
EOF
|
||||
# NO_CHECK_STYLE_END
|
||||
|
||||
atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o xml:- <tps.out'
|
||||
atf_check -s eq:0 -o file:expout -e empty -x \
|
||||
"atf-report -o xml:- < tps.out | sed -E -e 's/>[0-9]+.[0-9]{6}</>#.#</'"
|
||||
}
|
||||
|
||||
atf_test_case output_xml_space
|
||||
@ -380,7 +392,7 @@ EOF
|
||||
|
||||
# NO_CHECK_STYLE_BEGIN
|
||||
cat >expout <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE tests-results PUBLIC "-//NetBSD//DTD ATF Tests Results 0.1//EN" "http://www.NetBSD.org/XML/atf/tests-results.dtd">
|
||||
|
||||
<tests-results>
|
||||
@ -400,15 +412,25 @@ EOF
|
||||
<so> </so>
|
||||
<so> EOF</so>
|
||||
<passed />
|
||||
</tc>
|
||||
</tp>
|
||||
<tc-time>#.#</tc-time></tc>
|
||||
<tp-time>#.#</tp-time></tp>
|
||||
<info class="endinfo">Another value</info>
|
||||
</tests-results>
|
||||
EOF
|
||||
# NO_CHECK_STYLE_END
|
||||
|
||||
run_helpers
|
||||
atf_check -s eq:0 -o file:expout -e empty -x 'atf-report -o xml:- <tps.out'
|
||||
atf_check -s eq:0 -o file:expout -e empty -x \
|
||||
"atf-report -o xml:- <tps.out | sed -E -e 's/>[0-9]+.[0-9]{6}</>#.#</'"
|
||||
}
|
||||
|
||||
atf_test_case too_many_args
|
||||
too_many_args_body()
|
||||
{
|
||||
cat >experr <<EOF
|
||||
atf-report: ERROR: No arguments allowed
|
||||
EOF
|
||||
atf_check -s eq:1 -o empty -e file:experr atf-report foo
|
||||
}
|
||||
|
||||
atf_init_test_cases()
|
||||
@ -420,6 +442,7 @@ atf_init_test_cases()
|
||||
atf_add_test_case output_ticker
|
||||
atf_add_test_case output_xml
|
||||
atf_add_test_case output_xml_space
|
||||
atf_add_test_case too_many_args
|
||||
}
|
||||
|
||||
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
99
external/bsd/atf/dist/atf-report/reader.cpp
vendored
99
external/bsd/atf/dist/atf-report/reader.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -27,10 +27,16 @@
|
||||
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
extern "C" {
|
||||
#include <sys/time.h>
|
||||
}
|
||||
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include "atf-c/defs.h"
|
||||
|
||||
#include "atf-c++/detail/parser.hpp"
|
||||
#include "atf-c++/detail/sanity.hpp"
|
||||
#include "atf-c++/detail/text.hpp"
|
||||
@ -44,12 +50,12 @@ namespace impl = atf::atf_report;
|
||||
// Auxiliary functions.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
static
|
||||
size_t
|
||||
string_to_size_t(const std::string& str)
|
||||
template< typename Type >
|
||||
Type
|
||||
string_to_int(const std::string& str)
|
||||
{
|
||||
std::istringstream ss(str);
|
||||
size_t s;
|
||||
Type s;
|
||||
ss >> s;
|
||||
|
||||
return s;
|
||||
@ -112,6 +118,24 @@ public:
|
||||
|
||||
} // namespace atf_tps
|
||||
|
||||
struct timeval
|
||||
read_timeval(atf::parser::parser< atf_tps::tokenizer >& parser)
|
||||
{
|
||||
using namespace atf_tps;
|
||||
|
||||
atf::parser::token t = parser.expect(text_type, "timestamp");
|
||||
const std::string::size_type divider = t.text().find('.');
|
||||
if (divider == std::string::npos || divider == 0 ||
|
||||
divider == t.text().length() - 1)
|
||||
throw atf::parser::parse_error(t.lineno(),
|
||||
"Malformed timestamp value " + t.text());
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = string_to_int< long >(t.text().substr(0, divider));
|
||||
tv.tv_usec = string_to_int< long >(t.text().substr(divider + 1));
|
||||
return tv;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// The "atf_tps_reader" class.
|
||||
// ------------------------------------------------------------------------
|
||||
@ -126,44 +150,54 @@ impl::atf_tps_reader::~atf_tps_reader(void)
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_info(const std::string& what,
|
||||
const std::string& val)
|
||||
impl::atf_tps_reader::got_info(
|
||||
const std::string& what ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& val ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_ntps(size_t ntps)
|
||||
impl::atf_tps_reader::got_ntps(size_t ntps ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_tp_start(const std::string& tp, size_t ntcs)
|
||||
impl::atf_tps_reader::got_tp_start(
|
||||
const std::string& tp ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
size_t ntcs ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_tp_end(const std::string& reason)
|
||||
impl::atf_tps_reader::got_tp_end(
|
||||
struct timeval* tv ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& reason ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_tc_start(const std::string& tcname)
|
||||
impl::atf_tps_reader::got_tc_start(
|
||||
const std::string& tcname ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_tc_stdout_line(const std::string& line)
|
||||
impl::atf_tps_reader::got_tc_stdout_line(
|
||||
const std::string& line ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_tc_stderr_line(const std::string& line)
|
||||
impl::atf_tps_reader::got_tc_stderr_line(
|
||||
const std::string& line ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
impl::atf_tps_reader::got_tc_end(const std::string& state,
|
||||
const std::string& reason)
|
||||
impl::atf_tps_reader::got_tc_end(
|
||||
const std::string& state ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
struct timeval* tv ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& reason ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
@ -206,13 +240,17 @@ impl::atf_tps_reader::read_tp(void* pptr)
|
||||
|
||||
t = p.expect(colon_type, "`:'");
|
||||
|
||||
struct timeval s1 = read_timeval(p);
|
||||
|
||||
t = p.expect(comma_type, "`,'");
|
||||
|
||||
t = p.expect(text_type, "test program name");
|
||||
std::string tpname = t.text();
|
||||
|
||||
t = p.expect(comma_type, "`,'");
|
||||
|
||||
t = p.expect(text_type, "number of test programs");
|
||||
size_t ntcs = string_to_size_t(t.text());
|
||||
size_t ntcs = string_to_int< std::size_t >(t.text());
|
||||
|
||||
t = p.expect(nl_type, "new line");
|
||||
|
||||
@ -232,6 +270,13 @@ impl::atf_tps_reader::read_tp(void* pptr)
|
||||
|
||||
t = p.expect(colon_type, "`:'");
|
||||
|
||||
struct timeval s2 = read_timeval(p);
|
||||
|
||||
struct timeval s3;
|
||||
timersub(&s2, &s1, &s3);
|
||||
|
||||
t = p.expect(comma_type, "`,'");
|
||||
|
||||
t = p.expect(text_type, "test program name");
|
||||
if (t.text() != tpname)
|
||||
throw parse_error(t.lineno(), "Test program name used in "
|
||||
@ -249,7 +294,7 @@ impl::atf_tps_reader::read_tp(void* pptr)
|
||||
t = p.next();
|
||||
}
|
||||
|
||||
ATF_PARSER_CALLBACK(p, got_tp_end(reason));
|
||||
ATF_PARSER_CALLBACK(p, got_tp_end(&s3, reason));
|
||||
}
|
||||
|
||||
void
|
||||
@ -266,8 +311,13 @@ impl::atf_tps_reader::read_tc(void* pptr)
|
||||
|
||||
t = p.expect(colon_type, "`:'");
|
||||
|
||||
struct timeval s1 = read_timeval(p);
|
||||
|
||||
t = p.expect(comma_type, "`,'");
|
||||
|
||||
t = p.expect(text_type, "test case name");
|
||||
std::string tcname = t.text();
|
||||
|
||||
ATF_PARSER_CALLBACK(p, got_tc_start(tcname));
|
||||
|
||||
t = p.expect(nl_type, "new line");
|
||||
@ -297,6 +347,13 @@ impl::atf_tps_reader::read_tc(void* pptr)
|
||||
|
||||
t = p.expect(colon_type, "`:'");
|
||||
|
||||
struct timeval s2 = read_timeval(p);
|
||||
|
||||
struct timeval s3;
|
||||
timersub(&s2, &s1, &s3);
|
||||
|
||||
t = p.expect(comma_type, "`,'");
|
||||
|
||||
t = p.expect(text_type, "test case name");
|
||||
if (t.text() != tcname)
|
||||
throw parse_error(t.lineno(),
|
||||
@ -310,7 +367,7 @@ impl::atf_tps_reader::read_tc(void* pptr)
|
||||
skipped_type, "expected_{death,exit,failure,signal,timeout}, failed, "
|
||||
"passed or skipped");
|
||||
if (t.type() == passed_type) {
|
||||
ATF_PARSER_CALLBACK(p, got_tc_end("passed", ""));
|
||||
ATF_PARSER_CALLBACK(p, got_tc_end("passed", &s3, ""));
|
||||
} else {
|
||||
std::string state;
|
||||
if (t.type() == expected_death_type) state = "expected_death";
|
||||
@ -327,7 +384,7 @@ impl::atf_tps_reader::read_tc(void* pptr)
|
||||
if (reason.empty())
|
||||
throw parse_error(t.lineno(), "Empty reason for " + state +
|
||||
" test case result");
|
||||
ATF_PARSER_CALLBACK(p, got_tc_end(state, reason));
|
||||
ATF_PARSER_CALLBACK(p, got_tc_end(state, &s3, reason));
|
||||
}
|
||||
|
||||
t = p.expect(nl_type, "new line");
|
||||
@ -341,7 +398,7 @@ impl::atf_tps_reader::read(void)
|
||||
|
||||
std::pair< size_t, atf::parser::headers_map > hml =
|
||||
atf::parser::read_headers(m_is, 1);
|
||||
atf::parser::validate_content_type(hml.second, "application/X-atf-tps", 2);
|
||||
atf::parser::validate_content_type(hml.second, "application/X-atf-tps", 3);
|
||||
|
||||
tokenizer tkz(m_is, hml.first);
|
||||
atf::parser::parser< tokenizer > p(tkz);
|
||||
@ -356,7 +413,7 @@ impl::atf_tps_reader::read(void)
|
||||
t = p.expect(colon_type, "`:'");
|
||||
|
||||
t = p.expect(text_type, "number of test programs");
|
||||
size_t ntps = string_to_size_t(t.text());
|
||||
size_t ntps = string_to_int< std::size_t >(t.text());
|
||||
ATF_PARSER_CALLBACK(p, got_ntps(ntps));
|
||||
|
||||
t = p.expect(nl_type, "new line");
|
||||
|
11
external/bsd/atf/dist/atf-report/reader.hpp
vendored
11
external/bsd/atf/dist/atf-report/reader.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -30,6 +30,10 @@
|
||||
#if !defined(_ATF_REPORT_FORMATS_HPP_)
|
||||
#define _ATF_REPORT_FORMATS_HPP_
|
||||
|
||||
extern "C" {
|
||||
#include <sys/time.h>
|
||||
}
|
||||
|
||||
#include <istream>
|
||||
#include <string>
|
||||
|
||||
@ -65,12 +69,13 @@ protected:
|
||||
virtual void got_info(const std::string&, const std::string&);
|
||||
virtual void got_ntps(size_t);
|
||||
virtual void got_tp_start(const std::string&, size_t);
|
||||
virtual void got_tp_end(const std::string&);
|
||||
virtual void got_tp_end(struct timeval*, const std::string&);
|
||||
|
||||
virtual void got_tc_start(const std::string&);
|
||||
virtual void got_tc_stdout_line(const std::string&);
|
||||
virtual void got_tc_stderr_line(const std::string&);
|
||||
virtual void got_tc_end(const std::string&, const std::string&);
|
||||
virtual void got_tc_end(const std::string&, struct timeval*,
|
||||
const std::string&);
|
||||
virtual void got_eof(void);
|
||||
|
||||
public:
|
||||
|
330
external/bsd/atf/dist/atf-report/reader_test.cpp
vendored
330
external/bsd/atf/dist/atf-report/reader_test.cpp
vendored
@ -65,7 +65,8 @@ class tps_reader : protected impl::atf_tps_reader {
|
||||
}
|
||||
|
||||
void
|
||||
got_tp_end(const std::string& reason)
|
||||
got_tp_end(struct timeval* tv ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& reason)
|
||||
{
|
||||
m_calls.push_back("got_tp_end(" + reason + ")");
|
||||
}
|
||||
@ -77,7 +78,9 @@ class tps_reader : protected impl::atf_tps_reader {
|
||||
}
|
||||
|
||||
void
|
||||
got_tc_end(const std::string& state, const std::string& reason)
|
||||
got_tc_end(const std::string& state,
|
||||
struct timeval* tv ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& reason)
|
||||
{
|
||||
const std::string r = state + (reason.empty() ? "" : ", " + reason);
|
||||
m_calls.push_back("got_tc_end(" + r + ")");
|
||||
@ -120,7 +123,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_1);
|
||||
ATF_TEST_CASE_BODY(tps_1)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 0\n"
|
||||
;
|
||||
@ -142,13 +145,13 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_2);
|
||||
ATF_TEST_CASE_BODY(tps_2)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 2\n"
|
||||
"tp-start: first-prog, 0\n"
|
||||
"tp-end: first-prog\n"
|
||||
"tp-start: second-prog, 0\n"
|
||||
"tp-end: second-prog, This program failed\n"
|
||||
"tp-start: 123.456, first-prog, 0\n"
|
||||
"tp-end: 123.567, first-prog\n"
|
||||
"tp-start: 123.678, second-prog, 0\n"
|
||||
"tp-end: 123.789, second-prog, This program failed\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -172,37 +175,37 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_3);
|
||||
ATF_TEST_CASE_BODY(tps_3)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 2\n"
|
||||
"tp-start: first-prog, 3\n"
|
||||
"tc-start: first-test\n"
|
||||
"tc-end: first-test, passed\n"
|
||||
"tc-start: second-test\n"
|
||||
"tc-end: second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: third-test\n"
|
||||
"tc-end: third-test, failed, Testing failed reason\n"
|
||||
"tp-end: first-prog\n"
|
||||
"tp-start: second-prog, 3\n"
|
||||
"tc-start: first-test\n"
|
||||
"tp-start: 123.123, first-prog, 3\n"
|
||||
"tc-start: 123.234, first-test\n"
|
||||
"tc-end: 123.345, first-test, passed\n"
|
||||
"tc-start: 123.456, second-test\n"
|
||||
"tc-end: 123.567, second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: 123.678, third.test\n"
|
||||
"tc-end: 123.789, third.test, failed, Testing failed reason\n"
|
||||
"tp-end: 123.890, first-prog\n"
|
||||
"tp-start: 124.901, second-prog, 3\n"
|
||||
"tc-start: 124.1012, first-test\n"
|
||||
"tc-so:first stdout line for 1st test\n"
|
||||
"tc-se:first stderr line for 1st test\n"
|
||||
"tc-so:second stdout line for 1st test\n"
|
||||
"tc-se:second stderr line for 1st test\n"
|
||||
"tc-end: first-test, passed\n"
|
||||
"tc-start: second-test\n"
|
||||
"tc-end: 124.1123, first-test, passed\n"
|
||||
"tc-start: 124.1234, second-test\n"
|
||||
"tc-so:first stdout line for 2nd test\n"
|
||||
"tc-se:first stderr line for 2nd test\n"
|
||||
"tc-so:second stdout line for 2nd test\n"
|
||||
"tc-se:second stderr line for 2nd test\n"
|
||||
"tc-end: second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: third-test\n"
|
||||
"tc-end: 124.1345, second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: 124.1456, third.test\n"
|
||||
"tc-so:first stdout line for 3rd test\n"
|
||||
"tc-se:first stderr line for 3rd test\n"
|
||||
"tc-so:second stdout line for 3rd test\n"
|
||||
"tc-se:second stderr line for 3rd test\n"
|
||||
"tc-end: third-test, failed, Testing failed reason\n"
|
||||
"tp-end: second-prog, This program failed\n"
|
||||
"tc-end: 124.1567, third.test, failed, Testing failed reason\n"
|
||||
"tp-end: 124.1678, second-prog, This program failed\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -212,7 +215,7 @@ ATF_TEST_CASE_BODY(tps_3)
|
||||
"got_tc_end(passed)",
|
||||
"got_tc_start(second-test)",
|
||||
"got_tc_end(skipped, Testing skipped reason)",
|
||||
"got_tc_start(third-test)",
|
||||
"got_tc_start(third.test)",
|
||||
"got_tc_end(failed, Testing failed reason)",
|
||||
"got_tp_end()",
|
||||
"got_tp_start(second-prog, 3)",
|
||||
@ -228,7 +231,7 @@ ATF_TEST_CASE_BODY(tps_3)
|
||||
"got_tc_stdout_line(second stdout line for 2nd test)",
|
||||
"got_tc_stderr_line(second stderr line for 2nd test)",
|
||||
"got_tc_end(skipped, Testing skipped reason)",
|
||||
"got_tc_start(third-test)",
|
||||
"got_tc_start(third.test)",
|
||||
"got_tc_stdout_line(first stdout line for 3rd test)",
|
||||
"got_tc_stderr_line(first stderr line for 3rd test)",
|
||||
"got_tc_stdout_line(second stdout line for 3rd test)",
|
||||
@ -250,40 +253,40 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_4);
|
||||
ATF_TEST_CASE_BODY(tps_4)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a, foo\n"
|
||||
"info: b, bar\n"
|
||||
"info: c, baz\n"
|
||||
"tps-count: 2\n"
|
||||
"tp-start: first-prog, 3\n"
|
||||
"tc-start: first-test\n"
|
||||
"tc-end: first-test, passed\n"
|
||||
"tc-start: second-test\n"
|
||||
"tc-end: second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: third-test\n"
|
||||
"tc-end: third-test, failed, Testing failed reason\n"
|
||||
"tp-end: first-prog\n"
|
||||
"tp-start: second-prog, 3\n"
|
||||
"tc-start: first-test\n"
|
||||
"tp-start: 234.1, first-prog, 3\n"
|
||||
"tc-start: 234.12, first-test\n"
|
||||
"tc-end: 234.23, first-test, passed\n"
|
||||
"tc-start: 234.34, second-test\n"
|
||||
"tc-end: 234.45, second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: 234.56, third-test\n"
|
||||
"tc-end: 234.67, third-test, failed, Testing failed reason\n"
|
||||
"tp-end: 234.78, first-prog\n"
|
||||
"tp-start: 234.89, second-prog, 3\n"
|
||||
"tc-start: 234.90, first-test\n"
|
||||
"tc-so:first stdout line for 1st test\n"
|
||||
"tc-se:first stderr line for 1st test\n"
|
||||
"tc-so:second stdout line for 1st test\n"
|
||||
"tc-se:second stderr line for 1st test\n"
|
||||
"tc-end: first-test, passed\n"
|
||||
"tc-start: second-test\n"
|
||||
"tc-end: 234.101, first-test, passed\n"
|
||||
"tc-start: 234.112, second-test\n"
|
||||
"tc-so:first stdout line for 2nd test\n"
|
||||
"tc-se:first stderr line for 2nd test\n"
|
||||
"tc-so:second stdout line for 2nd test\n"
|
||||
"tc-se:second stderr line for 2nd test\n"
|
||||
"tc-end: second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: third-test\n"
|
||||
"tc-end: 234.123, second-test, skipped, Testing skipped reason\n"
|
||||
"tc-start: 234.134, third-test\n"
|
||||
"tc-so:first stdout line for 3rd test\n"
|
||||
"tc-se:first stderr line for 3rd test\n"
|
||||
"tc-so:second stdout line for 3rd test\n"
|
||||
"tc-se:second stderr line for 3rd test\n"
|
||||
"tc-end: third-test, failed, Testing failed reason\n"
|
||||
"tp-end: second-prog, This program failed\n"
|
||||
"tc-end: 234.145, third-test, failed, Testing failed reason\n"
|
||||
"tp-end: 234.156, second-prog, This program failed\n"
|
||||
"info: d, foo\n"
|
||||
"info: e, bar\n"
|
||||
"info: f, baz\n"
|
||||
@ -340,11 +343,11 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_5);
|
||||
ATF_TEST_CASE_BODY(tps_5)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"tp-start: the-prog, 1\n"
|
||||
"tc-start: the-test\n"
|
||||
"tp-start: 345.123, the-prog, 1\n"
|
||||
"tc-start: 345.134, the-test\n"
|
||||
"tc-so:--- a 2007-11-04 14:00:41.000000000 +0100\n"
|
||||
"tc-so:+++ b 2007-11-04 14:00:48.000000000 +0100\n"
|
||||
"tc-so:@@ -1,7 +1,7 @@\n"
|
||||
@ -357,8 +360,8 @@ ATF_TEST_CASE_BODY(tps_5)
|
||||
"tc-so:+Second modified line.\n"
|
||||
"tc-so: \n"
|
||||
"tc-so: EOF\n"
|
||||
"tc-end: the-test, passed\n"
|
||||
"tp-end: the-prog\n"
|
||||
"tc-end: 345.145, the-test, passed\n"
|
||||
"tp-end: 345.156, the-prog\n"
|
||||
;
|
||||
|
||||
// NO_CHECK_STYLE_BEGIN
|
||||
@ -396,27 +399,27 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_6);
|
||||
ATF_TEST_CASE_BODY(tps_6)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"tp-start: the-prog, 8\n"
|
||||
"tc-start: one\n"
|
||||
"tc-end: one, expected_death, The reason\n"
|
||||
"tc-start: two\n"
|
||||
"tc-end: two, expected_exit, This would be an exit\n"
|
||||
"tc-start: three\n"
|
||||
"tc-end: three, expected_failure, And this a failure\n"
|
||||
"tc-start: four\n"
|
||||
"tc-end: four, expected_signal, And this a signal\n"
|
||||
"tc-start: five\n"
|
||||
"tc-end: five, failed, Another reason\n"
|
||||
"tc-start: six\n"
|
||||
"tc-end: six, passed\n"
|
||||
"tc-start: seven\n"
|
||||
"tc-end: seven, skipped, Skipping it\n"
|
||||
"tc-start: eight\n"
|
||||
"tc-end: eight, expected_timeout, Some hang reason\n"
|
||||
"tp-end: the-prog\n"
|
||||
"tp-start: 321.1, the-prog, 8\n"
|
||||
"tc-start: 321.12, one\n"
|
||||
"tc-end: 321.23, one, expected_death, The reason\n"
|
||||
"tc-start: 321.34, two\n"
|
||||
"tc-end: 321.45, two, expected_exit, This would be an exit\n"
|
||||
"tc-start: 321.56, three\n"
|
||||
"tc-end: 321.67, three, expected_failure, And this a failure\n"
|
||||
"tc-start: 321.78, four\n"
|
||||
"tc-end: 321.89, four, expected_signal, And this a signal\n"
|
||||
"tc-start: 321.90, five\n"
|
||||
"tc-end: 321.101, five, failed, Another reason\n"
|
||||
"tc-start: 321.112, six\n"
|
||||
"tc-end: 321.123, six, passed\n"
|
||||
"tc-start: 321.134, seven\n"
|
||||
"tc-end: 321.145, seven, skipped, Skipping it\n"
|
||||
"tc-start: 321.156, eight\n"
|
||||
"tc-end: 321.167, eight, expected_timeout, Some hang reason\n"
|
||||
"tp-end: 321.178, the-prog\n"
|
||||
;
|
||||
|
||||
// NO_CHECK_STYLE_BEGIN
|
||||
@ -457,7 +460,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_50);
|
||||
ATF_TEST_CASE_BODY(tps_50)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"foo\n"
|
||||
;
|
||||
@ -478,7 +481,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_51);
|
||||
ATF_TEST_CASE_BODY(tps_51)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count\n"
|
||||
;
|
||||
@ -499,7 +502,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_52);
|
||||
ATF_TEST_CASE_BODY(tps_52)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count:\n"
|
||||
;
|
||||
@ -520,7 +523,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_53);
|
||||
ATF_TEST_CASE_BODY(tps_53)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"foo\n"
|
||||
@ -543,24 +546,36 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_54);
|
||||
ATF_TEST_CASE_BODY(tps_54)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"foo\n"
|
||||
"tp-start\n"
|
||||
"tp-start:\n"
|
||||
"tp-start: foo\n"
|
||||
"tp-start: foo,\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-start: 123\n"
|
||||
"tp-start: 123.\n"
|
||||
"tp-start: 123.456\n"
|
||||
"tp-start: 123.456,\n"
|
||||
"tp-start: 123.456, foo\n"
|
||||
"tp-start: 123.456, foo,\n"
|
||||
"tp-start: 123.456, foo, 0\n"
|
||||
"bar\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-start: 456.789, foo, 0\n"
|
||||
"tp-end\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end:\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-end: bar\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-end: foo,\n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end: 777\n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end: 777.\n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end: 777.888\n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end: 777.888, \n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end: 777.888, bar\n"
|
||||
"tp-start: 777.777, foo, 0\n"
|
||||
"tp-end: 777.888, foo,\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -571,14 +586,23 @@ ATF_TEST_CASE_BODY(tps_54)
|
||||
const char* exp_errors[] = {
|
||||
"4: Unexpected token `foo'; expected start of test program",
|
||||
"5: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"6: Unexpected token `<<NEWLINE>>'; expected test program name",
|
||||
"7: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"8: Unexpected token `<<NEWLINE>>'; expected number of test programs",
|
||||
"10: Unexpected token `bar'; expected end of test program",
|
||||
"12: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"14: Unexpected token `<<NEWLINE>>'; expected test program name",
|
||||
"16: Test program name used in terminator does not match opening",
|
||||
"18: Empty reason for failed test program",
|
||||
"6: Unexpected token `<<NEWLINE>>'; expected timestamp",
|
||||
"7: Malformed timestamp value 123",
|
||||
"8: Malformed timestamp value 123.",
|
||||
"9: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"10: Unexpected token `<<NEWLINE>>'; expected test program name",
|
||||
"11: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"12: Unexpected token `<<NEWLINE>>'; expected number of test programs",
|
||||
"14: Unexpected token `bar'; expected end of test program",
|
||||
"16: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"18: Unexpected token `<<NEWLINE>>'; expected timestamp",
|
||||
"20: Malformed timestamp value 777",
|
||||
"22: Malformed timestamp value 777.",
|
||||
"24: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
|
||||
"26: Unexpected token `<<NEWLINE>>'; expected test program name",
|
||||
"28: Test program name used in terminator does not match opening",
|
||||
"30: Empty reason for failed test program",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -589,26 +613,38 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_55);
|
||||
ATF_TEST_CASE_BODY(tps_55)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"tp-start: foo, 1\n"
|
||||
"tp-start: 100.200, foo, 1\n"
|
||||
"foo\n"
|
||||
"tc-start\n"
|
||||
"tc-start:\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-start: 111\n"
|
||||
"tc-start: 111.\n"
|
||||
"tc-start: 111.222\n"
|
||||
"tc-start: 111.222,\n"
|
||||
"tc-start: 111.222, foo\n"
|
||||
"bar\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-start: 111.333, foo\n"
|
||||
"tc-end\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end:\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-end: bar\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-end: foo\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-end: foo,\n"
|
||||
"tp-end: foo\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111.\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111.555\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111.555, \n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111.555, bar\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111.555, foo\n"
|
||||
"tc-start: 111.444, foo\n"
|
||||
"tc-end: 111.555, foo,\n"
|
||||
"tp-end: 111.666, foo\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -621,14 +657,22 @@ ATF_TEST_CASE_BODY(tps_55)
|
||||
const char* exp_errors[] = {
|
||||
"5: Unexpected token `foo'; expected start of test case",
|
||||
"6: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"7: Unexpected token `<<NEWLINE>>'; expected test case name",
|
||||
"9: Unexpected token `bar'; expected end of test case or test case's stdout/stderr line",
|
||||
"11: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"13: Unexpected token `<<NEWLINE>>'; expected test case name",
|
||||
"15: Test case name used in terminator does not match opening",
|
||||
"17: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"19: Unexpected token `<<NEWLINE>>'; expected expected_{death,exit,failure,signal,timeout}, failed, passed or skipped",
|
||||
"20: Unexpected token `tp-end'; expected start of test case",
|
||||
"7: Unexpected token `<<NEWLINE>>'; expected timestamp",
|
||||
"8: Malformed timestamp value 111",
|
||||
"9: Malformed timestamp value 111.",
|
||||
"10: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"11: Unexpected token `<<NEWLINE>>'; expected test case name",
|
||||
"13: Unexpected token `bar'; expected end of test case or test case's stdout/stderr line",
|
||||
"15: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"17: Unexpected token `<<NEWLINE>>'; expected timestamp",
|
||||
"19: Malformed timestamp value 111",
|
||||
"21: Malformed timestamp value 111.",
|
||||
"23: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"25: Unexpected token `<<NEWLINE>>'; expected test case name",
|
||||
"27: Test case name used in terminator does not match opening",
|
||||
"29: Unexpected token `<<NEWLINE>>'; expected `,'",
|
||||
"31: Unexpected token `<<NEWLINE>>'; expected expected_{death,exit,failure,signal,timeout}, failed, passed or skipped",
|
||||
"32: Unexpected token `tp-end'; expected start of test case",
|
||||
NULL
|
||||
};
|
||||
// NO_CHECK_STYLE_END
|
||||
@ -640,23 +684,23 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_56);
|
||||
ATF_TEST_CASE_BODY(tps_56)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"tp-start: foo, 1\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-end: foo, passe\n"
|
||||
"tc-start: foo\n"
|
||||
"tc-end: foo, passed,\n"
|
||||
"tc-start: bar\n"
|
||||
"tc-end: bar, failed\n"
|
||||
"tc-start: bar\n"
|
||||
"tc-end: bar, failed,\n"
|
||||
"tc-start: baz\n"
|
||||
"tc-end: baz, skipped\n"
|
||||
"tc-start: baz\n"
|
||||
"tc-end: baz, skipped,\n"
|
||||
"tp-end: foo\n"
|
||||
"tp-start: 111.222, foo, 1\n"
|
||||
"tc-start: 111.333, foo\n"
|
||||
"tc-end: 111.444, foo, passe\n"
|
||||
"tc-start: 111.333, foo\n"
|
||||
"tc-end: 111.444, foo, passed,\n"
|
||||
"tc-start: 111.555, bar\n"
|
||||
"tc-end: 111.666, bar, failed\n"
|
||||
"tc-start: 111.555, bar\n"
|
||||
"tc-end: 111.666, bar, failed,\n"
|
||||
"tc-start: 111.555, baz\n"
|
||||
"tc-end: 111.666, baz, skipped\n"
|
||||
"tc-start: 111.555, baz\n"
|
||||
"tc-end: 111.666, baz, skipped,\n"
|
||||
"tp-end: 111.777, foo\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -686,11 +730,11 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_57);
|
||||
ATF_TEST_CASE_BODY(tps_57)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 2\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-end: foo\n"
|
||||
"tp-start: 111.222, foo, 0\n"
|
||||
"tp-end: 111.333, foo\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -712,13 +756,13 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_58);
|
||||
ATF_TEST_CASE_BODY(tps_58)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"tps-count: 1\n"
|
||||
"tp-start: foo, 0\n"
|
||||
"tp-end: foo\n"
|
||||
"tp-start: bar, 0\n"
|
||||
"tp-end: bar\n"
|
||||
"tp-start: 111.222, foo, 0\n"
|
||||
"tp-end: 111.333, foo\n"
|
||||
"tp-start: 111.444, bar, 0\n"
|
||||
"tp-end: 111.555, bar\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
@ -740,7 +784,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_59);
|
||||
ATF_TEST_CASE_BODY(tps_59)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info\n"
|
||||
;
|
||||
@ -761,7 +805,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_60);
|
||||
ATF_TEST_CASE_BODY(tps_60)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info:\n"
|
||||
;
|
||||
@ -782,7 +826,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_61);
|
||||
ATF_TEST_CASE_BODY(tps_61)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a\n"
|
||||
;
|
||||
@ -803,7 +847,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_62);
|
||||
ATF_TEST_CASE_BODY(tps_62)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a,\n"
|
||||
;
|
||||
@ -825,7 +869,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_63);
|
||||
ATF_TEST_CASE_BODY(tps_63)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a, b\n"
|
||||
;
|
||||
@ -847,19 +891,21 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_64);
|
||||
ATF_TEST_CASE_BODY(tps_64)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a, b\n"
|
||||
"info: a.b.c.def, g\n"
|
||||
"tps-count\n"
|
||||
;
|
||||
|
||||
const char* exp_calls[] = {
|
||||
"got_info(a, b)",
|
||||
"got_info(a.b.c.def, g)",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char* exp_errors[] = {
|
||||
"4: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
"5: Unexpected token `<<NEWLINE>>'; expected `:'",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -870,7 +916,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_65);
|
||||
ATF_TEST_CASE_BODY(tps_65)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a, b\n"
|
||||
"tps-count:\n"
|
||||
@ -893,7 +939,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(tps_66);
|
||||
ATF_TEST_CASE_BODY(tps_66)
|
||||
{
|
||||
const char* input =
|
||||
"Content-Type: application/X-atf-tps; version=\"2\"\n"
|
||||
"Content-Type: application/X-atf-tps; version=\"3\"\n"
|
||||
"\n"
|
||||
"info: a, b\n"
|
||||
"tps-count: 0\n"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
++ Automated Testing Framework (atf)
|
||||
++
|
||||
++ Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
++ Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
++ All rights reserved.
|
||||
++
|
||||
++ Redistribution and use in source and binary forms, with or without
|
||||
|
2
external/bsd/atf/dist/atf-run/atf-run.1
vendored
2
external/bsd/atf/dist/atf-run/atf-run.1
vendored
@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" Automated Testing Framework (atf)
|
||||
.\"
|
||||
.\" Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
|
18
external/bsd/atf/dist/atf-run/atffile.cpp
vendored
18
external/bsd/atf/dist/atf-run/atffile.cpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@ -29,6 +29,8 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include "atf-c/defs.h"
|
||||
|
||||
#include "atf-c++/detail/exceptions.hpp"
|
||||
#include "atf-c++/detail/expand.hpp"
|
||||
#include "atf-c++/detail/parser.hpp"
|
||||
@ -90,19 +92,23 @@ detail::atf_atffile_reader::~atf_atffile_reader(void)
|
||||
}
|
||||
|
||||
void
|
||||
detail::atf_atffile_reader::got_conf(const std::string& name,
|
||||
const std::string& val)
|
||||
detail::atf_atffile_reader::got_conf(
|
||||
const std::string& name ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& val ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
detail::atf_atffile_reader::got_prop(const std::string& name,
|
||||
const std::string& val)
|
||||
detail::atf_atffile_reader::got_prop(
|
||||
const std::string& name ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
const std::string& val ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
detail::atf_atffile_reader::got_tp(const std::string& name, bool isglob)
|
||||
detail::atf_atffile_reader::got_tp(
|
||||
const std::string& name ATF_DEFS_ATTRIBUTE_UNUSED,
|
||||
bool isglob ATF_DEFS_ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
2
external/bsd/atf/dist/atf-run/atffile.hpp
vendored
2
external/bsd/atf/dist/atf-run/atffile.hpp
vendored
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Automated Testing Framework (atf)
|
||||
//
|
||||
// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
|
||||
// Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user