First cut of ThreadContext (not plumbed in anywhere yet)

This commit is contained in:
Phil Nash
2015-12-07 18:47:59 +00:00
parent 3d6bef2a82
commit b54813e84e
12 changed files with 148 additions and 22 deletions

View File

@@ -8,6 +8,8 @@
#include "catch.hpp"
#include "../include/internal/catch_suppress_warnings.h"
#include <string>
#include <stdexcept>
@@ -112,7 +114,7 @@ public:
CustomStdException( const std::string& msg )
: m_msg( msg )
{}
~CustomStdException() CATCH_NOEXCEPT {}
~CustomStdException() CATCH_NOEXCEPT;
std::string getMessage() const
{
@@ -122,6 +124,7 @@ public:
private:
std::string m_msg;
};
CustomStdException::~CustomStdException() CATCH_NOEXCEPT {}
CATCH_TRANSLATE_EXCEPTION( CustomException& ex )

View File

@@ -21,6 +21,7 @@ CATCH_REGISTER_TAG_ALIAS( "[@tricky]", "[tricky]~[.]" )
# pragma clang diagnostic ignored "-Wc++98-compat"
#endif
namespace {
template<size_t size>
void parseIntoConfig( const char * (&argv)[size], Catch::ConfigData& config ) {
@@ -458,4 +459,7 @@ struct AutoTestReg {
REGISTER_TEST_CASE( manuallyRegisteredTestFunction, "ManuallyRegistered", "" );
}
};
AutoTestReg autoTestReg;
} // anon namespace

View File

@@ -0,0 +1,23 @@
/*
* Created by Phil on 24/11/2015.
* Copyright 2015 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch.hpp"
#include "../include/internal/catch_suppress_warnings.h"
#include "../include/internal/catch_thread_context.hpp"
#define THREADED_SECTION SECTION
TEST_CASE( "multithreaded sections" ) {
THREADED_SECTION( "test" ) {
Catch::ThreadContext tctx( Catch::getGlobalRunContext() );
}
}