]> git.tdb.fi Git - libs/test.git/commitdiff
Add a method to manually fail a test
authorMikko Rasa <tdb@tdb.fi>
Mon, 25 Jul 2011 14:41:37 +0000 (17:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 25 Jul 2011 14:41:37 +0000 (17:41 +0300)
source/test.cpp
source/test.h

index ab6e05234302604fa84435c1f147546d39761b31..a05349b594604a869b1729acf25f5894dad4c94d 100644 (file)
@@ -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()
 {
index ae459f573b76f66bf5d9ec9df3240d49095326cb..d410377c4793102bb90525d6246fe77e5ca31b80 100644 (file)
@@ -83,6 +83,7 @@ protected:
 
        void info(const std::string &);
        void debug(const std::string &);
+       void fail(const std::string &);
 };
 
 template<typename T>