Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51958 - trunk/boost/detail
From: bdawes_at_[hidden]
Date: 2009-03-24 11:28:27


Author: bemandawes
Date: 2009-03-24 11:28:27 EDT (Tue, 24 Mar 2009)
New Revision: 51958
URL: http://svn.boost.org/trac/boost/changeset/51958

Log:
Initial commit
Added:
   trunk/boost/detail/test_framework.hpp (contents, props changed)

Added: trunk/boost/detail/test_framework.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/detail/test_framework.hpp 2009-03-24 11:28:27 EDT (Tue, 24 Mar 2009)
@@ -0,0 +1,37 @@
+// test_framework.hpp ----------------------------------------------------------------//
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// A very simple test framework that avoids dependencies on Boost.Test
+
+#include <iostream>
+
+namespace boost
+{
+ namespace test_framework
+ {
+ int error_count = 0;
+
+ void check( const char * predicate, const char * file, int line )
+ {
+ ++error_count;
+
+ // format chosen to parse with VC++ IDE output
+ std::cout << file << "(" << line << ") : error: "
+ << predicate << " is false\n" << std::endl;
+ }
+
+ int errors()
+ {
+ std::cout << " ***** " << error_count << " error(s) detected *****\n";
+ return error_count;
+ }
+ } // namespace test_framework
+} // namespace boost
+
+#define BOOST_CHECK(predicate) \
+ (predicate) ? static_cast<void>(0) : \
+ boost::test_framework::check( #predicate, __FILE__, __LINE__ )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk