From: Mikko Rasa Date: Mon, 25 Jul 2011 14:41:37 +0000 (+0300) Subject: Add a method to manually fail a test X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=89a507ffd4e41ee5f270034b8ad783963afd0be4;p=libs%2Ftest.git Add a method to manually fail a test --- diff --git a/source/test.cpp b/source/test.cpp index ab6e052..a05349b 100644 --- a/source/test.cpp +++ b/source/test.cpp @@ -152,6 +152,11 @@ void Test::debug(const string &str) detail_debug += format("%s\n", str); } +void Test::fail(const string &why) +{ + throw test_failed(why); +} + Test::Factory::Factory() { diff --git a/source/test.h b/source/test.h index ae459f5..d410377 100644 --- a/source/test.h +++ b/source/test.h @@ -83,6 +83,7 @@ protected: void info(const std::string &); void debug(const std::string &); + void fail(const std::string &); }; template