mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-20 19:45:40 +02:00
First cut of ThreadContext (not plumbed in anywhere yet)
This commit is contained in:
@@ -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 )
|
||||
|
@@ -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
|
||||
|
23
projects/SelfTest/ThreadedTests.cpp
Normal file
23
projects/SelfTest/ThreadedTests.cpp
Normal 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() );
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user