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.16:
details: https://anonhg.NetBSD.org/src/rev/12b717c58787
branches: trunk
changeset: 780094:12b717c58787
user: jmmv <jmmv%NetBSD.org@localhost>
date: Wed Jul 11 22:37:05 2012 +0000
description:
Import atf 0.16:
Experimental version released on July 10th, 2012.
* Added a --enable-tools flag to configure to request the build of the
deprecated ATF tools, whose build is now disabled by default. In order
to continue running tests, you should migrate to Kyua instead of enabling
the build of the deprecated tools. The kyua-atf-compat package provides
transitional compatibility versions of atf-run and atf-report built on
top of Kyua.
* Tweaked the ATF_TEST_CASE macro of atf-c++ so that the compiler can
detect defined but unused test cases.
* PR bin/45859: Fixed some XSLT bugs that resulted in the tc-time and
tp-time XML tags leaking into the generated HTML file. Also improved
the CSS file slightly to correct alignment and color issues with the
timestamps column.
* Optimized atf-c++/macros.hpp so that GNU G++ consumes less memory during
compilation with GNU G++.
* Flipped the default to building shared libraries for atf-c and atf-c++,
and started versioning them. As a side-effect, this removes the
--enable-unstable-shared flag from configure that appears to not work any
more (under NetBSD). Additionally, some distributions require the use of
shared libraries for proper dependency tracking (e.g. Fedora), so it is
better if we do the right versioning upstream.
* Project hosting moved from an adhoc solution (custom web site and
Monotone repository) to Google Code (standard wiki and Git). ATF now
lives in a subcomponent of the Kyua project.
diffstat:
external/bsd/atf/dist/Atffile | 7 +-
external/bsd/atf/dist/Kyuafile | 13 ++-
external/bsd/atf/dist/NEWS | 35 +++++++
external/bsd/atf/dist/atf-c++/atf-c++-api.3 | 18 +++-
external/bsd/atf/dist/atf-c++/check_test.cpp | 6 +
external/bsd/atf/dist/atf-c++/detail/test_helpers.cpp | 16 ++-
external/bsd/atf/dist/atf-c++/detail/test_helpers.hpp | 15 ++-
external/bsd/atf/dist/atf-c++/macros.hpp | 33 +++++-
external/bsd/atf/dist/atf-c++/macros_hpp_test.cpp | 5 +
external/bsd/atf/dist/atf-c++/macros_test.cpp | 25 ++++-
external/bsd/atf/dist/atf-c++/unused_test.cpp | 52 +++++++++++
external/bsd/atf/dist/atf-c/detail/test_helpers.h | 15 ++-
external/bsd/atf/dist/atf-c/macros.h | 1 +
external/bsd/atf/dist/atf-c/macros_test.c | 6 +
external/bsd/atf/dist/atf-c/unused_test.c | 56 ++++++++++++
external/bsd/atf/dist/atf-version/generate-revision.sh | 80 ++++-------------
16 files changed, 295 insertions(+), 88 deletions(-)
diffs (truncated from 779 to 300 lines):
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/Atffile
--- a/external/bsd/atf/dist/Atffile Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/Atffile Wed Jul 11 22:37:05 2012 +0000
@@ -6,6 +6,7 @@
tp: atf-c++
tp: atf-sh
tp: test-programs
-tp: atf-config
-tp: atf-report
-tp: atf-run
+
+tp-glob: atf-config*
+tp-glob: atf-report*
+tp-glob: atf-run*
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/Kyuafile
--- a/external/bsd/atf/dist/Kyuafile Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/Kyuafile Wed Jul 11 22:37:05 2012 +0000
@@ -6,6 +6,13 @@
include("atf-c++/Kyuafile")
include("atf-sh/Kyuafile")
include("test-programs/Kyuafile")
-include("atf-config/Kyuafile")
-include("atf-report/Kyuafile")
-include("atf-run/Kyuafile")
+
+if fs.exists("atf-config/Kyuafile") then
+ include("atf-config/Kyuafile")
+end
+if fs.exists("atf-report/Kyuafile") then
+ include("atf-report/Kyuafile")
+end
+if fs.exists("atf-run/Kyuafile") then
+ include("atf-run/Kyuafile")
+end
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/NEWS
--- a/external/bsd/atf/dist/NEWS Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/NEWS Wed Jul 11 22:37:05 2012 +0000
@@ -2,6 +2,41 @@
===========================================================================
+Changes in version 0.16
+***********************
+
+Experimental version released on July 10th, 2012.
+
+* Added a --enable-tools flag to configure to request the build of the
+ deprecated ATF tools, whose build is now disabled by default. In order
+ to continue running tests, you should migrate to Kyua instead of enabling
+ the build of the deprecated tools. The kyua-atf-compat package provides
+ transitional compatibility versions of atf-run and atf-report built on
+ top of Kyua.
+
+* Tweaked the ATF_TEST_CASE macro of atf-c++ so that the compiler can
+ detect defined but unused test cases.
+
+* PR bin/45859: Fixed some XSLT bugs that resulted in the tc-time and
+ tp-time XML tags leaking into the generated HTML file. Also improved
+ the CSS file slightly to correct alignment and color issues with the
+ timestamps column.
+
+* Optimized atf-c++/macros.hpp so that GNU G++ consumes less memory during
+ compilation with GNU G++.
+
+* Flipped the default to building shared libraries for atf-c and atf-c++,
+ and started versioning them. As a side-effect, this removes the
+ --enable-unstable-shared flag from configure that appears to not work any
+ more (under NetBSD). Additionally, some distributions require the use of
+ shared libraries for proper dependency tracking (e.g. Fedora), so it is
+ better if we do the right versioning upstream.
+
+* Project hosting moved from an adhoc solution (custom web site and
+ Monotone repository) to Google Code (standard wiki and Git). ATF now
+ lives in a subcomponent of the Kyua project.
+
+
Changes in version 0.15
***********************
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/atf-c++/atf-c++-api.3
--- a/external/bsd/atf/dist/atf-c++/atf-c++-api.3 Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/atf-c++-api.3 Wed Jul 11 22:37:05 2012 +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 December 10, 2010
+.Dd January 21, 2012
.Dt ATF-C++-API 3
.Os
.Sh NAME
@@ -48,6 +48,8 @@
.Nm ATF_TEST_CASE_BODY ,
.Nm ATF_TEST_CASE_CLEANUP ,
.Nm ATF_TEST_CASE_HEAD ,
+.Nm ATF_TEST_CASE_NAME ,
+.Nm ATF_TEST_CASE_USE ,
.Nm ATF_TEST_CASE_WITH_CLEANUP ,
.Nm ATF_TEST_CASE_WITHOUT_HEAD ,
.Nd C++ API to write ATF-based test programs
@@ -71,6 +73,8 @@
.Fn ATF_TEST_CASE_BODY "name"
.Fn ATF_TEST_CASE_CLEANUP "name"
.Fn ATF_TEST_CASE_HEAD "name"
+.Fn ATF_TEST_CASE_NAME "name"
+.Fn ATF_TEST_CASE_USE "name"
.Fn ATF_TEST_CASE_WITH_CLEANUP "name"
.Fn ATF_TEST_CASE_WITHOUT_HEAD "name"
.Sh DESCRIPTION
@@ -170,6 +174,18 @@
macros, all of which take the test case's name.
Following each of these, a block of code is expected, surrounded by the
opening and closing brackets.
+.Pp
+Additionally, the
+.Fn ATF_TEST_CASE_NAME
+macro can be used to obtain the name of the class corresponding to a
+particular test case, as the name is internally manged by the library to
+prevent clashes with other user identifiers.
+Similarly, the
+.Fn ATF_TEST_CASE_USE
+macro can be executed on a particular test case to mark it as "used" and
+thus prevent compiler warnings regarding unused symbols.
+Note that
+.Em you should never have to use these macros during regular operation.
.Ss Program initialization
The library provides a way to easily define the test program's
.Fn main
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/atf-c++/check_test.cpp
--- a/external/bsd/atf/dist/atf-c++/check_test.cpp Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/check_test.cpp Wed Jul 11 22:37:05 2012 +0000
@@ -191,10 +191,12 @@
}
ATF_TEST_CASE_BODY(build_c_o)
{
+ ATF_TEST_CASE_USE(h_build_c_o_ok);
run_h_tc< ATF_TEST_CASE_NAME(h_build_c_o_ok) >();
ATF_REQUIRE(grep_file("stdout", "-o test.o"));
ATF_REQUIRE(grep_file("stdout", "-c test.c"));
+ ATF_TEST_CASE_USE(h_build_c_o_fail);
run_h_tc< ATF_TEST_CASE_NAME(h_build_c_o_fail) >();
ATF_REQUIRE(grep_file("stdout", "-o test.o"));
ATF_REQUIRE(grep_file("stdout", "-c test.c"));
@@ -209,11 +211,13 @@
}
ATF_TEST_CASE_BODY(build_cpp)
{
+ ATF_TEST_CASE_USE(h_build_cpp_ok);
run_h_tc< ATF_TEST_CASE_NAME(h_build_cpp_ok) >();
ATF_REQUIRE(grep_file("stdout", "-o.*test.p"));
ATF_REQUIRE(grep_file("stdout", "test.c"));
ATF_REQUIRE(grep_file("test.p", "foo bar"));
+ ATF_TEST_CASE_USE(h_build_cpp_fail);
run_h_tc< ATF_TEST_CASE_NAME(h_build_cpp_fail) >();
ATF_REQUIRE(grep_file("stdout", "-o test.p"));
ATF_REQUIRE(grep_file("stdout", "test.c"));
@@ -228,10 +232,12 @@
}
ATF_TEST_CASE_BODY(build_cxx_o)
{
+ ATF_TEST_CASE_USE(h_build_cxx_o_ok);
run_h_tc< ATF_TEST_CASE_NAME(h_build_cxx_o_ok) >();
ATF_REQUIRE(grep_file("stdout", "-o test.o"));
ATF_REQUIRE(grep_file("stdout", "-c test.cpp"));
+ ATF_TEST_CASE_USE(h_build_cxx_o_fail);
run_h_tc< ATF_TEST_CASE_NAME(h_build_cxx_o_fail) >();
ATF_REQUIRE(grep_file("stdout", "-o test.o"));
ATF_REQUIRE(grep_file("stdout", "-c test.cpp"));
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/atf-c++/detail/test_helpers.cpp
--- a/external/bsd/atf/dist/atf-c++/detail/test_helpers.cpp Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/test_helpers.cpp Wed Jul 11 22:37:05 2012 +0000
@@ -45,23 +45,27 @@
#include "test_helpers.hpp"
void
-build_check_cxx_o_aux(const atf::fs::path& sfile, const char* failmsg)
+build_check_cxx_o_aux(const atf::fs::path& sfile, const char* failmsg,
+ const bool expect_pass)
{
std::vector< std::string > optargs;
optargs.push_back("-I" + atf::config::get("atf_includedir"));
+ optargs.push_back("-Wall");
+ optargs.push_back("-Werror");
- if (!atf::check::build_cxx_o(sfile.str(), "test.o",
- atf::process::argv_array(optargs)))
+ const bool result = atf::check::build_cxx_o(
+ sfile.str(), "test.o", atf::process::argv_array(optargs));
+ if ((expect_pass && !result) || (!expect_pass && result))
ATF_FAIL(failmsg);
}
void
build_check_cxx_o(const atf::tests::tc& tc, const char* sfile,
- const char* failmsg)
+ const char* failmsg, const bool expect_pass)
{
const atf::fs::path sfilepath =
atf::fs::path(tc.get_config_var("srcdir")) / sfile;
- build_check_cxx_o_aux(sfilepath, failmsg);
+ build_check_cxx_o_aux(sfilepath, failmsg, expect_pass);
}
void
@@ -74,7 +78,7 @@
const std::string failmsg = std::string("Header check failed; ") +
hdrname + " is not self-contained";
- build_check_cxx_o_aux(atf::fs::path("test.c"), failmsg.c_str());
+ build_check_cxx_o_aux(atf::fs::path("test.c"), failmsg.c_str(), true);
}
atf::fs::path
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/atf-c++/detail/test_helpers.hpp
--- a/external/bsd/atf/dist/atf-c++/detail/test_helpers.hpp Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/test_helpers.hpp Wed Jul 11 22:37:05 2012 +0000
@@ -64,7 +64,18 @@
} \
ATF_TEST_CASE_BODY(name) \
{ \
- build_check_cxx_o(*this, sfile, failmsg); \
+ build_check_cxx_o(*this, sfile, failmsg, true); \
+ }
+
+#define BUILD_TC_FAIL(name, sfile, descr, failmsg) \
+ ATF_TEST_CASE(name); \
+ ATF_TEST_CASE_HEAD(name) \
+ { \
+ set_md_var("descr", descr); \
+ } \
+ ATF_TEST_CASE_BODY(name) \
+ { \
+ build_check_cxx_o(*this, sfile, failmsg, false); \
}
namespace atf {
@@ -74,7 +85,7 @@
}
void header_check(const char*);
-void build_check_cxx_o(const atf::tests::tc&, const char*, const char*);
+void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bool);
atf::fs::path get_process_helpers_path(const atf::tests::tc&);
bool grep_file(const char*, const char*);
bool grep_string(const std::string&, const char*);
diff -r c6a2616396a4 -r 12b717c58787 external/bsd/atf/dist/atf-c++/macros.hpp
--- a/external/bsd/atf/dist/atf-c++/macros.hpp Wed Jul 11 19:24:13 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/macros.hpp Wed Jul 11 22:37:05 2012 +0000
@@ -36,31 +36,48 @@
#include <atf-c++/tests.hpp>
+// Do not define inline methods for the test case classes. Doing so
+// significantly increases the memory requirements of GNU G++ during
+// compilation.
+
#define ATF_TEST_CASE_WITHOUT_HEAD(name) \
+ namespace { \
class atfu_tc_ ## name : public atf::tests::tc { \
void body(void) const; \
public: \
- atfu_tc_ ## name(void) : atf::tests::tc(#name, false) {} \
- };
+ atfu_tc_ ## name(void); \
+ }; \
+ static atfu_tc_ ## name* atfu_tcptr_ ## name; \
+ atfu_tc_ ## name::atfu_tc_ ## name(void) : atf::tests::tc(#name, false) {} \
+ }
#define ATF_TEST_CASE(name) \
+ namespace { \
class atfu_tc_ ## name : public atf::tests::tc { \
void head(void); \
void body(void) const; \
public: \
- atfu_tc_ ## name(void) : atf::tests::tc(#name, false) {} \
- };
+ atfu_tc_ ## name(void); \
+ }; \
+ static atfu_tc_ ## name* atfu_tcptr_ ## name; \
+ atfu_tc_ ## name::atfu_tc_ ## name(void) : atf::tests::tc(#name, false) {} \
+ }
#define ATF_TEST_CASE_WITH_CLEANUP(name) \
+ namespace { \
class atfu_tc_ ## name : public atf::tests::tc { \
void head(void); \
void body(void) const; \
void cleanup(void) const; \
public: \
- atfu_tc_ ## name(void) : atf::tests::tc(#name, true) {} \
- };
+ atfu_tc_ ## name(void); \
+ }; \
+ static atfu_tc_ ## name* atfu_tcptr_ ## name; \
+ atfu_tc_ ## name::atfu_tc_ ## name(void) : atf::tests::tc(#name, true) {} \
+ }
Home |
Main Index |
Thread Index |
Old Index