Improvements to beast::unit_test framework:

* Some runner member functions are now thread-safe.
* De-inline and tidy up declarations and definitions.
* arg() interface allows command lines to be passed to suites.
This commit is contained in:
Vinnie Falco
2014-10-28 06:56:19 -07:00
committed by Nik Bougalis
parent 9ab4f7bcc6
commit f5941041d4
7 changed files with 229 additions and 153 deletions

View File

@@ -166,6 +166,13 @@ public:
bool
expect (Condition shouldBeTrue, std::string const& reason = "");
/** Return the argument associated with the runner. */
std::string const&
arg() const
{
return runner_->arg();
}
// DEPRECATED
// @return `true` if the test condition indicates success (a false value)
template <class Condition>
@@ -398,8 +405,8 @@ suite::fail (std::string const& reason)
// detail:
// This inserts the suite with the given manual flag
#define BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,manual) \
static beast::unit_test::detail::global_suite_instance <Class##_test> \
Library ## Module ## Class ## _test_instance ( \
static beast::unit_test::detail::insert_suite <Class##_test> \
Library ## Module ## Class ## _test_instance ( \
#Class, #Module, #Library, manual);
//------------------------------------------------------------------------------