/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * uTest, libtest
*
- * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * Data Differential YATL (i.e. libtest) library
+ *
+ * Copyright (C) 2012 Data Differential, http://datadifferential.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
*
*/
+#include "libtest/yatlcon.h"
#include <libtest/common.h>
namespace libtest {
-Runner::Runner()
+Runner::Runner() :
+ _servers(NULL)
{
}
+test_return_t Runner::flush(void*)
+{
+ return TEST_SUCCESS;
+}
+
test_return_t Runner::run(test_callback_fn* func, void *object)
{
if (func)
{
- return func(object);
+ try {
+ return func(object);
+ }
+ catch (libtest::__skipped)
+ {
+ return TEST_SKIPPED;
+ }
+ catch (libtest::__failure e)
+ {
+ libtest::stream::make_cerr(e.file(), e.line(), e.func()) << e.what();
+ return TEST_FAILURE;
+ }
+ catch (libtest::__success)
+ {
+ return TEST_SUCCESS;
+ }
}
return TEST_SUCCESS;
{
if (func)
{
- return func(object);
+ try {
+ return func(object);
+ }
+ catch (libtest::__skipped)
+ {
+ return TEST_SKIPPED;
+ }
+ catch (libtest::__failure e)
+ {
+ libtest::stream::make_cerr(e.file(), e.line(), e.func()) << e.what();
+ return TEST_FAILURE;
+ }
+ catch (libtest::__success)
+ {
+ return TEST_SUCCESS;
+ }
}
return TEST_SUCCESS;
{
if (func)
{
- return func(object);
+ try {
+ return func(object);
+ }
+ catch (libtest::__skipped)
+ {
+ return TEST_SKIPPED;
+ }
+ catch (libtest::__failure e)
+ {
+ libtest::stream::make_cerr(e.file(), e.line(), e.func()) << e.what();
+ return TEST_FAILURE;
+ }
+ catch (libtest::__success)
+ {
+ return TEST_SUCCESS;
+ }
}
return TEST_SUCCESS;