dev build 2

This commit is contained in:
Phil Nash 2015-07-02 23:03:13 +01:00
parent d87e551efa
commit 8f66e3495b
3 changed files with 23 additions and 6 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png) ![catch logo](catch-logo-small.png)
*v1.2.1-develop.1* *v1.2.1-develop.2*
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)

View File

@ -37,7 +37,7 @@ namespace Catch {
return os; return os;
} }
Version libraryVersion( 1, 2, 1, "develop", 1 ); Version libraryVersion( 1, 2, 1, "develop", 2 );
} }

View File

@ -1,6 +1,6 @@
/* /*
* Catch v1.2.1-develop.1 * Catch v1.2.1-develop.2
* Generated: 2015-07-02 08:21:11.983471 * Generated: 2015-07-02 23:02:49.715552
* ---------------------------------------------------------- * ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly * This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@ -233,6 +233,8 @@
namespace Catch { namespace Catch {
struct IConfig;
class NonCopyable { class NonCopyable {
#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS #ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
NonCopyable( NonCopyable const& ) = delete; NonCopyable( NonCopyable const& ) = delete;
@ -319,6 +321,9 @@ namespace Catch {
void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo );
void seedRng( IConfig const& config );
unsigned int rngSeed();
// Use this in variadic streaming macros to allow // Use this in variadic streaming macros to allow
// >> +StreamEndStop // >> +StreamEndStop
// as well as // as well as
@ -5388,6 +5393,8 @@ namespace Catch {
m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal ); m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal );
TestCaseTracker::Guard guard( *m_testCaseTracker ); TestCaseTracker::Guard guard( *m_testCaseTracker );
seedRng( *m_config );
Timer timer; Timer timer;
timer.start(); timer.start();
if( m_reporter->getPreferences().shouldRedirectStdOut ) { if( m_reporter->getPreferences().shouldRedirectStdOut ) {
@ -5697,7 +5704,7 @@ namespace Catch {
if( m_configData.filenamesAsTags ) if( m_configData.filenamesAsTags )
applyFilenamesAsTags(); applyFilenamesAsTags();
std::srand( m_configData.rngSeed ); seedRng( *m_config );
Runner runner( m_config ); Runner runner( m_config );
@ -5822,6 +5829,8 @@ namespace Catch {
break; break;
case RunTests::InRandomOrder: case RunTests::InRandomOrder:
{ {
seedRng( config );
RandomNumberGenerator rng; RandomNumberGenerator rng;
std::random_shuffle( matchingTestCases.begin(), matchingTestCases.end(), rng ); std::random_shuffle( matchingTestCases.begin(), matchingTestCases.end(), rng );
} }
@ -6812,7 +6821,7 @@ namespace Catch {
return os; return os;
} }
Version libraryVersion( 1, 2, 1, "develop", 1 ); Version libraryVersion( 1, 2, 1, "develop", 2 );
} }
@ -7104,6 +7113,14 @@ namespace Catch {
return line < other.line || ( line == other.line && file < other.file ); return line < other.line || ( line == other.line && file < other.file );
} }
void seedRng( IConfig const& config ) {
if( config.rngSeed() != 0 )
std::srand( config.rngSeed() );
}
unsigned int rngSeed() {
return getCurrentContext().getConfig()->rngSeed();
}
std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
#ifndef __GNUG__ #ifndef __GNUG__
os << info.file << "(" << info.line << ")"; os << info.file << "(" << info.line << ")";