Mercurial > fife-parpg
view ext/UnitTest++/src/Test.cpp @ 374:1115f7cae9a3
Editor:
* The editor will now force filenames to be lowercase, as VFS does not like uppercase path names.
* If a map filename does not have a .xml extension on save, it will be automatically added.
* Log modules set to "all" by default. Only new users will be affected by this without having to modify or remove their configuration file.
* Log level set to LOGLEVEL_WARN
author | cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 21 Nov 2009 13:11:56 +0000 |
parents | 0d325e9d5953 |
children |
line wrap: on
line source
#include "Config.h" #include "Test.h" #include "TestList.h" #include "TestResults.h" #include "AssertException.h" #include "MemoryOutStream.h" #ifdef UNITTEST_POSIX #include "Posix/SignalTranslator.h" #endif namespace UnitTest { TestList& Test::GetTestList() { static TestList s_list; return s_list; } Test::Test(char const* testName, char const* suiteName, char const* filename, int const lineNumber) : m_details(testName, suiteName, filename, lineNumber) , next(0) , m_timeConstraintExempt(false) { } Test::~Test() { } void Test::Run(TestResults& testResults) const { try { #ifdef UNITTEST_POSIX UNITTEST_THROW_SIGNALS #endif RunImpl(testResults); } catch (AssertException const& e) { testResults.OnTestFailure( TestDetails(m_details.testName, m_details.suiteName, e.Filename(), e.LineNumber()), e.what()); } catch (std::exception const& e) { MemoryOutStream stream; stream << "Unhandled exception: " << e.what(); testResults.OnTestFailure(m_details, stream.GetText()); } catch (...) { testResults.OnTestFailure(m_details, "Unhandled exception: Crash!"); } } void Test::RunImpl(TestResults&) const { } }