Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/atf/dist Import atf-0.13:
details: https://anonhg.NetBSD.org/src/rev/2b7fac99c68e
branches: trunk
changeset: 763714:2b7fac99c68e
user: jmmv <jmmv%NetBSD.org@localhost>
date: Thu Mar 31 16:41:07 2011 +0000
description:
Import atf-0.13:
Experimental version released on March 31st, 2011.
This is the first release after the creation of the Kyua project, a more
modular and reliable replacement for ATF. From now on, ATF will change to
accomodate the transition to this new codebase, but ATF will still continue
to see development in the short/medium term. Check out the project page at
http://code.google.com/p/kyua/ for more details.
The changes in this release are:
* Added support to run the tests with the Kyua runtime engine (kyua-cli), a
new package that aims to replace atf-run and atf-report. The ATF tests
can be run with the new system by issuing a 'make installcheck-kyua' from
the top-level directory of the project (assuming the 'kyua' binary is
available during the configuration stage of ATF).
* atf-run and atf-report are now in maintenance mode (but *not* deprecated
yet!). Kyua already implements a new, much more reliable runtime engine
that provides similar features to these tools. That said, it is not
complete yet so all development efforts should go towards it.
* If GDB is installed, atf-run dumps the stack trace of crashing test
programs in an attempt to aid debugging. Contributed by Antti Kantee.
* Reverted default timeout change in previous release and reset its value
to 5 minutes. This was causing several issues, specially when running
the existing NetBSD test suite in qemu.
* Fixed the 'match' output checker in atf-check to properly validate the
last line of a file even if it does not have a newline.
* Added the ATF_REQUIRE_IN and ATF_REQUIRE_NOT_IN macros to atf-c++ to
check for the presence (or lack thereof) of an element in a collection.
* PR bin/44176: Fixed a race condition in atf-run that would crash atf-run
when the cleanup of a test case triggered asynchronous modifications to
its work directory (e.g. killing a daemon process that cleans up a pid
file in the work directory).
* PR bin/44301: Fixed the sample XSLT file to report bogus test programs
instead of just listing them as having 0 test cases.
diffstat:
external/bsd/atf/dist/COPYING | 2 +-
external/bsd/atf/dist/Kyuafile | 11 +
external/bsd/atf/dist/NEWS | 46 +++++
external/bsd/atf/dist/atf-c++/Kyuafile | 14 +
external/bsd/atf/dist/atf-c++/atf-c++-api.3 | 14 +-
external/bsd/atf/dist/atf-c++/detail/Kyuafile | 13 +
external/bsd/atf/dist/atf-c++/detail/application.cpp | 4 +-
external/bsd/atf/dist/atf-c++/detail/exceptions.cpp | 1 +
external/bsd/atf/dist/atf-c++/detail/exceptions.hpp | 1 +
external/bsd/atf/dist/atf-c++/detail/exceptions_test.cpp | 1 +
external/bsd/atf/dist/atf-c++/detail/ui.cpp | 1 +
external/bsd/atf/dist/atf-c++/macros.hpp | 6 +
external/bsd/atf/dist/atf-c++/macros_test.cpp | 128 +++++++++++++++
external/bsd/atf/dist/atf-c/Kyuafile | 16 +
external/bsd/atf/dist/atf-c/atf-c-api.3 | 24 ++-
external/bsd/atf/dist/atf-c/detail/Kyuafile | 14 +
external/bsd/atf/dist/atf-c/detail/tp_main.c | 5 +-
external/bsd/atf/dist/atf-config/Kyuafile | 5 +
external/bsd/atf/dist/atf-report/Kyuafile | 6 +
external/bsd/atf/dist/atf-run/Kyuafile | 13 +
external/bsd/atf/dist/atf-run/atf-run.1 | 2 +-
external/bsd/atf/dist/atf-run/misc_helpers.cpp | 1 +
external/bsd/atf/dist/atf-run/share/atf-run.hooks | 4 +-
external/bsd/atf/dist/atf-run/user.cpp | 2 +
external/bsd/atf/dist/atf-sh/Kyuafile | 11 +
external/bsd/atf/dist/atf-sh/atf-sh.cpp | 2 +
external/bsd/atf/dist/doc/atf-test-program.1 | 8 +-
external/bsd/atf/dist/test-programs/Kyuafile | 10 +
28 files changed, 355 insertions(+), 10 deletions(-)
diffs (truncated from 725 to 300 lines):
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/COPYING
--- a/external/bsd/atf/dist/COPYING Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/COPYING Thu Mar 31 16:41:07 2011 +0000
@@ -5,7 +5,7 @@
License
*******
-Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
+Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/Kyuafile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/atf/dist/Kyuafile Thu Mar 31 16:41:07 2011 +0000
@@ -0,0 +1,11 @@
+syntax("kyuafile", 1)
+
+test_suite("atf")
+
+include("atf-c/Kyuafile")
+include("atf-c++/Kyuafile")
+include("atf-sh/Kyuafile")
+include("test-programs/Kyuafile")
+include("atf-config/Kyuafile")
+include("atf-report/Kyuafile")
+include("atf-run/Kyuafile")
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/NEWS
--- a/external/bsd/atf/dist/NEWS Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/NEWS Thu Mar 31 16:41:07 2011 +0000
@@ -2,6 +2,52 @@
===========================================================================
+Changes in version 0.13
+***********************
+
+Experimental version released on March 31st, 2011.
+
+This is the first release after the creation of the Kyua project, a more
+modular and reliable replacement for ATF. From now on, ATF will change to
+accomodate the transition to this new codebase, but ATF will still continue
+to see development in the short/medium term. Check out the project page at
+http://code.google.com/p/kyua/ for more details.
+
+The changes in this release are:
+
+* Added support to run the tests with the Kyua runtime engine (kyua-cli), a
+ new package that aims to replace atf-run and atf-report. The ATF tests
+ can be run with the new system by issuing a 'make installcheck-kyua' from
+ the top-level directory of the project (assuming the 'kyua' binary is
+ available during the configuration stage of ATF).
+
+* atf-run and atf-report are now in maintenance mode (but *not* deprecated
+ yet!). Kyua already implements a new, much more reliable runtime engine
+ that provides similar features to these tools. That said, it is not
+ complete yet so all development efforts should go towards it.
+
+* If GDB is installed, atf-run dumps the stack trace of crashing test
+ programs in an attempt to aid debugging. Contributed by Antti Kantee.
+
+* Reverted default timeout change in previous release and reset its value
+ to 5 minutes. This was causing several issues, specially when running
+ the existing NetBSD test suite in qemu.
+
+* Fixed the 'match' output checker in atf-check to properly validate the
+ last line of a file even if it does not have a newline.
+
+* Added the ATF_REQUIRE_IN and ATF_REQUIRE_NOT_IN macros to atf-c++ to
+ check for the presence (or lack thereof) of an element in a collection.
+
+* PR bin/44176: Fixed a race condition in atf-run that would crash atf-run
+ when the cleanup of a test case triggered asynchronous modifications to
+ its work directory (e.g. killing a daemon process that cleans up a pid
+ file in the work directory).
+
+* PR bin/44301: Fixed the sample XSLT file to report bogus test programs
+ instead of just listing them as having 0 test cases.
+
+
Changes in version 0.12
***********************
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/Kyuafile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/atf/dist/atf-c++/Kyuafile Thu Mar 31 16:41:07 2011 +0000
@@ -0,0 +1,14 @@
+syntax("kyuafile", 1)
+
+test_suite("atf")
+
+atf_test_program{name="atf_c++_test"}
+atf_test_program{name="build_test"}
+atf_test_program{name="check_test"}
+atf_test_program{name="config_test"}
+atf_test_program{name="macros_test"}
+atf_test_program{name="pkg_config_test"}
+atf_test_program{name="tests_test"}
+atf_test_program{name="utils_test"}
+
+include("detail/Kyuafile")
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/atf-c++-api.3
--- a/external/bsd/atf/dist/atf-c++/atf-c++-api.3 Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/atf-c++-api.3 Thu Mar 31 16:41:07 2011 +0000
@@ -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 21, 2010
+.Dd December 10, 2010
.Dt ATF-C++-API 3
.Os
.Sh NAME
@@ -38,7 +38,9 @@
.Nm ATF_REQUIRE ,
.Nm ATF_REQUIRE_EQ ,
.Nm ATF_REQUIRE_ERRNO ,
+.Nm ATF_REQUIRE_IN ,
.Nm ATF_REQUIRE_MATCH ,
+.Nm ATF_REQUIRE_NOT_IN ,
.Nm ATF_REQUIRE_THROW ,
.Nm ATF_REQUIRE_THROW_RE ,
.Nm ATF_SKIP ,
@@ -59,7 +61,9 @@
.Fn ATF_REQUIRE "expression"
.Fn ATF_REQUIRE_EQ "expression_1" "expression_2"
.Fn ATF_REQUIRE_ERRNO "exp_errno" "bool_expression"
+.Fn ATF_REQUIRE_IN "element" "collection"
.Fn ATF_REQUIRE_MATCH "regexp" "string_expression"
+.Fn ATF_REQUIRE_NOT_IN "element" "collection"
.Fn ATF_REQUIRE_THROW "expected_exception" "statement"
.Fn ATF_REQUIRE_THROW_RE "expected_exception" "regexp" "statement"
.Fn ATF_SKIP "reason"
@@ -313,10 +317,18 @@
takes two expressions and raises a failure if the two do not evaluate to
the same exact value.
.Pp
+.Fn ATF_REQUIRE_IN
+takes an element and a collection and validates that the element is present in
+the collection.
+.Pp
.Fn ATF_REQUIRE_MATCH
takes a regular expression and a string and raises a failure if the regular
expression does not match the string.
.Pp
+.Fn ATF_REQUIRE_NOT_IN
+takes an element and a collection and validates that the element is not present
+in the collection.
+.Pp
.Fn ATF_REQUIRE_THROW
takes the name of an exception and a statement and raises a failure if
the statement does not throw the specified exception.
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/detail/Kyuafile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/Kyuafile Thu Mar 31 16:41:07 2011 +0000
@@ -0,0 +1,13 @@
+syntax("kyuafile", 1)
+
+test_suite("atf")
+
+atf_test_program{name="application_test"}
+atf_test_program{name="env_test"}
+atf_test_program{name="exceptions_test"}
+atf_test_program{name="expand_test"}
+atf_test_program{name="fs_test"}
+atf_test_program{name="parser_test"}
+atf_test_program{name="sanity_test"}
+atf_test_program{name="text_test"}
+atf_test_program{name="ui_test"}
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/detail/application.cpp
--- a/external/bsd/atf/dist/atf-c++/detail/application.cpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/application.cpp Thu Mar 31 16:41:07 2011 +0000
@@ -1,7 +1,7 @@
//
// Automated Testing Framework (atf)
//
-// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007, 2008, 2010, 2011 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -178,6 +178,7 @@
}
int ch;
+ const int old_opterr = ::opterr;
::opterr = 0;
while ((ch = ::getopt(m_argc, m_argv, optstr.c_str())) != -1) {
switch (ch) {
@@ -201,6 +202,7 @@
m_argv += ::optind;
// Clear getopt state just in case the test wants to use it.
+ opterr = old_opterr;
optind = 1;
#if defined(HAVE_OPTRESET)
optreset = 1;
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/detail/exceptions.cpp
--- a/external/bsd/atf/dist/atf-c++/detail/exceptions.cpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/exceptions.cpp Thu Mar 31 16:41:07 2011 +0000
@@ -34,6 +34,7 @@
#include <cstdarg>
#include <cstdio>
#include <cstring>
+#include <new>
extern "C" {
#include "../../atf-c/error.h"
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/detail/exceptions.hpp
--- a/external/bsd/atf/dist/atf-c++/detail/exceptions.hpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/exceptions.hpp Thu Mar 31 16:41:07 2011 +0000
@@ -31,6 +31,7 @@
#define _ATF_CXX_EXCEPTIONS_HPP_
#include <stdexcept>
+#include <string>
extern "C" {
struct atf_error;
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/detail/exceptions_test.cpp
--- a/external/bsd/atf/dist/atf-c++/detail/exceptions_test.cpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/exceptions_test.cpp Thu Mar 31 16:41:07 2011 +0000
@@ -32,6 +32,7 @@
}
#include <cstdio>
+#include <new>
#include "../macros.hpp"
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/detail/ui.cpp
--- a/external/bsd/atf/dist/atf-c++/detail/ui.cpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/ui.cpp Thu Mar 31 16:41:07 2011 +0000
@@ -31,6 +31,7 @@
#include <sys/ioctl.h>
#include <termios.h>
+#include <unistd.h>
}
#include <sstream>
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/macros.hpp
--- a/external/bsd/atf/dist/atf-c++/macros.hpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/macros.hpp Thu Mar 31 16:41:07 2011 +0000
@@ -101,6 +101,12 @@
} \
} while (false)
+#define ATF_REQUIRE_IN(element, collection) \
+ ATF_REQUIRE((collection).find(element) != (collection).end())
+
+#define ATF_REQUIRE_NOT_IN(element, collection) \
+ ATF_REQUIRE((collection).find(element) == (collection).end())
+
#define ATF_REQUIRE_MATCH(regexp, string) \
do { \
if (!atf::tests::detail::match(regexp, string)) { \
diff -r bff454daf161 -r 2b7fac99c68e external/bsd/atf/dist/atf-c++/macros_test.cpp
--- a/external/bsd/atf/dist/atf-c++/macros_test.cpp Thu Mar 31 15:47:56 2011 +0000
+++ b/external/bsd/atf/dist/atf-c++/macros_test.cpp Thu Mar 31 16:41:07 2011 +0000
@@ -125,6 +125,25 @@
create_ctl_file(*this, "after");
}
+ATF_TEST_CASE(h_require_in);
+ATF_TEST_CASE_HEAD(h_require_in)
+{
+ set_md_var("descr", "Helper test case");
+}
+ATF_TEST_CASE_BODY(h_require_in)
+{
+ const std::string element = get_config_var("value");
+
+ std::set< std::string > collection;
+ collection.insert("foo");
+ collection.insert("bar");
+ collection.insert("baz");
+
+ create_ctl_file(*this, "before");
+ ATF_REQUIRE_IN(element, collection);
+ create_ctl_file(*this, "after");
+}
+
ATF_TEST_CASE(h_require_match);
ATF_TEST_CASE_HEAD(h_require_match)
{
@@ -140,6 +159,25 @@
create_ctl_file(*this, "after");
}
+ATF_TEST_CASE(h_require_not_in);
+ATF_TEST_CASE_HEAD(h_require_not_in)
+{
+ set_md_var("descr", "Helper test case");
+}
+ATF_TEST_CASE_BODY(h_require_not_in)
+{
+ const std::string element = get_config_var("value");
+
+ std::set< std::string > collection;
Home |
Main Index |
Thread Index |
Old Index