+
+namespace {
+enum class TestResult
+{
+ PASS,
+ FAIL,
+ IGNORED,
+ TIMEOUT,
+ UNKNOWN
+};
+}
+
+#define RUNNER_CHILD_TEST_EXPECT(name, result, message) \
+ static void testExpectFunction##name(); \
+ RUNNER_TEST(name) \
+ { \
+ TestResult eResult = result; \
+ TestResult rResult = TestResult::UNKNOWN; \
+ std::string eMessage = message; \
+ Try \
+ { \
+ DPL::Test::RunChildProc(&testExpectFunction##name); \
+ } \
+ Catch(DPL::Test::TestRunner::TestFailed) \
+ { \
+ std::string rMessage = _rethrown_exception.GetMessage(); \
+ size_t pos = rMessage.find(")"); \
+ if(pos != std::string::npos && pos+2 <= rMessage.length()) \
+ { \
+ rMessage = rMessage.substr(pos+2); \
+ } \
+ if(rMessage == "Timeout") \
+ { \
+ rResult = TestResult::TIMEOUT; \
+ } \
+ else if(rMessage == "Ignored") \
+ { \
+ rResult = TestResult::IGNORED; \
+ } \
+ else if(rMessage == eMessage) \
+ { \
+ rResult = TestResult::FAIL; \
+ } \
+ else \
+ { \
+ RUNNER_ASSERT_MSG(false, "Fail message do not matches"); \
+ } \
+ } \
+ if(rResult == TestResult::UNKNOWN) \
+ { \
+ rResult = TestResult::PASS; \
+ } \
+ RUNNER_ASSERT_MSG(eResult == rResult, "Expected other result"); \
+ } \
+ void testExpectFunction##name() \
+
+