Merge branch 'master' into cmake_include_headers

Conflicts:
	projects/CMake/CMakeLists.txt
This commit is contained in:
Fraser Hutchison 2013-11-29 13:03:00 +00:00
commit f33932de2c
49 changed files with 1630 additions and 2824 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png)
*v1.0 build 11 (master branch)*
*v1.0 build 14 (master branch)*
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)

36
docs/build-systems.md Normal file
View File

@ -0,0 +1,36 @@
# Integration with build systems
## CMake
You can use the following CMake script to automatically fetch Catch from github and configure it as an external project:
```CMake
cmake_minimum_required(VERSION 2.8.8)
project(catch_builder CXX)
include(ExternalProject)
ExternalProject_Add(
catch
PREFIX ${CMAKE_BINARY_DIR}/catch
GIT_REPOSITORY https://github.com/philsquared/Catch.git
TIMEOUT 10
UPDATE_COMMAND ${GIT_EXECUTABLE} pull
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)
# Expose required variable (CATCH_INCLUDE_DIR) to parent scope
ExternalProject_Get_Property(catch source_dir)
set(CATCH_INCLUDE_DIR ${source_dir}/include CACHE INTERNAL "Path to include folder for Catch")
```
If you put it in, e.g., `${PROJECT_SRC_DIR}/${EXT_PROJECTS_DIR}/catch/`, you can use it in your project by adding the following to your root CMake file:
```CMake
# Includes Catch in the project:
add_subdirectory(${EXT_PROJECTS_DIR}/catch)
include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
enable_testing(true) # Enables unit-testing.
```

View File

@ -21,7 +21,7 @@ Note that options are described according to the following pattern:
Test cases, wildcarded test cases, tags and tag expressions are all passed directly as arguments. Tags are distinguished by being enclosed in square brackets.
If no test specs are supplied then all test cases, except "hidden" tests (tagged ```[hide]``` or, in the legacy case, prefixed by `'./'`) are run
If no test specs are supplied then all test cases, except "hidden" tests (tagged ```[hide]```, ```[.]``` or, in the legacy case, prefixed by `'./'`) are run.
Specs must be enclosed in quotes if they contain spaces. If they do not contain spaces the quotes are optional.

View File

@ -15,7 +15,22 @@ For examples see the [Tutorial](tutorial.md)
## Tags
-{placeholder for documentation of tags}-
Tags allow an arbitrary number of additional strings to be associated with a test case. Test cases can be selected (for running, or just for listing) by tag - or even by an expression that combines several tags. At their most basic level they provide a simple way to group several related tests together.
As an example - given the following test cases:
TEST_CASE( "A", "[widget]" ) { /* ... */ }
TEST_CASE( "B", "[widget]" ) { /* ... */ }
TEST_CASE( "C", "[gadget]" ) { /* ... */ }
TEST_CASE( "D", "[widget][gadget]" ) { /* ... */ }
The tag expression, ```"[widget]"``` selects A, B & D. ```"[gadget]"``` selects C & D. ```"[widget][gadget]"``` selects just D and ```"[widget],[gadget]"``` selects all four test cases.
For more detail on command line selection see [the command line docs](command-line.md#specifying-which-tests-to-run)
A special tag name, ```[hide]``` causes test cases to be skipped from the default list (ie when no test cases have been explicitly selected through tag expressions or name wildcards). ```[.]``` is an alias for ```[hide]```.
Tag names are not case sensitive.
## BDD-style test cases

View File

@ -87,11 +87,11 @@ Of course there are still more issues to do deal with. For example we'll hit pro
Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take moment to consider those before we move on.
1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md).
2. We introduce test cases with the TEST_CASE macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#testCasesAndSections">Test cases and Sections</a>, below. The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md) for more information on running tests.
2. We introduce test cases with the TEST_CASE macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#test-cases-and-sections">Test cases and Sections</a>, below. The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md) for more information on running tests.
3. The name and tags arguments are just strings. We haven't had to declare a function or method - or explicitly register the test case anywhere. Behind the scenes a function with a generated name is defined for you, and automatically registered using static registry classes. By abstracting the function name away we can name our tests without the constraints of identifier names.
4. We write our individual test assertions using the REQUIRE macro. Rather than a separate macro for each type of condition we express the condition naturally using C/C++ syntax. Behind the scenes a simple set of expression templates captures the left-hand-side and right-hand-side of the expression so we can display the values in our test report. As we'll see later there _are_ other assertion macros - but because of this technique the number of them is drastically reduced.
<a id="testCasesAndSections"></a>
<a id="test-cases-and-sections"></a>
## Test cases and sections
Most test frameworks have a class-based fixture mechanism. That is, test cases map to methods on a class and common setup and teardown can be performed in ```setup()``` and ```teardown()``` methods (or constructor/ destructor in languages, like C++, that support deterministic destruction).
@ -140,7 +140,82 @@ This works because the ```SECTION``` macro contains an if statement that calls b
So far so good - this is already an improvement on the setup/ teardown approach because now we see our setup code inline and we can use the stack.
-{placeholder for documentation on nested sections}-
The power of sections really shows, however, when we need to execute a sequence of, checked, operations. Continuing the vector example we might want to verify that after reserving a larger capacity, if we reserve smaller capacity (but still larger than the current size) then the capacity is not, in fact, changed. We can do that, naturally, like so:
SECTION( "reserving bigger changes capacity but not size" ) {
v.reserve( 10 );
REQUIRE( v.size() == 5 );
REQUIRE( v.capacity() >= 10 );
SECTION( "reserving smaller again does not change capacity" ) {
v.reserve( 7 );
REQUIRE( v.capacity() >= 10 );
}
}
Sections can be nested to an arbitrary depth (limited only by your stack size). Each leaf section (i.e. a section that contains no nested sections) will be executed exactly once, on a separate path of execution from any other leaf section (so no leaf section can interfere with another). Obviously a failure in a parent section will prevent nested sections from running - but that's the idea.
## BDD-Style
If you name your test cases and sections appropriately you can achieve a BDD-style specification structure. This became such a useful way of working that first class support has been added to Catch. Scenarios can be specified using ```SCENARIO```, ```GIVEN```, ```WHEN``` and ```THEN``` macros, which map on to ```TEST_CASE```s and ```SECTION```s, respectively (for more details see [Test cases and sections](test-cases-and-sections.md)).
The vector example can be adjusted to use these macros like so:
```c++
SCENARIO( "vectors can be sized and resized", "[vector]" ) {
GIVEN( "A vector with some items" ) {
std::vector<int> v( 5 );
REQUIRE( v.size() == 5 );
REQUIRE( v.capacity() >= 5 );
WHEN( "the size is increased" ) {
v.resize( 10 );
THEN( "the size and capacity change" ) {
REQUIRE( v.size() == 10 );
REQUIRE( v.capacity() >= 10 );
}
}
WHEN( "the size is reduced" ) {
v.resize( 0 );
THEN( "the size changes but not capacity" ) {
REQUIRE( v.size() == 0 );
REQUIRE( v.capacity() >= 5 );
}
}
WHEN( "more capacity is reserved" ) {
v.reserve( 10 );
THEN( "the capacity changes but not the size" ) {
REQUIRE( v.size() == 5 );
REQUIRE( v.capacity() >= 10 );
}
}
WHEN( "less capacity is reserved" ) {
v.reserve( 0 );
THEN( "neither size nor capacity are changed" ) {
REQUIRE( v.size() == 5 );
REQUIRE( v.capacity() >= 5 );
}
}
}
}
```
A nice consequence of this is that when these tests are run the test names are reported like this:
```
Scenario: vectors can be sized and resized
Given: A vector with some items
When: more capacity is reserved
Then: the capacity changes but not the size
```
## Next steps
For more specific information see the [Reference pages](reference-index.md)

View File

@ -12,6 +12,8 @@
#include "catch_common.h"
#include "clara.h"
#include <fstream>
namespace Catch {
inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; }
@ -38,7 +40,18 @@ namespace Catch {
? ShowDurations::Always
: ShowDurations::Never;
}
inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) {
std::ifstream f( _filename.c_str() );
if( !f.is_open() )
throw std::domain_error( "Unable to load input file: " + _filename );
std::string line;
while( std::getline( f, line ) ) {
line = trim(line);
if( !line.empty() && !startsWith( line, "#" ) )
addTestOrTags( config, line );
}
}
inline Clara::CommandLine<ConfigData> makeCommandLineParser() {
@ -53,19 +66,15 @@ namespace Catch {
.longOpt( "help" );
cli.bind( &ConfigData::listTests )
.describe( "list all (or matching) test cases" )
.describe( "list all/matching test cases" )
.shortOpt( "l")
.longOpt( "list-tests" );
cli.bind( &ConfigData::listTags )
.describe( "list all (or matching) tags" )
.describe( "list all/matching tags" )
.shortOpt( "t")
.longOpt( "list-tags" );
cli.bind( &ConfigData::listReporters )
.describe( "list all reporters" )
.longOpt( "list-reporters" );
cli.bind( &ConfigData::showSuccessfulTests )
.describe( "include successful tests in output" )
.shortOpt( "s")
@ -88,7 +97,7 @@ namespace Catch {
.hint( "filename" );
cli.bind( &ConfigData::reporterName )
.describe( "reporter to use - defaults to console" )
.describe( "reporter to use (defaults to console)" )
.shortOpt( "r")
.longOpt( "reporter" )
// .hint( "name[:filename]" );
@ -133,6 +142,22 @@ namespace Catch {
.longOpt( "durations" )
.hint( "yes/no" );
cli.bind( &loadTestNamesFromFile )
.describe( "load test names to run from a file" )
.shortOpt( "f")
.longOpt( "input-file" )
.hint( "filename" );
// Less common commands which don't have a short form
cli.bind( &ConfigData::listTestNamesOnly )
.describe( "list all/matching test cases names only" )
.longOpt( "list-test-names-only" );
cli.bind( &ConfigData::listReporters )
.describe( "list all reporters" )
.longOpt( "list-reporters" );
return cli;
}

View File

@ -30,6 +30,7 @@ namespace Catch {
: listTests( false ),
listTags( false ),
listReporters( false ),
listTestNamesOnly( false ),
showSuccessfulTests( false ),
shouldDebugBreak( false ),
noThrow( false ),
@ -43,6 +44,7 @@ namespace Catch {
bool listTests;
bool listTags;
bool listReporters;
bool listTestNamesOnly;
bool showSuccessfulTests;
bool shouldDebugBreak;
@ -112,6 +114,7 @@ namespace Catch {
}
bool listTests() const { return m_data.listTests; }
bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
bool listTags() const { return m_data.listTags; }
bool listReporters() const { return m_data.listReporters; }

View File

@ -117,7 +117,7 @@ namespace {
};
inline bool shouldUseColourForPlatform() {
return isatty( fileno(stdout) );
return isatty(STDOUT_FILENO);
}
PosixColourImpl platformColourImpl;

View File

@ -30,76 +30,29 @@ namespace Catch {
std::cout << "All available test cases:\n";
else
std::cout << "Matching test cases:\n";
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
// First pass - get max tags
std::size_t maxTagLen = 0;
std::size_t maxNameLen = 0;
for(; it != itEnd; ++it ) {
if( matchesFilters( config.filters(), *it ) ) {
maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen );
maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen );
}
}
// Try to fit everything in. If not shrink tag column first, down to 30
// then shrink name column until it all fits (strings will be wrapped within column)
while( maxTagLen + maxNameLen > CATCH_CONFIG_CONSOLE_WIDTH-5 ) {
if( maxTagLen > 30 )
--maxTagLen;
else
--maxNameLen;
}
std::size_t matchedTests = 0;
for( it = allTests.begin(); it != itEnd; ++it ) {
TextAttributes nameAttr, tagsAttr;
nameAttr.setInitialIndent( 2 ).setIndent( 4 );
tagsAttr.setIndent( 6 );
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
for( std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
it != itEnd;
++it )
if( matchesFilters( config.filters(), *it ) ) {
matchedTests++;
Text nameWrapper( it->getTestCaseInfo().name,
TextAttributes()
.setWidth( maxNameLen+2 )
.setInitialIndent(2)
.setIndent(4) );
Text tagsWrapper( it->getTestCaseInfo().tagsAsString,
TextAttributes()
.setWidth( maxTagLen )
.setInitialIndent(0)
.setIndent( 2 ) );
for( std::size_t i = 0; i < (std::max)( nameWrapper.size(), tagsWrapper.size() ); ++i ) {
Colour::Code colour = Colour::None;
if( it->getTestCaseInfo().isHidden )
colour = Colour::SecondaryText;
std::string nameCol;
if( i < nameWrapper.size() ) {
nameCol = nameWrapper[i];
}
else {
nameCol = " ...";
colour = Colour::SecondaryText;
}
{
TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
Colour::Code colour = testCaseInfo.isHidden
? Colour::SecondaryText
: Colour::None;
Colour colourGuard( colour );
std::cout << nameCol;
}
if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) {
size_t padLen( maxNameLen > nameCol.size() ? maxNameLen - nameCol.size() : 0 );
if( i == 0 ) {
Colour colourGuard( Colour::SecondaryText );
std::cout << " " << std::string( padLen, '.' ) << " ";
}
else {
std::cout << std::string( padLen, ' ' ) << " ";
}
std::cout << tagsWrapper[i];
}
std::cout << "\n";
}
}
std::cout << Text( testCaseInfo.name, nameAttr ) << std::endl;
if( !testCaseInfo.tags.empty() )
std::cout << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl;
}
if( config.filters().empty() )
std::cout << pluralise( matchedTests, "test case" ) << "\n" << std::endl;
else
@ -107,26 +60,39 @@ namespace Catch {
return matchedTests;
}
inline std::size_t listTestsNamesOnly( Config const& config ) {
std::size_t matchedTests = 0;
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
for( std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
it != itEnd;
++it )
if( matchesFilters( config.filters(), *it ) ) {
matchedTests++;
TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
std::cout << testCaseInfo.name << std::endl;
}
return matchedTests;
}
inline std::size_t listTags( Config const& config ) {
if( config.filters().empty() )
std::cout << "All available tags:\n";
else
std::cout << "Matching tags:\n";
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
std::map<std::string, int> tagCounts;
std::size_t maxTagLen = 0;
for(; it != itEnd; ++it ) {
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
for( std::vector<TestCase>::const_iterator it = allTests.begin(),
itEnd = allTests.end();
it != itEnd;
++it ) {
if( matchesFilters( config.filters(), *it ) ) {
for( std::set<std::string>::const_iterator tagIt = it->getTestCaseInfo().tags.begin(),
tagItEnd = it->getTestCaseInfo().tags.end();
tagIt != tagItEnd;
++tagIt ) {
std::string tagName = *tagIt;
maxTagLen = (std::max)( maxTagLen, tagName.size() );
std::map<std::string, int>::iterator countIt = tagCounts.find( tagName );
if( countIt == tagCounts.end() )
tagCounts.insert( std::make_pair( tagName, 1 ) );
@ -135,26 +101,18 @@ namespace Catch {
}
}
}
maxTagLen +=4;
if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 )
maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10;
for( std::map<std::string, int>::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end();
for( std::map<std::string, int>::const_iterator countIt = tagCounts.begin(),
countItEnd = tagCounts.end();
countIt != countItEnd;
++countIt ) {
std::ostringstream oss;
oss << " " << countIt->second << " ";
Text wrapper( "[" + countIt->first + "]", TextAttributes()
.setIndent(2)
.setWidth( maxTagLen ) );
std::cout << wrapper;
std::size_t dots = 2;
if( maxTagLen > wrapper.last().size() )
dots += maxTagLen - wrapper.last().size();
{
Colour colourGuard( Colour::SecondaryText );
std::cout << std::string( dots, '.' );
}
std::cout << countIt->second
<< "\n";
.setInitialIndent( 0 )
.setIndent( oss.str().size() )
.setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) );
std::cout << oss.str() << wrapper << "\n";
}
std::cout << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl;
return tagCounts.size();
@ -187,6 +145,8 @@ namespace Catch {
Option<std::size_t> listedCount;
if( config.listTests() )
listedCount = listedCount.valueOr(0) + listTests( config );
if( config.listTestNamesOnly() )
listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config );
if( config.listTags() )
listedCount = listedCount.valueOr(0) + listTags( config );
if( config.listReporters() )

View File

@ -22,7 +22,7 @@ namespace Catch {
SourceLineInfo const& _lineInfo )
{
std::string desc = _descOrTags;
bool isHidden( startsWith( _name, "./" ) );
bool isHidden( startsWith( _name, "./" ) ); // Legacy support
std::set<std::string> tags;
TagExtracter( tags ).parse( desc );
if( tags.find( "hide" ) != tags.end() || tags.find( "." ) != tags.end() )

View File

@ -42,8 +42,8 @@ namespace Catch {
else {
TestCase const& prev = *m_functions.find( testCase );
std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n"
<< "\tFirst seen at " << SourceLineInfo( prev.getTestCaseInfo().lineInfo ) << "\n"
<< "\tRedefined at " << SourceLineInfo( testCase.getTestCaseInfo().lineInfo ) << std::endl;
<< "\tFirst seen at " << prev.getTestCaseInfo().lineInfo << "\n"
<< "\tRedefined at " << testCase.getTestCaseInfo().lineInfo << std::endl;
exit(1);
}
}

View File

@ -13,7 +13,7 @@
namespace Catch {
// These numbers are maintained by a script
Version libraryVersion( 1, 0, 11, "master" );
Version libraryVersion( 1, 0, 14, "master" );
}
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -155,6 +155,10 @@ namespace Clara {
void (*function)( C& );
};
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4702)
#endif
template<typename C, typename T>
struct BoundBinaryFunction : IArgFunction<C>{
BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {}
@ -172,6 +176,9 @@ namespace Clara {
virtual IArgFunction<C>* clone() const { return new BoundBinaryFunction( *this ); }
void (*function)( C&, T );
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
template<typename C, typename M>
BoundArgFunction<C> makeBoundField( M C::* _member ) {
@ -305,6 +312,13 @@ namespace Clara {
int position;
};
// NOTE: std::auto_ptr is deprecated in c++11/c++0x
#if defined(__cplusplus) && __cplusplus > 199711L
typedef std::unique_ptr<Arg> ArgAutoPtr;
#else
typedef std::auto_ptr<Arg> ArgAutoPtr;
#endif
class ArgBinder {
public:
template<typename F>
@ -329,7 +343,7 @@ namespace Clara {
else if( m_arg.isAnyPositional() ) {
if( m_cl->m_arg.get() )
throw std::logic_error( "Only one unpositional argument can be added" );
m_cl->m_arg = std::auto_ptr<Arg>( new Arg( m_arg ) );
m_cl->m_arg = ArgAutoPtr( new Arg( m_arg ) );
}
else
m_cl->m_options.push_back( m_arg );
@ -373,7 +387,7 @@ namespace Clara {
m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition )
{
if( other.m_arg.get() )
m_arg = std::auto_ptr<Arg>( new Arg( *other.m_arg ) );
m_arg = ArgAutoPtr( new Arg( *other.m_arg ) );
}
template<typename F>
@ -543,7 +557,7 @@ namespace Clara {
Detail::BoundArgFunction<ConfigT> m_boundProcessName;
std::vector<Arg> m_options;
std::map<int, Arg> m_positionalArgs;
std::auto_ptr<Arg> m_arg;
ArgAutoPtr m_arg;
int m_highestSpecifiedArgPosition;
};

View File

@ -41,13 +41,18 @@ namespace Catch {
virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
AssertionResult const& result = _assertionStats.assertionResult;
bool printInfoMessages = true;
// Drop out if result was successful and we're not printing those
if( !m_config->includeSuccessfulResults() && result.isOk() )
if( !m_config->includeSuccessfulResults() && result.isOk() ) {
if( result.getResultType() != ResultWas::Warning )
return false;
printInfoMessages = false;
}
lazyPrint();
AssertionPrinter printer( stream, _assertionStats );
AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
printer.print();
stream << std::endl;
return true;
@ -105,13 +110,14 @@ namespace Catch {
class AssertionPrinter {
void operator= ( AssertionPrinter const& );
public:
AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats )
AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
: stream( _stream ),
stats( _stats ),
result( _stats.assertionResult ),
colour( Colour::None ),
message( result.getMessage() ),
messages( _stats.infoMessages )
messages( _stats.infoMessages ),
printInfoMessages( _printInfoMessages )
{
switch( result.getResultType() ) {
case ResultWas::Ok:
@ -214,6 +220,8 @@ namespace Catch {
for( std::vector<MessageInfo>::const_iterator it = messages.begin(), itEnd = messages.end();
it != itEnd;
++it ) {
// If this assertion is a warning ignore any INFO messages
if( printInfoMessages || it->type != ResultWas::Info )
stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n";
}
}
@ -230,6 +238,7 @@ namespace Catch {
std::string messageLabel;
std::string message;
std::vector<MessageInfo> messages;
bool printInfoMessages;
};
void lazyPrint() {
@ -315,9 +324,14 @@ namespace Catch {
}
void printTotals( const Totals& totals ) {
if( totals.assertions.total() == 0 ) {
if( totals.testCases.total() == 0 ) {
stream << "No tests ran";
}
else if( totals.assertions.total() == 0 ) {
Colour colour( Colour::Yellow );
printCounts( "test case", totals.testCases );
stream << " (no assertions)";
}
else if( totals.assertions.failed ) {
Colour colour( Colour::ResultError );
printCounts( "test case", totals.testCases );

View File

@ -122,8 +122,6 @@ CheckFileList(CATCH_SINGLE_INCLUDE "single_include")
set(TEST_SOURCES
"${SELF_TEST_DIR}/ApproxTests.cpp"
"${SELF_TEST_DIR}/BDDTests.cpp"
"${SELF_TEST_DIR}/catch_self_test.cpp"
"${SELF_TEST_DIR}/catch_self_test.hpp"
"${SELF_TEST_DIR}/ClassTests.cpp"
"${SELF_TEST_DIR}/CmdLineTests.cpp"
"${SELF_TEST_DIR}/ConditionTests.cpp"

View File

@ -11,8 +11,8 @@
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Approx/simple",
"Some simple comparisons between doubles"
"Some simple comparisons between doubles",
"[Approx]"
)
{
double d = 1.23;
@ -29,8 +29,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Approx/epsilon",
"Approximate comparisons with different epsilons"
"Approximate comparisons with different epsilons",
"[Approx]"
)
{
double d = 1.23;
@ -42,8 +42,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Approx/float",
"Approximate comparisons with floats"
"Approximate comparisons with floats",
"[Approx]"
)
{
REQUIRE( 1.23f == Approx( 1.23f ) );
@ -53,8 +53,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Approx/int",
"Approximate comparisons with ints"
"Approximate comparisons with ints",
"[Approx]"
)
{
REQUIRE( 1 == Approx( 1 ) );
@ -64,8 +64,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Approx/mixed",
"Approximate comparisons with mixed numeric types"
"Approximate comparisons with mixed numeric types",
"[Approx]"
)
{
const double dZero = 0;
@ -82,8 +82,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Approx/custom",
"Use a custom approx"
"Use a custom approx",
"[Approx][custom]"
)
{
double d = 1.23;

View File

@ -4,7 +4,7 @@ CatchSelfTest is a <version> host application.
Run with -? for options
-------------------------------------------------------------------------------
./failing/TestClass/failingCase
A METHOD_AS_TEST_CASE based test run that fails
-------------------------------------------------------------------------------
ClassTests.cpp:<line number>
...............................................................................
@ -15,7 +15,7 @@ with expansion:
"hello" == "world"
-------------------------------------------------------------------------------
./failing/Fixture/failingCase
A TEST_CASE_METHOD based test run that fails
-------------------------------------------------------------------------------
ClassTests.cpp:<line number>
...............................................................................
@ -26,7 +26,7 @@ with expansion:
1 == 2
-------------------------------------------------------------------------------
./failing/conditions/equality
Equality checks that should fail]
-------------------------------------------------------------------------------
ConditionTests.cpp:<line number>
...............................................................................
@ -97,7 +97,7 @@ with expansion:
1.3 == Approx( 1.301 )
-------------------------------------------------------------------------------
./failing/conditions/inequality
Inequality checks that should fails
-------------------------------------------------------------------------------
ConditionTests.cpp:<line number>
...............................................................................
@ -128,7 +128,7 @@ with expansion:
5 != 5
-------------------------------------------------------------------------------
./failing/conditions/ordered
Ordering comparison checks that should fail
-------------------------------------------------------------------------------
ConditionTests.cpp:<line number>
...............................................................................
@ -229,7 +229,7 @@ with expansion:
"hello" <= "a"
-------------------------------------------------------------------------------
./failing/conditions/not
'Not' checks that should fail
-------------------------------------------------------------------------------
ConditionTests.cpp:<line number>
...............................................................................
@ -269,7 +269,7 @@ with expansion:
!(1 == 1)
-------------------------------------------------------------------------------
./failing/exceptions/explicit
Expected exceptions that don't throw or unexpected exceptions fail the test
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -289,7 +289,7 @@ due to unexpected exception with message:
expected exception
-------------------------------------------------------------------------------
./failing/exceptions/implicit
When unchecked exceptions are thrown directly they are always failures
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -299,7 +299,7 @@ due to unexpected exception with message:
unexpected exception
-------------------------------------------------------------------------------
./failing/exceptions/implicit/2
An unchecked exception reports the line of the last assertion
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -310,7 +310,7 @@ due to unexpected exception with message:
unexpected exception
-------------------------------------------------------------------------------
./failing/exceptions/implicit/3
When unchecked exceptions are thrown from sections they are always failures
section name
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
@ -321,7 +321,7 @@ due to unexpected exception with message:
unexpected exception
-------------------------------------------------------------------------------
./failing/exceptions/implicit/4
When unchecked exceptions are thrown from functions they are always failures
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -332,7 +332,7 @@ due to unexpected exception with message:
expected exception
-------------------------------------------------------------------------------
./failing/exceptions/custom
Unexpected custom exceptions can be translated
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -342,7 +342,7 @@ due to unexpected exception with message:
custom exception
-------------------------------------------------------------------------------
./failing/exceptions/custom/nothrow
Custom exceptions can be translated when testing for nothrow
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -353,7 +353,7 @@ due to unexpected exception with message:
custom exception - not std
-------------------------------------------------------------------------------
./failing/exceptions/custom/throw
Custom exceptions can be translated when testing for throwing as something else
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -364,7 +364,7 @@ due to unexpected exception with message:
custom exception - not std
-------------------------------------------------------------------------------
./failing/exceptions/custom/double
Unexpected exceptions can be translated
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
@ -374,7 +374,17 @@ due to unexpected exception with message:
3.14
-------------------------------------------------------------------------------
./failing/message/info/1
INFO and WARN do not abort tests
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
...............................................................................
MessageTests.cpp:<line number>:
warning:
this is a warning
-------------------------------------------------------------------------------
INFO gets logged on failure
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
...............................................................................
@ -388,7 +398,7 @@ with messages:
so should this
-------------------------------------------------------------------------------
./mixed/message/info/2
INFO gets logged on failure, even if captured before successful assertions
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
...............................................................................
@ -409,7 +419,7 @@ with message:
and this, but later
-------------------------------------------------------------------------------
./failing/message/fail
FAIL aborts the test
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
...............................................................................
@ -419,7 +429,7 @@ explicitly with message:
This is a failure
-------------------------------------------------------------------------------
./failing/message/sections
Output from all sections is reported
one
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
@ -430,7 +440,7 @@ explicitly with message:
Message from section one
-------------------------------------------------------------------------------
./failing/message/sections
Output from all sections is reported
two
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
@ -443,7 +453,7 @@ explicitly with message:
Message from section one
Message from section two
-------------------------------------------------------------------------------
./mixed/message/scoped
SCOPED_INFO is reset for each loop
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
...............................................................................
@ -467,7 +477,19 @@ explicitly with message:
Previous info should not be seen
-------------------------------------------------------------------------------
./mixed/Misc/Sections/nested2
sends information to INFO
-------------------------------------------------------------------------------
MessageTests.cpp:<line number>
...............................................................................
MessageTests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
hi
i := 7
-------------------------------------------------------------------------------
more nested SECTION tests
s1
s2
-------------------------------------------------------------------------------
@ -480,7 +502,7 @@ with expansion:
1 == 2
-------------------------------------------------------------------------------
./mixed/Misc/Sections/loops
looped SECTION tests
s1
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
@ -492,7 +514,7 @@ with expansion:
0 > 1
-------------------------------------------------------------------------------
./mixed/Misc/loops
looped tests
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -542,19 +564,7 @@ with message:
Some information
An error
-------------------------------------------------------------------------------
./failing/info
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
hi
i := 7
-------------------------------------------------------------------------------
./failing/checkedif
checkedIf, failing
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -570,7 +580,7 @@ with expansion:
false
-------------------------------------------------------------------------------
./failing/checkedelse
checkedElse, failing
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -586,7 +596,7 @@ with expansion:
false
-------------------------------------------------------------------------------
./manual/onechar
send a single char to INFO
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -597,7 +607,7 @@ with message:
3
-------------------------------------------------------------------------------
./failing/matchers/Contains
Contains string matcher
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -608,7 +618,7 @@ with expansion:
"this string contains 'abc' as a substring" contains: "not there"
-------------------------------------------------------------------------------
./failing/matchers/StartsWith
StartsWith string matcher
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -619,7 +629,7 @@ with expansion:
"this string contains 'abc' as a substring" starts with: "string"
-------------------------------------------------------------------------------
./failing/matchers/EndsWith
EndsWith string matcher
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -630,7 +640,7 @@ with expansion:
"this string contains 'abc' as a substring" ends with: "this"
-------------------------------------------------------------------------------
./failing/matchers/Equals
Equals string matcher
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -641,7 +651,17 @@ with expansion:
"this string contains 'abc' as a substring" equals: "something else"
-------------------------------------------------------------------------------
./failing/CatchSectionInfiniteLoop
Nice descriptive name
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
warning:
This one ran
-------------------------------------------------------------------------------
A couple of nested sections followed by a failure
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -651,7 +671,7 @@ explicitly with message:
to infinity and beyond
-------------------------------------------------------------------------------
./failing/CatchSectionInfiniteLoop
A couple of nested sections followed by a failure
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -661,7 +681,7 @@ explicitly with message:
to infinity and beyond
-------------------------------------------------------------------------------
./failing/CatchSectionInfiniteLoop
A couple of nested sections followed by a failure
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
@ -670,18 +690,32 @@ MiscTests.cpp:<line number>: FAILED:
explicitly with message:
to infinity and beyond
Message from section one
Message from section two
Some information
An error
Message from section one
Message from section two
Some information
An error
hello
hello
-------------------------------------------------------------------------------
./failing/Tricky/non streamable type
Where the is more to the expression after the RHS[failing]
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
TrickyTests.cpp:<line number>:
warning:
Uncomment the code in this test to check that it gives a sensible compiler
error
-------------------------------------------------------------------------------
Where the LHS is not a simple value[failing]
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
TrickyTests.cpp:<line number>:
warning:
Uncomment the code in this test to check that it gives a sensible compiler
error
-------------------------------------------------------------------------------
A failing expression with a non streamable type is still captured[failing]
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
@ -697,7 +731,7 @@ with expansion:
{?} == {?}
-------------------------------------------------------------------------------
./failing/string literals
string literals of different sizes can be compared[failing]
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
@ -708,5 +742,5 @@ with expansion:
"first" == "second"
===============================================================================
122 test cases - 35 failed (753 assertions - 90 failed)
120 test cases - 35 failed (673 assertions - 90 failed)

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ CatchSelfTest is a <version> host application.
Run with -? for options
-------------------------------------------------------------------------------
./succeeding/Approx/simple
Some simple comparisons between doubles
-------------------------------------------------------------------------------
ApproxTests.cpp:<line number>
...............................................................................
@ -46,7 +46,7 @@ with expansion:
Approx( 1.23 ) != 1.24
-------------------------------------------------------------------------------
./succeeding/Approx/epsilon
Approximate comparisons with different epsilons
-------------------------------------------------------------------------------
ApproxTests.cpp:<line number>
...............................................................................
@ -64,7 +64,7 @@ with expansion:
1.23 == Approx( 1.231 )
-------------------------------------------------------------------------------
./succeeding/Approx/float
Approximate comparisons with floats
-------------------------------------------------------------------------------
ApproxTests.cpp:<line number>
...............................................................................
@ -82,7 +82,7 @@ with expansion:
0 == Approx( 0 )
-------------------------------------------------------------------------------
./succeeding/Approx/int
Approximate comparisons with ints
-------------------------------------------------------------------------------
ApproxTests.cpp:<line number>
...............................................................................
@ -96,7 +96,7 @@ PASSED:
REQUIRE( 0 == Approx( 0 ) )
-------------------------------------------------------------------------------
./succeeding/Approx/mixed
Approximate comparisons with mixed numeric types
-------------------------------------------------------------------------------
ApproxTests.cpp:<line number>
...............................................................................
@ -132,7 +132,7 @@ with expansion:
1.234 == Approx( 1.234 )
-------------------------------------------------------------------------------
./succeeding/Approx/custom
Use a custom approx
-------------------------------------------------------------------------------
ApproxTests.cpp:<line number>
...............................................................................
@ -204,7 +204,7 @@ with expansion:
3.1428571429 != Approx( 3.141 )
-------------------------------------------------------------------------------
./succeeding/TestClass/succeedingCase
A METHOD_AS_TEST_CASE based test run that succeeds
-------------------------------------------------------------------------------
ClassTests.cpp:<line number>
...............................................................................
@ -216,7 +216,7 @@ with expansion:
"hello" == "hello"
-------------------------------------------------------------------------------
./failing/TestClass/failingCase
A METHOD_AS_TEST_CASE based test run that fails
-------------------------------------------------------------------------------
ClassTests.cpp:<line number>
...............................................................................
@ -227,7 +227,7 @@ with expansion:
"hello" == "world"
-------------------------------------------------------------------------------
./succeeding/Fixture/succeedingCase
A TEST_CASE_METHOD based test run that succeeds
-------------------------------------------------------------------------------
ClassTests.cpp:<line number>
...............................................................................
@ -239,7 +239,7 @@ with expansion:
1 == 1
-------------------------------------------------------------------------------
./failing/Fixture/failingCase
A TEST_CASE_METHOD based test run that fails
-------------------------------------------------------------------------------
ClassTests.cpp:<line number>
...............................................................................
@ -250,7 +250,7 @@ with expansion:
1 == 2
-------------------------------------------------------------------------------
./succeeding/conditions/equality
Equality checks that should succeed
-------------------------------------------------------------------------------
ConditionTests.cpp:<line number>
...............................................................................
@ -298,7 +298,7 @@ with expansion:
1.3 == Approx( 1.3 )
-------------------------------------------------------------------------------
./failing/conditions/equality
Equality checks that should fail]
-------------------------------------------------------------------------------
ConditionTests.cpp:<line number>
...............................................................................

View File

@ -1,26 +1,26 @@
<testsuites>
<testsuite name="~_" errors="10" failures="99" tests="772" hostname="tbd" time="{duration}" timestamp="tbd">
<testcase classname="global" name="./succeeding/Approx/simple" time="{duration}"/>
<testcase classname="global" name="./succeeding/Approx/epsilon" time="{duration}"/>
<testcase classname="global" name="./succeeding/Approx/float" time="{duration}"/>
<testcase classname="global" name="./succeeding/Approx/int" time="{duration}"/>
<testcase classname="global" name="./succeeding/Approx/mixed" time="{duration}"/>
<testcase classname="global" name="./succeeding/Approx/custom" time="{duration}"/>
<testsuite name="~_" errors="10" failures="99" tests="692" hostname="tbd" time="{duration}" timestamp="tbd">
<testcase classname="global" name="Some simple comparisons between doubles" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with different epsilons" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with floats" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with ints" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with mixed numeric types" time="{duration}"/>
<testcase classname="global" name="Use a custom approx" time="{duration}"/>
<testcase classname="global" name="Approximate PI" time="{duration}"/>
<testcase classname="TestClass" name="./succeeding/TestClass/succeedingCase" time="{duration}"/>
<testcase classname="TestClass" name="./failing/TestClass/failingCase" time="{duration}">
<testcase classname="TestClass" name="A METHOD_AS_TEST_CASE based test run that succeeds" time="{duration}"/>
<testcase classname="TestClass" name="A METHOD_AS_TEST_CASE based test run that fails" time="{duration}">
<failure message="&quot;hello&quot; == &quot;world&quot;" type="REQUIRE">
ClassTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="Fixture" name="./succeeding/Fixture/succeedingCase" time="{duration}"/>
<testcase classname="Fixture" name="./failing/Fixture/failingCase" time="{duration}">
<testcase classname="Fixture" name="A TEST_CASE_METHOD based test run that succeeds" time="{duration}"/>
<testcase classname="Fixture" name="A TEST_CASE_METHOD based test run that fails" time="{duration}">
<failure message="1 == 2" type="REQUIRE">
ClassTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/conditions/equality" time="{duration}"/>
<testcase classname="global" name="./failing/conditions/equality" time="{duration}">
<testcase classname="global" name="Equality checks that should succeed" time="{duration}"/>
<testcase classname="global" name="Equality checks that should fail]" time="{duration}">
<failure message="7 == 6" type="CHECK">
ConditionTests.cpp:<line number>
</failure>
@ -61,8 +61,8 @@ ConditionTests.cpp:<line number>
ConditionTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/conditions/inequality" time="{duration}"/>
<testcase classname="global" name="./failing/conditions/inequality" time="{duration}">
<testcase classname="global" name="Inequality checks that should succeed" time="{duration}"/>
<testcase classname="global" name="Inequality checks that should fails" time="{duration}">
<failure message="7 != 7" type="CHECK">
ConditionTests.cpp:<line number>
</failure>
@ -79,8 +79,8 @@ ConditionTests.cpp:<line number>
ConditionTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/conditions/ordered" time="{duration}"/>
<testcase classname="global" name="./failing/conditions/ordered" time="{duration}">
<testcase classname="global" name="Ordering comparison checks that should succeed" time="{duration}"/>
<testcase classname="global" name="Ordering comparison checks that should fail" time="{duration}">
<failure message="7 > 7" type="CHECK">
ConditionTests.cpp:<line number>
</failure>
@ -139,14 +139,14 @@ ConditionTests.cpp:<line number>
ConditionTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/conditions/int literals" time="{duration}"/>
<testcase classname="global" name="./succeeding/conditions//long_to_unsigned_x" time="{duration}"/>
<testcase classname="global" name="./succeeding/conditions/const ints to int literal" time="{duration}"/>
<testcase classname="global" name="./succeeding/conditions/negative ints" time="{duration}"/>
<testcase classname="global" name="./succeeding/conditions/computed ints" time="{duration}"/>
<testcase classname="global" name="./succeeding/conditions/ptr" time="{duration}"/>
<testcase classname="global" name="./succeeding/conditions/not" time="{duration}"/>
<testcase classname="global" name="./failing/conditions/not" time="{duration}">
<testcase classname="global" name="Comparisons with int literals don't warn when mixing signed/ unsigned" time="{duration}"/>
<testcase classname="global" name="comparisons between int variables" time="{duration}"/>
<testcase classname="global" name="comparisons between const int variables" time="{duration}"/>
<testcase classname="global" name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" time="{duration}"/>
<testcase classname="global" name="Comparisons between ints where one side is computed" time="{duration}"/>
<testcase classname="global" name="Pointers can be compared to null" time="{duration}"/>
<testcase classname="global" name="'Not' checks that should succeed" time="{duration}"/>
<testcase classname="global" name="'Not' checks that should fail" time="{duration}">
<failure message="false != false" type="CHECK">
ConditionTests.cpp:<line number>
</failure>
@ -172,8 +172,8 @@ ConditionTests.cpp:<line number>
ConditionTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/exceptions/explicit" time="{duration}"/>
<testcase classname="global" name="./failing/exceptions/explicit" time="{duration}">
<testcase classname="global" name="When checked exceptions are thrown they can be expected or unexpected" time="{duration}"/>
<testcase classname="global" name="Expected exceptions that don't throw or unexpected exceptions fail the test" time="{duration}">
<error message="thisThrows()" type="CHECK_THROWS_AS">
expected exception
ExceptionTests.cpp:<line number>
@ -186,67 +186,67 @@ expected exception
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/implicit" time="{duration}">
<testcase classname="global" name="When unchecked exceptions are thrown directly they are always failures" time="{duration}">
<error type="TEST_CASE">
unexpected exception
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/implicit/2" time="{duration}">
<testcase classname="global" name="An unchecked exception reports the line of the last assertion" time="{duration}">
<error message="{Unknown expression after the reported line}">
unexpected exception
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="./failing/exceptions/implicit/3" name="section name" time="{duration}">
<testcase classname="When unchecked exceptions are thrown from sections they are always failures" name="section name" time="{duration}">
<error type="TEST_CASE">
unexpected exception
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/implicit/4" time="{duration}">
<testcase classname="global" name="When unchecked exceptions are thrown from functions they are always failures" time="{duration}">
<error message="thisThrows() == 0" type="CHECK">
expected exception
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/custom" time="{duration}">
<testcase classname="global" name="Unexpected custom exceptions can be translated" time="{duration}">
<error type="TEST_CASE">
custom exception
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/custom/nothrow" time="{duration}">
<testcase classname="global" name="Custom exceptions can be translated when testing for nothrow" time="{duration}">
<error message="throwCustom()" type="REQUIRE_NOTHROW">
custom exception - not std
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/custom/throw" time="{duration}">
<testcase classname="global" name="Custom exceptions can be translated when testing for throwing as something else" time="{duration}">
<error message="throwCustom()" type="REQUIRE_THROWS_AS">
custom exception - not std
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./failing/exceptions/custom/double" time="{duration}">
<testcase classname="global" name="Unexpected exceptions can be translated" time="{duration}">
<error type="TEST_CASE">
3.14
ExceptionTests.cpp:<line number>
</error>
</testcase>
<testcase classname="global" name="./succeeding/exceptions/notimplemented" time="{duration}"/>
<testcase classname="global" name="./succeeding/generators/1" time="{duration}"/>
<testcase classname="global" name="./succeeding/generators/2" time="{duration}"/>
<testcase classname="global" name="./succeeding/message" time="{duration}"/>
<testcase classname="global" name="./succeeding/succeed" time="{duration}"/>
<testcase classname="global" name="./failing/message/info/1" time="{duration}">
<testcase classname="global" name="NotImplemented exception" time="{duration}"/>
<testcase classname="global" name="Generators over two ranges" time="{duration}"/>
<testcase classname="global" name="Generator over a range of pairs" time="{duration}"/>
<testcase classname="global" name="INFO and WARN do not abort tests" time="{duration}"/>
<testcase classname="global" name="SUCCEED counts as a test pass" time="{duration}"/>
<testcase classname="global" name="INFO gets logged on failure" time="{duration}">
<failure message="2 == 1" type="REQUIRE">
this message should be logged
so should this
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./mixed/message/info/2" time="{duration}">
<testcase classname="global" name="INFO gets logged on failure, even if captured before successful assertions" time="{duration}">
<failure message="2 == 1" type="CHECK">
this message should be logged
MessageTests.cpp:<line number>
@ -256,61 +256,68 @@ and this, but later
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./failing/message/fail" time="{duration}">
<testcase classname="global" name="FAIL aborts the test" time="{duration}">
<failure type="FAIL">
This is a failure
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="./failing/message/sections" name="one" time="{duration}">
<testcase classname="Output from all sections is reported" name="one" time="{duration}">
<failure type="FAIL">
Message from section one
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="./failing/message/sections" name="two" time="{duration}">
<testcase classname="Output from all sections is reported" name="two" time="{duration}">
<failure type="FAIL">
Message from section two
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="./succeeding/message/sections/stdout" name="two" time="{duration}">
<testcase classname="Standard output from all sections is reported" name="two" time="{duration}">
<system-out>
Message from section one
Message from section two
</system-out>
</testcase>
<testcase classname="global" name="./mixed/message/scoped" time="{duration}">
<testcase classname="global" name="SCOPED_INFO is reset for each loop" time="{duration}">
<failure message="10 &lt; 10" type="REQUIRE">
current counter 10
i := 10
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/nofail" time="{duration}"/>
<testcase classname="global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}"/>
<testcase classname="global" name="just failure" time="{duration}">
<failure type="FAIL">
Previous info should not be seen
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="./succeeding/Misc/Sections" name="s1" time="{duration}"/>
<testcase classname="./succeeding/Misc/Sections" name="s2" time="{duration}"/>
<testcase classname="./succeeding/Misc/Sections/nested" name="s1" time="{duration}"/>
<testcase classname="./succeeding/Misc/Sections/nested" name="s1/s2" time="{duration}"/>
<testcase classname="./mixed/Misc/Sections/nested2" name="s1/s2" time="{duration}">
<testcase classname="global" name="sends information to INFO" time="{duration}">
<failure message="false" type="REQUIRE">
hi
i := 7
MessageTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="random SECTION tests" name="s1" time="{duration}"/>
<testcase classname="random SECTION tests" name="s2" time="{duration}"/>
<testcase classname="nested SECTION tests" name="s1" time="{duration}"/>
<testcase classname="nested SECTION tests" name="s1/s2" time="{duration}"/>
<testcase classname="more nested SECTION tests" name="s1/s2" time="{duration}">
<failure message="1 == 2" type="REQUIRE">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="./mixed/Misc/Sections/nested2" name="s1/s3" time="{duration}"/>
<testcase classname="./mixed/Misc/Sections/nested2" name="s1/s4" time="{duration}"/>
<testcase classname="./mixed/Misc/Sections/loops" name="s1" time="{duration}">
<testcase classname="more nested SECTION tests" name="s1/s3" time="{duration}"/>
<testcase classname="more nested SECTION tests" name="s1/s4" time="{duration}"/>
<testcase classname="looped SECTION tests" name="s1" time="{duration}">
<failure message="0 > 1" type="CHECK">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./mixed/Misc/loops" time="{duration}">
<testcase classname="global" name="looped tests" time="{duration}">
<failure message="1 == 0" type="CHECK">
Testing if fib[0] (1) is even
MiscTests.cpp:<line number>
@ -336,7 +343,7 @@ Testing if fib[7] (21) is even
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/Misc/stdout,stderr" time="{duration}">
<testcase classname="global" name="Sends stuff to stdout and stderr" time="{duration}">
<system-out>
Some information
</system-out>
@ -344,16 +351,9 @@ Some information
An error
</system-err>
</testcase>
<testcase classname="global" name="./succeeding/Misc/null strings" time="{duration}"/>
<testcase classname="global" name="./failing/info" time="{duration}">
<failure message="false" type="REQUIRE">
hi
i := 7
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/checkedif" time="{duration}"/>
<testcase classname="global" name="./failing/checkedif" time="{duration}">
<testcase classname="global" name="null strings" time="{duration}"/>
<testcase classname="global" name="checkedIf" time="{duration}"/>
<testcase classname="global" name="checkedIf, failing" time="{duration}">
<failure message="false" type="CHECKED_IF">
MiscTests.cpp:<line number>
</failure>
@ -361,8 +361,8 @@ MiscTests.cpp:<line number>
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/checkedelse" time="{duration}"/>
<testcase classname="global" name="./failing/checkedelse" time="{duration}">
<testcase classname="global" name="checkedElse" time="{duration}"/>
<testcase classname="global" name="checkedElse, failing" time="{duration}">
<failure message="false" type="CHECKED_ELSE">
MiscTests.cpp:<line number>
</failure>
@ -370,38 +370,38 @@ MiscTests.cpp:<line number>
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./manual/onechar" time="{duration}">
<testcase classname="global" name="send a single char to INFO" time="{duration}">
<failure message="false" type="REQUIRE">
3
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/atomic if" time="{duration}"/>
<testcase classname="global" name="./succeeding/matchers" time="{duration}"/>
<testcase classname="global" name="./failing/matchers/Contains" time="{duration}">
<testcase classname="global" name="atomic if" time="{duration}"/>
<testcase classname="global" name="String matchers" time="{duration}"/>
<testcase classname="global" name="Contains string matcher" time="{duration}">
<failure message="&quot;this string contains 'abc' as a substring&quot; contains: &quot;not there&quot;" type="CHECK_THAT">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./failing/matchers/StartsWith" time="{duration}">
<testcase classname="global" name="StartsWith string matcher" time="{duration}">
<failure message="&quot;this string contains 'abc' as a substring&quot; starts with: &quot;string&quot;" type="CHECK_THAT">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./failing/matchers/EndsWith" time="{duration}">
<testcase classname="global" name="EndsWith string matcher" time="{duration}">
<failure message="&quot;this string contains 'abc' as a substring&quot; ends with: &quot;this&quot;" type="CHECK_THAT">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./failing/matchers/Equals" time="{duration}">
<testcase classname="global" name="Equals string matcher" time="{duration}">
<failure message="&quot;this string contains 'abc' as a substring&quot; equals: &quot;something else&quot;" type="CHECK_THAT">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="string" time="{duration}"/>
<testcase classname="global" name="./succeeding/matchers/AllOf" time="{duration}"/>
<testcase classname="global" name="./succeeding/matchers/AnyOf" time="{duration}"/>
<testcase classname="global" name="./succeeding/matchers/Equals" time="{duration}"/>
<testcase classname="global" name="Equals string matcher, with NULL" time="{duration}"/>
<testcase classname="global" name="AllOf matcher" time="{duration}"/>
<testcase classname="global" name="AnyOf matcher" time="{duration}"/>
<testcase classname="global" name="Equals" time="{duration}"/>
<testcase classname="global" name="Factorials are computed" time="{duration}"/>
<testcase classname="global" name="Nice descriptive name" time="{duration}"/>
<testcase classname="vectors can be sized and resized" name="root" time="{duration}"/>
@ -410,7 +410,7 @@ MiscTests.cpp:<line number>
<testcase classname="vectors can be sized and resized" name="resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
<testcase classname="vectors can be sized and resized" name="reserving bigger changes capacity but not size" time="{duration}"/>
<testcase classname="vectors can be sized and resized" name="reserving smaller does not change size or capacity" time="{duration}"/>
<testcase classname="./failing/CatchSectionInfiniteLoop" name="root" time="{duration}">
<testcase classname="A couple of nested sections followed by a failure" name="root" time="{duration}">
<failure type="FAIL">
to infinity and beyond
MiscTests.cpp:<line number>
@ -424,25 +424,7 @@ to infinity and beyond
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="./failing/CatchSectionInfiniteLoop" name="Outer/Inner" time="{duration}"/>
<testcase classname="selftest/main" name="selftest/expected result/selftest/expected result/failing tests" time="{duration}"/>
<testcase classname="selftest/main" name="selftest/expected result/selftest/expected result/succeeding tests" time="{duration}"/>
<testcase classname="selftest/main" name="selftest/test counts/selftest/test counts/succeeding tests" time="{duration}"/>
<testcase classname="selftest/main" name="selftest/test counts/selftest/test counts/failing tests" time="{duration}">
<system-out>
Message from section one
Message from section two
Some information
Message from section one
Message from section two
Some information
</system-out>
<system-err>
An error
An error
</system-err>
</testcase>
<testcase classname="global" name="meta/Misc/Sections" time="{duration}"/>
<testcase classname="A couple of nested sections followed by a failure" name="Outer/Inner" time="{duration}"/>
<testcase classname="Process can be configured on command line" name="default - no arguments" time="{duration}"/>
<testcase classname="Process can be configured on command line" name="test lists/1 test" time="{duration}"/>
<testcase classname="Process can be configured on command line" name="test lists/Specify one test case exclusion using exclude:" time="{duration}"/>
@ -493,10 +475,10 @@ hello
</testcase>
<testcase classname="global" name="Text can be formatted using the Text class" time="{duration}"/>
<testcase classname="global" name="Long text is truncted" time="{duration}"/>
<testcase classname="global" name="./succeeding/Tricky/std::pair" time="{duration}"/>
<testcase classname="global" name="./inprogress/failing/Tricky/trailing expression" time="{duration}"/>
<testcase classname="global" name="./inprogress/failing/Tricky/compound lhs" time="{duration}"/>
<testcase classname="global" name="./failing/Tricky/non streamable type" time="{duration}">
<testcase classname="global" name="Parsing a std::pair" time="{duration}"/>
<testcase classname="global" name="Where the is more to the expression after the RHS[failing]" time="{duration}"/>
<testcase classname="global" name="Where the LHS is not a simple value[failing]" time="{duration}"/>
<testcase classname="global" name="A failing expression with a non streamable type is still captured[failing]" time="{duration}">
<failure message="0x<hex digits> == 0x<hex digits>" type="CHECK">
TrickyTests.cpp:<line number>
</failure>
@ -504,22 +486,22 @@ TrickyTests.cpp:<line number>
TrickyTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./failing/string literals" time="{duration}">
<testcase classname="global" name="string literals of different sizes can be compared[failing]" time="{duration}">
<failure message="&quot;first&quot; == &quot;second&quot;" type="REQUIRE">
TrickyTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="./succeeding/side-effects" time="{duration}"/>
<testcase classname="global" name="./succeeding/koenig" time="{duration}"/>
<testcase classname="global" name="./succeeding/non-const==" time="{duration}"/>
<testcase classname="global" name="./succeeding/enum/bits" time="{duration}"/>
<testcase classname="global" name="./succeeding/boolean member" time="{duration}"/>
<testcase classname="./succeeding/unimplemented static bool" name="compare to true" time="{duration}"/>
<testcase classname="./succeeding/unimplemented static bool" name="compare to false" time="{duration}"/>
<testcase classname="./succeeding/unimplemented static bool" name="negation" time="{duration}"/>
<testcase classname="./succeeding/unimplemented static bool" name="double negation" time="{duration}"/>
<testcase classname="./succeeding/unimplemented static bool" name="direct" time="{duration}"/>
<testcase classname="global" name="./succeeding/SafeBool" time="{duration}"/>
<testcase classname="global" name="An expression with side-effects should only be evaluated once" time="{duration}"/>
<testcase classname="global" name="Operators at different namespace levels not hijacked by Koenig lookup" time="{duration}"/>
<testcase classname="global" name="Demonstrate that a non-const == is not used" time="{duration}"/>
<testcase classname="global" name="Test enum bit values" time="{duration}"/>
<testcase classname="global" name="boolean member" time="{duration}"/>
<testcase classname="(unimplemented) static bools can be evaluated" name="compare to true" time="{duration}"/>
<testcase classname="(unimplemented) static bools can be evaluated" name="compare to false" time="{duration}"/>
<testcase classname="(unimplemented) static bools can be evaluated" name="negation" time="{duration}"/>
<testcase classname="(unimplemented) static bools can be evaluated" name="double negation" time="{duration}"/>
<testcase classname="(unimplemented) static bools can be evaluated" name="direct" time="{duration}"/>
<testcase classname="global" name="Objects that evaluated in boolean contexts can be checked" time="{duration}"/>
<testcase classname="Assertions then sections" name="root" time="{duration}"/>
<testcase classname="Assertions then sections" name="A section" time="{duration}"/>
<testcase classname="Assertions then sections" name="A section/Another section" time="{duration}"/>
@ -563,18 +545,10 @@ TrickyTests.cpp:<line number>
Message from section one
Message from section two
Some information
Message from section one
Message from section two
Some information
Message from section one
Message from section two
Some information
hello
hello
</system-out>
<system-err>
An error
An error
An error
</system-err>
</testsuite>

View File

@ -1,6 +1,6 @@
<Catch name="CatchSelfTest">
<Group name="~_">
<TestCase name="./succeeding/Approx/simple">
<TestCase name="Some simple comparisons between doubles">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ApproxTests.cpp" >
<Original>
d == Approx( 1.23 )
@ -51,7 +51,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Approx/epsilon">
<TestCase name="Approximate comparisons with different epsilons">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ApproxTests.cpp" >
<Original>
d != Approx( 1.231 )
@ -70,7 +70,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Approx/float">
<TestCase name="Approximate comparisons with floats">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ApproxTests.cpp" >
<Original>
1.23f == Approx( 1.23f )
@ -89,7 +89,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Approx/int">
<TestCase name="Approximate comparisons with ints">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ApproxTests.cpp" >
<Original>
1 == Approx( 1 )
@ -108,7 +108,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Approx/mixed">
<TestCase name="Approximate comparisons with mixed numeric types">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ApproxTests.cpp" >
<Original>
1.0f == Approx( 1 )
@ -151,7 +151,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Approx/custom">
<TestCase name="Use a custom approx">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ApproxTests.cpp" >
<Original>
d == approx( 1.23 )
@ -237,7 +237,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/TestClass/succeedingCase">
<TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ClassTests.cpp" >
<Original>
s == &quot;hello&quot;
@ -248,7 +248,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/TestClass/failingCase">
<TestCase name="A METHOD_AS_TEST_CASE based test run that fails">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ClassTests.cpp" >
<Original>
s == &quot;world&quot;
@ -259,7 +259,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/Fixture/succeedingCase">
<TestCase name="A TEST_CASE_METHOD based test run that succeeds">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ClassTests.cpp" >
<Original>
m_a == 1
@ -270,7 +270,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/Fixture/failingCase">
<TestCase name="A TEST_CASE_METHOD based test run that fails">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ClassTests.cpp" >
<Original>
m_a == 2
@ -281,7 +281,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/conditions/equality">
<TestCase name="Equality checks that should succeed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
data.int_seven == 7
@ -340,7 +340,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/conditions/equality">
<TestCase name="Equality checks that should fail]">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
data.int_seven == 6
@ -447,7 +447,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/conditions/inequality">
<TestCase name="Inequality checks that should succeed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
data.int_seven != 6
@ -538,7 +538,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/conditions/inequality">
<TestCase name="Inequality checks that should fails">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
data.int_seven != 7
@ -581,7 +581,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/conditions/ordered">
<TestCase name="Ordering comparison checks that should succeed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
data.int_seven &lt; 8
@ -720,7 +720,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/conditions/ordered">
<TestCase name="Ordering comparison checks that should fail">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
data.int_seven > 7
@ -875,7 +875,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/conditions/int literals">
<TestCase name="Comparisons with int literals don't warn when mixing signed/ unsigned">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
i == 1
@ -982,7 +982,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/conditions//long_to_unsigned_x">
<TestCase name="comparisons between int variables">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
long_var == unsigned_char_var
@ -1017,7 +1017,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/conditions/const ints to int literal">
<TestCase name="comparisons between const int variables">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
unsigned_char_var == 1
@ -1052,7 +1052,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/conditions/negative ints">
<TestCase name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
( -1 > 2u )
@ -1103,7 +1103,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/conditions/computed ints">
<TestCase name="Comparisons between ints where one side is computed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
54 == 6*9
@ -1114,7 +1114,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/conditions/ptr">
<TestCase name="Pointers can be compared to null">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
p == __null
@ -1181,7 +1181,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/conditions/not">
<TestCase name="'Not' checks that should succeed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
false == false
@ -1248,7 +1248,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/conditions/not">
<TestCase name="'Not' checks that should fail">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ConditionTests.cpp" >
<Original>
false != false
@ -1315,7 +1315,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/exceptions/explicit">
<TestCase name="When checked exceptions are thrown they can be expected or unexpected">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
thisThrows()
@ -1342,7 +1342,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/exceptions/explicit">
<TestCase name="Expected exceptions that don't throw or unexpected exceptions fail the test">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
thisThrows()
@ -1375,13 +1375,13 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/implicit">
<TestCase name="When unchecked exceptions are thrown directly they are always failures">
<Exception filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
unexpected exception
</Exception>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/implicit/2">
<TestCase name="An unchecked exception reports the line of the last assertion">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
1 == 1
@ -1403,7 +1403,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/implicit/3">
<TestCase name="When unchecked exceptions are thrown from sections they are always failures">
<Section name="section name">
<Exception filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
unexpected exception
@ -1412,7 +1412,7 @@
</Section>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/implicit/4">
<TestCase name="When unchecked exceptions are thrown from functions they are always failures">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
thisThrows() == 0
@ -1426,16 +1426,16 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/exceptions/implicit">
<TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test">
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/exceptions/custom">
<TestCase name="Unexpected custom exceptions can be translated">
<Exception filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
custom exception
</Exception>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/custom/nothrow">
<TestCase name="Custom exceptions can be translated when testing for nothrow">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
throwCustom()
@ -1449,7 +1449,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/custom/throw">
<TestCase name="Custom exceptions can be translated when testing for throwing as something else">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
throwCustom()
@ -1463,13 +1463,13 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/exceptions/custom/double">
<TestCase name="Unexpected exceptions can be translated">
<Exception filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
3.14
</Exception>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/exceptions/notimplemented">
<TestCase name="NotImplemented exception">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" >
<Original>
thisFunctionNotImplemented( 7 )
@ -1480,7 +1480,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/generators/1">
<TestCase name="Generators over two ranges">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/GeneratorTests.cpp" >
<Original>
multiply( i, 2 ) == i*2
@ -2635,7 +2635,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/generators/2">
<TestCase name="Generator over a range of pairs">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/GeneratorTests.cpp" >
<Original>
i->first == i->second-1
@ -2654,7 +2654,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/message">
<TestCase name="INFO and WARN do not abort tests">
<Info>
this is a message
</Info>
@ -2663,10 +2663,10 @@
</Warning>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/succeed">
<TestCase name="SUCCEED counts as a test pass">
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/message/info/1">
<TestCase name="INFO gets logged on failure">
<Info>
this message should be logged
</Info>
@ -2683,7 +2683,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./mixed/message/info/2">
<TestCase name="INFO gets logged on failure, even if captured before successful assertions">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MessageTests.cpp" >
<Original>
a == 2
@ -2724,13 +2724,13 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/message/fail">
<TestCase name="FAIL aborts the test">
<Failure>
This is a failure
</Failure>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/message/sections">
<TestCase name="Output from all sections is reported">
<Section name="one">
<Failure>
Message from section one
@ -2745,7 +2745,7 @@
</Section>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/message/sections/stdout">
<TestCase name="Standard output from all sections is reported">
<Section name="one">
<OverallResults successes="0" failures="1"/>
</Section>
@ -2754,7 +2754,7 @@
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./mixed/message/scoped">
<TestCase name="SCOPED_INFO is reset for each loop">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MessageTests.cpp" >
<Original>
i &lt; 10
@ -2851,7 +2851,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/nofail">
<TestCase name="The NO_FAIL macro reports a failure but does not fail the test">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MessageTests.cpp" >
<Original>
1 == 2
@ -2871,7 +2871,24 @@
</Failure>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/Misc/Sections">
<TestCase name="sends information to INFO">
<Info>
hi
</Info>
<Info>
i := 7
</Info>
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MessageTests.cpp" >
<Original>
false
</Original>
<Expanded>
false
</Expanded>
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="random SECTION tests">
<Section name="s1" description="doesn't equal">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
@ -2904,7 +2921,7 @@
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Misc/Sections/nested">
<TestCase name="nested SECTION tests">
<Section name="s1" description="doesn't equal">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
@ -2956,7 +2973,7 @@
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./mixed/Misc/Sections/nested2">
<TestCase name="more nested SECTION tests">
<Section name="s1" description="doesn't equal">
<OverallResults successes="0" failures="0"/>
</Section>
@ -3004,7 +3021,7 @@
</Section>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./Sections/nested/a/b">
<TestCase name="even more nested SECTION tests">
<Section name="c">
<OverallResults successes="0" failures="0"/>
</Section>
@ -3025,7 +3042,7 @@
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./mixed/Misc/Sections/loops">
<TestCase name="looped SECTION tests">
<Section name="s1" description="b is currently: 0">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
@ -3039,7 +3056,7 @@
</Section>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./mixed/Misc/loops">
<TestCase name="looped tests">
<Info>
Testing if fib[0] (1) is even
</Info>
@ -3124,10 +3141,10 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/Misc/stdout,stderr">
<TestCase name="Sends stuff to stdout and stderr">
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Misc/null strings">
<TestCase name="null strings">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
makeString( false ) != static_cast&lt;char*>(__null)
@ -3146,24 +3163,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/info">
<Info>
hi
</Info>
<Info>
i := 7
</Info>
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
false
</Original>
<Expanded>
false
</Expanded>
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/checkedif">
<TestCase name="checkedIf">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
flag
@ -3182,7 +3182,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/checkedif">
<TestCase name="checkedIf, failing">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
flag
@ -3201,7 +3201,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/checkedelse">
<TestCase name="checkedElse">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
flag
@ -3220,7 +3220,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/checkedelse">
<TestCase name="checkedElse, failing">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
flag
@ -3239,7 +3239,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./misc/xmlentitycheck">
<TestCase name="xmlentitycheck">
<Section name="embedded xml" description="&lt;test>it should be possible to embed xml characters, such as &lt;, &quot; or &amp;, or even whole &lt;xml>documents&lt;/xml> within an attribute&lt;/test>">
<OverallResults successes="0" failures="1"/>
</Section>
@ -3248,7 +3248,7 @@
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./manual/onechar">
<TestCase name="send a single char to INFO">
<Info>
3
</Info>
@ -3262,7 +3262,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/atomic if">
<TestCase name="atomic if">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
x == 0
@ -3273,7 +3273,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/matchers">
<TestCase name="String matchers">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() Contains( &quot;string&quot; )
@ -3308,7 +3308,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/matchers/Contains">
<TestCase name="Contains string matcher">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() Contains( &quot;not there&quot; )
@ -3319,7 +3319,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/matchers/StartsWith">
<TestCase name="StartsWith string matcher">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() StartsWith( &quot;string&quot; )
@ -3330,7 +3330,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/matchers/EndsWith">
<TestCase name="EndsWith string matcher">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() EndsWith( &quot;this&quot; )
@ -3341,7 +3341,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/matchers/Equals">
<TestCase name="Equals string matcher">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() Equals( &quot;something else&quot; )
@ -3352,7 +3352,7 @@
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="string">
<TestCase name="Equals string matcher, with NULL">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
&quot;&quot; Equals(__null)
@ -3363,7 +3363,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/matchers/AllOf">
<TestCase name="AllOf matcher">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() AllOf( Catch::Contains( &quot;string&quot; ), Catch::Contains( &quot;abc&quot; ) )
@ -3374,7 +3374,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/matchers/AnyOf">
<TestCase name="AnyOf matcher">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() AnyOf( Catch::Contains( &quot;string&quot; ), Catch::Contains( &quot;not there&quot; ) )
@ -3393,7 +3393,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/matchers/Equals">
<TestCase name="Equals">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
testStringForMatching() Equals( &quot;this string contains 'abc' as a substring&quot; )
@ -3447,7 +3447,7 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="empty">
<TestCase name="An empty test with no assertions">
<OverallResult success="true"/>
</TestCase>
<TestCase name="Nice descriptive name">
@ -3667,7 +3667,7 @@
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/CatchSectionInfiniteLoop">
<TestCase name="A couple of nested sections followed by a failure">
<Failure>
to infinity and beyond
</Failure>
@ -3688,90 +3688,6 @@
</Failure>
<OverallResult success="false"/>
</TestCase>
<TestCase name="selftest/main">
<Section name="selftest/expected result" description="Tests do what they claim">
<OverallResults successes="0" failures="0"/>
</Section>
<Section name="selftest/expected result" description="Tests do what they claim">
<Section name="selftest/expected result/failing tests" description="Tests in the 'failing' branch fail">
<OverallResults successes="28" failures="0"/>
</Section>
<OverallResults successes="28" failures="0"/>
</Section>
<Section name="selftest/expected result" description="Tests do what they claim">
<Section name="selftest/expected result/succeeding tests" description="Tests in the 'succeeding' branch succeed">
<OverallResults successes="46" failures="0"/>
</Section>
<OverallResults successes="46" failures="0"/>
</Section>
<Section name="selftest/test counts" description="Number of test cases that run is fixed">
<OverallResults successes="0" failures="0"/>
</Section>
<Section name="selftest/test counts" description="Number of test cases that run is fixed">
<Section name="selftest/test counts/succeeding tests" description="Number of 'succeeding' tests is fixed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
<Original>
totals.assertions.passed == 298
</Original>
<Expanded>
298 == 298
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
<Original>
totals.assertions.failed == 0
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<OverallResults successes="2" failures="0"/>
</Section>
<OverallResults successes="2" failures="0"/>
</Section>
<Section name="selftest/test counts" description="Number of test cases that run is fixed">
<Section name="selftest/test counts/failing tests" description="Number of 'failing' tests is fixed">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
<Original>
totals.assertions.passed == 2
</Original>
<Expanded>
2 == 2
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
<Original>
totals.assertions.failed == 77
</Original>
<Expanded>
77 == 77
</Expanded>
</Expression>
<OverallResults successes="2" failures="0"/>
</Section>
<OverallResults successes="2" failures="0"/>
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="meta/Misc/Sections">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
<Original>
totals.assertions.passed == 2
</Original>
<Expanded>
2 == 2
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
<Original>
totals.assertions.failed == 1
</Original>
<Expanded>
1 == 1
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Process can be configured on command line">
<Section name="default - no arguments">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
@ -6374,7 +6290,7 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/Tricky/std::pair">
<TestCase name="Parsing a std::pair">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
(std::pair&lt;int, int>( 1, 2 )) == aNicePair
@ -6385,19 +6301,19 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./inprogress/failing/Tricky/trailing expression">
<TestCase name="Where the is more to the expression after the RHS[failing]">
<Warning>
Uncomment the code in this test to check that it gives a sensible compiler error
</Warning>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./inprogress/failing/Tricky/compound lhs">
<TestCase name="Where the LHS is not a simple value[failing]">
<Warning>
Uncomment the code in this test to check that it gives a sensible compiler error
</Warning>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./failing/Tricky/non streamable type">
<TestCase name="A failing expression with a non streamable type is still captured[failing]">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
&amp;o1 == &amp;o2
@ -6416,7 +6332,7 @@ there&quot;
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./failing/string literals">
<TestCase name="string literals of different sizes can be compared[failing]">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
std::string( &quot;first&quot; ) == &quot;second&quot;
@ -6427,7 +6343,7 @@ there&quot;
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="./succeeding/side-effects">
<TestCase name="An expression with side-effects should only be evaluated once">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
i++ == 7
@ -6446,7 +6362,7 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/koenig">
<TestCase name="Operators at different namespace levels not hijacked by Koenig lookup">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
0x<hex digits> == o
@ -6457,7 +6373,7 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/non-const==">
<TestCase name="Demonstrate that a non-const == is not used">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
t == 1u
@ -6468,7 +6384,7 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/enum/bits">
<TestCase name="Test enum bit values">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
0x<hex digits> == bit30and31
@ -6479,7 +6395,7 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/boolean member">
<TestCase name="boolean member">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
obj.prop != __null
@ -6490,7 +6406,7 @@ there&quot;
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/unimplemented static bool">
<TestCase name="(unimplemented) static bools can be evaluated">
<Section name="compare to true">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
@ -6572,7 +6488,7 @@ there&quot;
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="./succeeding/SafeBool">
<TestCase name="Objects that evaluated in boolean contexts can be checked">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
<Original>
True
@ -7482,7 +7398,7 @@ there&quot;
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="663" failures="109"/>
<OverallResults successes="583" failures="109"/>
</Group>
<OverallResults successes="663" failures="109"/>
<OverallResults successes="583" failures="109"/>
</Catch>

View File

@ -31,8 +31,8 @@ namespace
}
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds [class]" )
METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails [class]" )
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "A METHOD_AS_TEST_CASE based test run that succeeds", "[class]" )
METHOD_AS_TEST_CASE( TestClass::failingCase, "A METHOD_AS_TEST_CASE based test run that fails", "[.][class][failing]" )
struct Fixture
@ -42,7 +42,7 @@ struct Fixture
int m_a;
};
TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method based test run that succeeds [class]" )
TEST_CASE_METHOD( Fixture, "A TEST_CASE_METHOD based test run that succeeds", "[class]" )
{
REQUIRE( m_a == 1 );
}
@ -50,7 +50,7 @@ TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method base
// We should be able to write our tests within a different namespace
namespace Inner
{
TEST_CASE_METHOD( Fixture, "./failing/Fixture/failingCase", "A method based test run that fails [class]" )
TEST_CASE_METHOD( Fixture, "A TEST_CASE_METHOD based test run that fails", "[.][class][failing]" )
{
REQUIRE( m_a == 2 );
}

View File

@ -43,8 +43,7 @@ struct TestDef {
// This allows us to see all results, even if an earlier check fails
// Equality tests
TEST_CASE( "./succeeding/conditions/equality",
"Equality checks that should succeed" )
TEST_CASE( "Equality checks that should succeed", "" )
{
TestDef td;
@ -63,8 +62,7 @@ TEST_CASE( "./succeeding/conditions/equality",
REQUIRE( x == Approx( 1.3 ) );
}
TEST_CASE( "./failing/conditions/equality",
"Equality checks that should fail" )
TEST_CASE( "Equality checks that should fail]", "[.][failing]" )
{
TestData data;
@ -85,8 +83,7 @@ TEST_CASE( "./failing/conditions/equality",
CHECK( x == Approx( 1.301 ) );
}
TEST_CASE( "./succeeding/conditions/inequality",
"Inequality checks that should succeed" )
TEST_CASE( "Inequality checks that should succeed", "" )
{
TestData data;
@ -103,8 +100,7 @@ TEST_CASE( "./succeeding/conditions/inequality",
REQUIRE( data.str_hello.size() != 6 );
}
TEST_CASE( "./failing/conditions/inequality",
"Inequality checks that should fails" )
TEST_CASE( "Inequality checks that should fails", "[.][failing]" )
{
TestData data;
@ -116,8 +112,7 @@ TEST_CASE( "./failing/conditions/inequality",
}
// Ordering comparison tests
TEST_CASE( "./succeeding/conditions/ordered",
"Ordering comparison checks that should succeed" )
TEST_CASE( "Ordering comparison checks that should succeed", "" )
{
TestData data;
@ -144,8 +139,7 @@ TEST_CASE( "./succeeding/conditions/ordered",
REQUIRE( data.str_hello > "a" );
}
TEST_CASE( "./failing/conditions/ordered",
"Ordering comparison checks that should fail" )
TEST_CASE( "Ordering comparison checks that should fail", "[.][failing]" )
{
TestData data;
@ -175,8 +169,7 @@ TEST_CASE( "./failing/conditions/ordered",
}
// Comparisons with int literals
TEST_CASE( "./succeeding/conditions/int literals",
"Comparisons with int literals don't warn when mixing signed/ unsigned" )
TEST_CASE( "Comparisons with int literals don't warn when mixing signed/ unsigned", "" )
{
int i = 1;
unsigned int ui = 2;
@ -214,8 +207,7 @@ TEST_CASE( "./succeeding/conditions/int literals",
#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
#endif
TEST_CASE( "./succeeding/conditions//long_to_unsigned_x",
"comparisons between int variables" )
TEST_CASE( "comparisons between int variables", "" )
{
long long_var = 1L;
unsigned char unsigned_char_var = 1;
@ -229,8 +221,7 @@ TEST_CASE( "./succeeding/conditions//long_to_unsigned_x",
REQUIRE( long_var == unsigned_long_var );
}
TEST_CASE( "./succeeding/conditions/const ints to int literal",
"comparisons between const int variables" )
TEST_CASE( "comparisons between const int variables", "" )
{
const unsigned char unsigned_char_var = 1;
const unsigned short unsigned_short_var = 1;
@ -243,8 +234,7 @@ TEST_CASE( "./succeeding/conditions/const ints to int literal",
REQUIRE( unsigned_long_var == 1 );
}
TEST_CASE( "./succeeding/conditions/negative ints",
"Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" )
TEST_CASE( "Comparisons between unsigned ints and negative signed ints match c++ standard behaviour", "" )
{
CHECK( ( -1 > 2u ) );
CHECK( -1 > 2u );
@ -266,8 +256,7 @@ struct Ex
T operator * ( const T& ) const { return T(); }
};
TEST_CASE( "./succeeding/conditions/computed ints",
"Comparisons between ints where one side is computed" )
TEST_CASE( "Comparisons between ints where one side is computed", "" )
{
CHECK( 54 == 6*9 );
}
@ -279,8 +268,7 @@ TEST_CASE( "./succeeding/conditions/computed ints",
inline const char* returnsConstNull(){ return NULL; }
inline char* returnsNull(){ return NULL; }
TEST_CASE( "./succeeding/conditions/ptr",
"Pointers can be compared to null" )
TEST_CASE( "Pointers can be compared to null", "" )
{
TestData* p = NULL;
TestData* pNULL = NULL;
@ -312,8 +300,7 @@ TEST_CASE( "./succeeding/conditions/ptr",
// is detected and a warning issued.
// An alternative form of the macros (CHECK_FALSE and REQUIRE_FALSE) can be used instead to capture
// the operand value.
TEST_CASE( "./succeeding/conditions/not",
"'Not' checks that should succeed" )
TEST_CASE( "'Not' checks that should succeed", "" )
{
bool falseValue = false;
@ -329,8 +316,7 @@ TEST_CASE( "./succeeding/conditions/not",
REQUIRE_FALSE( 1 == 2 );
}
TEST_CASE( "./failing/conditions/not",
"'Not' checks that should fail" )
TEST_CASE( "'Not' checks that should fail", "[.][failing]" )
{
bool trueValue = true;

View File

@ -11,8 +11,6 @@
#include <string>
#include <stdexcept>
#include "catch_self_test.hpp"
namespace
{
inline int thisThrows()
@ -28,33 +26,33 @@ namespace
}
}
TEST_CASE( "./succeeding/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" )
TEST_CASE( "When checked exceptions are thrown they can be expected or unexpected", "" )
{
REQUIRE_THROWS_AS( thisThrows(), std::domain_error );
REQUIRE_NOTHROW( thisDoesntThrow() );
REQUIRE_THROWS( thisThrows() );
}
TEST_CASE( "./failing/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" )
TEST_CASE( "Expected exceptions that don't throw or unexpected exceptions fail the test", "[.][failing]" )
{
CHECK_THROWS_AS( thisThrows(), std::string );
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error );
CHECK_NOTHROW( thisThrows() );
}
TEST_CASE( "./failing/exceptions/implicit", "When unchecked exceptions are thrown they are always failures" )
TEST_CASE( "When unchecked exceptions are thrown directly they are always failures", "[.][failing]" )
{
if( Catch::isTrue( true ) )
throw std::domain_error( "unexpected exception" );
}
TEST_CASE( "./failing/exceptions/implicit/2", "An unchecked exception reports the line of the last assertion" )
TEST_CASE( "An unchecked exception reports the line of the last assertion", "[.][failing]" )
{
CHECK( 1 == 1 );
if( Catch::isTrue( true ) )
throw std::domain_error( "unexpected exception" );
}
TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thrown they are always failures" )
TEST_CASE( "When unchecked exceptions are thrown from sections they are always failures", "[.][failing]" )
{
SECTION( "section name", "" )
{
@ -63,12 +61,12 @@ TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thr
}
}
TEST_CASE( "./failing/exceptions/implicit/4", "When unchecked exceptions are thrown they are always failures" )
TEST_CASE( "When unchecked exceptions are thrown from functions they are always failures", "[.][failing]" )
{
CHECK( thisThrows() == 0 );
}
TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" )
TEST_CASE( "When unchecked exceptions are thrown, but caught, they do not affect the test", "" )
{
try
{
@ -105,7 +103,7 @@ CATCH_TRANSLATE_EXCEPTION( double& ex )
return Catch::toString( ex );
}
TEST_CASE( "./failing/exceptions/custom", "Unexpected custom exceptions can be translated" )
TEST_CASE("Unexpected custom exceptions can be translated", "[.][failing]" )
{
if( Catch::isTrue( true ) )
throw CustomException( "custom exception" );
@ -116,18 +114,18 @@ inline void throwCustom() {
throw CustomException( "custom exception - not std" );
}
TEST_CASE( "./failing/exceptions/custom/nothrow", "Custom exceptions can be translated when testing for nothrow" )
TEST_CASE( "Custom exceptions can be translated when testing for nothrow", "[.][failing]" )
{
REQUIRE_NOTHROW( throwCustom() );
}
TEST_CASE( "./failing/exceptions/custom/throw", "Custom exceptions can be translated when testing for throwing as something else" )
TEST_CASE( "Custom exceptions can be translated when testing for throwing as something else", "[.][failing]" )
{
REQUIRE_THROWS_AS( throwCustom(), std::exception );
}
TEST_CASE( "./failing/exceptions/custom/double", "Unexpected custom exceptions can be translated" )
TEST_CASE( "Unexpected exceptions can be translated", "[.][failing]" )
{
if( Catch::isTrue( true ) )
throw double( 3.14 );
@ -137,7 +135,7 @@ inline int thisFunctionNotImplemented( int ) {
CATCH_NOT_IMPLEMENTED;
}
TEST_CASE( "./succeeding/exceptions/notimplemented", "" )
TEST_CASE( "NotImplemented exception", "" )
{
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) );
}

View File

@ -16,7 +16,7 @@ inline int multiply( int a, int b )
return a*b;
}
CATCH_TEST_CASE( "./succeeding/generators/1", "Generators over two ranges" )
CATCH_TEST_CASE( "Generators over two ranges", "[generators]" )
{
using namespace Catch::Generators;
@ -29,7 +29,7 @@ CATCH_TEST_CASE( "./succeeding/generators/1", "Generators over two ranges" )
struct IntPair { int first, second; };
CATCH_TEST_CASE( "./succeeding/generators/2", "Generator over a range of pairs" )
CATCH_TEST_CASE( "Generator over a range of pairs", "[generators]" )
{
using namespace Catch::Generators;

View File

@ -8,17 +8,17 @@
#include "catch.hpp"
TEST_CASE( "./succeeding/message", "INFO and WARN do not abort tests" )
TEST_CASE( "INFO and WARN do not abort tests", "[messages]" )
{
INFO( "this is a " << "message" ); // This should output the message if a failure occurs
WARN( "this is a " << "warning" ); // This should always output the message but then continue
}
TEST_CASE( "./succeeding/succeed", "SUCCEED counts as a test pass" )
TEST_CASE( "SUCCEED counts as a test pass", "[messages]" )
{
SUCCEED( "this is a " << "success" );
}
TEST_CASE( "./failing/message/info/1", "INFO gets logged on failure" )
TEST_CASE( "INFO gets logged on failure", "[failing][messages][.]" )
{
INFO( "this message should be logged" );
INFO( "so should this" );
@ -26,7 +26,7 @@ TEST_CASE( "./failing/message/info/1", "INFO gets logged on failure" )
REQUIRE( a == 1 );
}
TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" )
TEST_CASE( "INFO gets logged on failure, even if captured before successful assertions", "[failing][messages][.]" )
{
INFO( "this message may be logged later" );
int a = 2;
@ -45,13 +45,13 @@ TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" )
CHECK( a == 2 );
}
TEST_CASE( "./failing/message/fail", "FAIL aborts the test" )
TEST_CASE( "FAIL aborts the test", "[failing][messages][.]" )
{
if( Catch::isTrue( true ) )
FAIL( "This is a " << "failure" ); // This should output the message and abort
}
TEST_CASE( "./failing/message/sections", "Output from all sections is reported" )
TEST_CASE( "Output from all sections is reported", "[failing][messages][.]" )
{
SECTION( "one", "" )
{
@ -64,7 +64,7 @@ TEST_CASE( "./failing/message/sections", "Output from all sections is reported"
}
}
TEST_CASE( "./succeeding/message/sections/stdout", "Output from all sections is reported" )
TEST_CASE( "Standard output from all sections is reported", "[messages]" )
{
SECTION( "one", "" )
{
@ -77,7 +77,7 @@ TEST_CASE( "./succeeding/message/sections/stdout", "Output from all sections is
}
}
TEST_CASE( "./mixed/message/scoped", "" )
TEST_CASE( "SCOPED_INFO is reset for each loop", "[messages][failing][.]" )
{
for( int i=0; i<100; i++ )
{
@ -87,16 +87,25 @@ TEST_CASE( "./mixed/message/scoped", "" )
}
}
TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does not fail the test" )
TEST_CASE( "The NO_FAIL macro reports a failure but does not fail the test", "[messages]" )
{
CHECK_NOFAIL( 1 == 2 );
}
TEST_CASE( "just info", "[info][isolated info][.]" )
TEST_CASE( "just info", "[info][isolated info][messages]" )
{
INFO( "this should never be seen" );
}
TEST_CASE( "just failure", "[fail][isolated info][.]" )
TEST_CASE( "just failure", "[fail][isolated info][.][messages]" )
{
FAIL( "Previous info should not be seen" );
}
TEST_CASE( "sends information to INFO", "[.][failing]" )
{
INFO( "hi" );
int i = 7;
CAPTURE( i );
REQUIRE( false );
}

View File

@ -7,11 +7,10 @@
*/
#include "catch.hpp"
#include "catch_self_test.hpp"
#include <iostream>
TEST_CASE( "./succeeding/Misc/Sections", "random SECTION tests" )
TEST_CASE( "random SECTION tests", "[.][sections][failing]" )
{
int a = 1;
int b = 2;
@ -28,7 +27,7 @@ TEST_CASE( "./succeeding/Misc/Sections", "random SECTION tests" )
}
}
TEST_CASE( "./succeeding/Misc/Sections/nested", "nested SECTION tests" )
TEST_CASE( "nested SECTION tests", "[.][sections][failing]" )
{
int a = 1;
int b = 2;
@ -45,7 +44,7 @@ TEST_CASE( "./succeeding/Misc/Sections/nested", "nested SECTION tests" )
}
}
TEST_CASE( "./mixed/Misc/Sections/nested2", "nested SECTION tests" )
TEST_CASE( "more nested SECTION tests", "[sections][failing][.]" )
{
int a = 1;
int b = 2;
@ -68,7 +67,7 @@ TEST_CASE( "./mixed/Misc/Sections/nested2", "nested SECTION tests" )
}
}
TEST_CASE( "./Sections/nested/a/b", "nested SECTION tests" )
TEST_CASE( "even more nested SECTION tests", "[sections]" )
{
SECTION( "c", "" )
{
@ -86,7 +85,7 @@ TEST_CASE( "./Sections/nested/a/b", "nested SECTION tests" )
}
}
TEST_CASE( "./mixed/Misc/Sections/loops", "looped SECTION tests" )
TEST_CASE( "looped SECTION tests", "[.][failing][sections]" )
{
int a = 1;
@ -101,7 +100,7 @@ TEST_CASE( "./mixed/Misc/Sections/loops", "looped SECTION tests" )
}
}
TEST_CASE( "./mixed/Misc/loops", "looped tests" )
TEST_CASE( "looped tests", "[.][failing]" )
{
static const int fib[] = { 1, 1, 2, 3, 5, 8, 13, 21 };
@ -112,7 +111,7 @@ TEST_CASE( "./mixed/Misc/loops", "looped tests" )
}
}
TEST_CASE( "./succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" )
TEST_CASE( "Sends stuff to stdout and stderr", "" )
{
std::cout << "Some information" << std::endl;
@ -124,19 +123,12 @@ inline const char* makeString( bool makeNull )
return makeNull ? NULL : "valid string";
}
TEST_CASE( "./succeeding/Misc/null strings", "" )
TEST_CASE( "null strings", "" )
{
REQUIRE( makeString( false ) != static_cast<char*>(NULL));
REQUIRE( makeString( true ) == static_cast<char*>(NULL));
}
TEST_CASE( "./failing/info", "sends information to INFO" )
{
INFO( "hi" );
int i = 7;
CAPTURE( i );
REQUIRE( false );
}
inline bool testCheckedIf( bool flag )
{
@ -146,12 +138,12 @@ inline bool testCheckedIf( bool flag )
return false;
}
TEST_CASE( "./succeeding/checkedif", "" )
TEST_CASE( "checkedIf", "" )
{
REQUIRE( testCheckedIf( true ) );
}
TEST_CASE( "./failing/checkedif", "" )
TEST_CASE( "checkedIf, failing", "[failing][.]" )
{
REQUIRE( testCheckedIf( false ) );
}
@ -164,17 +156,17 @@ inline bool testCheckedElse( bool flag )
return true;
}
TEST_CASE( "./succeeding/checkedelse", "" )
TEST_CASE( "checkedElse", "" )
{
REQUIRE( testCheckedElse( true ) );
}
TEST_CASE( "./failing/checkedelse", "" )
TEST_CASE( "checkedElse, failing", "[failing][.]" )
{
REQUIRE( testCheckedElse( false ) );
}
TEST_CASE( "./misc/xmlentitycheck", "" )
TEST_CASE( "xmlentitycheck", "" )
{
SECTION( "embedded xml", "<test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" )
{
@ -186,13 +178,13 @@ TEST_CASE( "./misc/xmlentitycheck", "" )
}
}
TEST_CASE( "./manual/onechar", "send a single char to INFO" )
TEST_CASE( "send a single char to INFO", "[failing][.]" )
{
INFO(3);
REQUIRE(false);
}
TEST_CASE("./succeeding/atomic if", "")
TEST_CASE( "atomic if", "[failing][0]")
{
size_t x = 0;
@ -207,7 +199,7 @@ inline const char* testStringForMatching()
return "this string contains 'abc' as a substring";
}
TEST_CASE("./succeeding/matchers", "")
TEST_CASE("String matchers", "[matchers]" )
{
REQUIRE_THAT( testStringForMatching(), Contains( "string" ) );
CHECK_THAT( testStringForMatching(), Contains( "abc" ) );
@ -216,40 +208,40 @@ TEST_CASE("./succeeding/matchers", "")
CHECK_THAT( testStringForMatching(), EndsWith( "substring" ) );
}
TEST_CASE("./failing/matchers/Contains", "")
TEST_CASE("Contains string matcher", "[.][failing][matchers]")
{
CHECK_THAT( testStringForMatching(), Contains( "not there" ) );
}
TEST_CASE("./failing/matchers/StartsWith", "")
TEST_CASE("StartsWith string matcher", "[.][failing][matchers]")
{
CHECK_THAT( testStringForMatching(), StartsWith( "string" ) );
}
TEST_CASE("./failing/matchers/EndsWith", "")
TEST_CASE("EndsWith string matcher", "[.][failing][matchers]")
{
CHECK_THAT( testStringForMatching(), EndsWith( "this" ) );
}
TEST_CASE("./failing/matchers/Equals", "")
TEST_CASE("Equals string matcher", "[.][failing][matchers]")
{
CHECK_THAT( testStringForMatching(), Equals( "something else" ) );
}
TEST_CASE("string", "Equals with NULL")
TEST_CASE("Equals string matcher, with NULL", "[matchers]")
{
REQUIRE_THAT("", Equals(NULL));
}
TEST_CASE("./succeeding/matchers/AllOf", "")
TEST_CASE("AllOf matcher", "[matchers]")
{
CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) );
}
TEST_CASE("./succeeding/matchers/AnyOf", "")
TEST_CASE("AnyOf matcher", "[matchers]")
{
CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) );
CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) );
}
TEST_CASE("./succeeding/matchers/Equals", "")
TEST_CASE("Equals", "[matchers]")
{
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) );
}
@ -268,7 +260,7 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(10) == 3628800 );
}
TEST_CASE( "empty", "An empty test with no assertions" )
TEST_CASE( "An empty test with no assertions", "[empty]" )
{
}
@ -333,7 +325,7 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
}
// https://github.com/philsquared/Catch/issues/166
TEST_CASE("./failing/CatchSectionInfiniteLoop", "")
TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]")
{
SECTION("Outer", "")
SECTION("Inner", "")

View File

@ -5,68 +5,21 @@
* 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)
*/
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wpadded"
#endif
#include "catch_self_test.hpp"
#include "internal/catch_text.h"
#include "internal/catch_console_colour.hpp"
TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" ) {
using namespace Catch;
///////////////////////////////////////////////////////////////////////////
SECTION( "selftest/expected result",
"Tests do what they claim" ) {
SECTION( "selftest/expected result/failing tests",
"Tests in the 'failing' branch fail" ) {
MetaTestRunner::runMatching( "./failing/*", MetaTestRunner::Expected::ToFail, 0, 2 );
}
SECTION( "selftest/expected result/succeeding tests",
"Tests in the 'succeeding' branch succeed" ) {
MetaTestRunner::runMatching( "./succeeding/*", MetaTestRunner::Expected::ToSucceed, 1, 2 );
}
}
///////////////////////////////////////////////////////////////////////////
SECTION( "selftest/test counts",
"Number of test cases that run is fixed" ) {
EmbeddedRunner runner;
SECTION( "selftest/test counts/succeeding tests",
"Number of 'succeeding' tests is fixed" ) {
Totals totals = runner.runMatching( "./succeeding/*", 0, 2 );
CHECK( totals.assertions.passed == 298 );
CHECK( totals.assertions.failed == 0 );
}
SECTION( "selftest/test counts/failing tests",
"Number of 'failing' tests is fixed" ) {
Totals totals = runner.runMatching( "./failing/*", 1, 2 );
CHECK( totals.assertions.passed == 2 );
CHECK( totals.assertions.failed == 77 );
}
}
}
TEST_CASE( "meta/Misc/Sections", "looped tests" ) {
Catch::EmbeddedRunner runner;
Catch::Totals totals = runner.runMatching( "./mixed/Misc/Sections/nested2", 0, 1 );
CHECK( totals.assertions.passed == 2 );
CHECK( totals.assertions.failed == 1 );
}
#ifdef __clang__
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
#include "../../include/internal/catch_commandline.hpp"
#include "../../include/internal/catch_test_spec.h"
#include "../../include/reporters/catch_reporter_xml.hpp"
#include "internal/catch_text.h"
#include "internal/catch_console_colour.hpp"
#include "internal/catch_commandline.hpp"
#include "internal/catch_test_spec.h"
#include "reporters/catch_reporter_xml.hpp"
template<size_t size>
void parseIntoConfig( const char * (&argv)[size], Catch::ConfigData& config ) {

View File

@ -27,8 +27,8 @@ namespace Catch
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Tricky/std::pair",
"Parsing a std::pair"
"Parsing a std::pair",
"[Tricky][std::pair]"
)
{
std::pair<int, int> aNicePair( 1, 2 );
@ -39,8 +39,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./inprogress/failing/Tricky/trailing expression",
"Where the is more to the expression after the RHS"
"Where the is more to the expression after the RHS[failing]",
"[Tricky][failing][.]"
)
{
// int a = 1, b = 2;
@ -50,8 +50,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./inprogress/failing/Tricky/compound lhs",
"Where the LHS is not a simple value"
"Where the LHS is not a simple value[failing]",
"[Tricky][failing][.]"
)
{
/*
@ -76,8 +76,8 @@ struct Opaque
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./failing/Tricky/non streamable type",
"A failing expression with a non streamable type is still captured"
"A failing expression with a non streamable type is still captured[failing]",
"[Tricky][failing][.]"
)
{
@ -92,8 +92,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./failing/string literals",
"string literals of different sizes can be compared"
"string literals of different sizes can be compared[failing]",
"[Tricky][failing][.]"
)
{
REQUIRE( std::string( "first" ) == "second" );
@ -103,8 +103,8 @@ TEST_CASE
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/side-effects",
"An expression with side-effects should only be evaluated once"
"An expression with side-effects should only be evaluated once",
"[Tricky]"
)
{
int i = 7;
@ -151,8 +151,8 @@ inline bool operator==(const B::Y& lhs, const A::X& rhs)
/* This, currently, does not compile with LLVM
TEST_CASE
(
"./succeeding/koenig",
"Operators at different namespace levels not hijacked by Koenig lookup"
"[Tricky]"
)
{
A::X x;
@ -171,8 +171,8 @@ namespace ObjectWithConversions
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/koenig",
"Operators at different namespace levels not hijacked by Koenig lookup"
"Operators at different namespace levels not hijacked by Koenig lookup",
"[Tricky]"
)
{
Object o;
@ -199,7 +199,7 @@ namespace ObjectWithNonConstEqualityOperator
unsigned int m_value;
};
TEST_CASE("./succeeding/non-const==", "Demonstrate that a non-const == is not used")
TEST_CASE("Demonstrate that a non-const == is not used", "[Tricky]" )
{
Test t( 1 );
REQUIRE( t == 1u );
@ -212,7 +212,7 @@ namespace EnumBitFieldTests
bit30 = 0x40000000, bit31 = 0x80000000,
bit30and31 = 0xc0000000};
TEST_CASE("./succeeding/enum/bits", "Test enum bit values")
TEST_CASE( "Test enum bit values", "[Tricky]" )
{
REQUIRE( 0xc0000000 == bit30and31 );
}
@ -226,7 +226,7 @@ struct Obj
int* prop;
};
TEST_CASE("./succeeding/boolean member", "")
TEST_CASE("boolean member", "[Tricky]")
{
Obj obj;
REQUIRE( obj.prop != NULL );
@ -238,14 +238,14 @@ TEST_CASE("./succeeding/boolean member", "")
// struct it is declared in - but when evaluating it in a deduced
// context it appears to require the extra definition.
// The issue was fixed by adding bool overloads to bypass the
// templates that were deduce it.
// templates that were there to deduce it.
template <bool B>
struct is_true
{
static const bool value = B;
};
TEST_CASE( "./succeeding/unimplemented static bool", "static bools can be evaluated" )
TEST_CASE( "(unimplemented) static bools can be evaluated", "[Tricky]" )
{
SECTION("compare to true","")
{
@ -277,11 +277,11 @@ TEST_CASE( "./succeeding/unimplemented static bool", "static bools can be evalua
// Uncomment these tests to produce an error at test registration time
/*
TEST_CASE( "./sameName", "Tests with the same name are not allowed" )
TEST_CASE( "Tests with the same name are not allowed", "[Tricky]" )
{
}
TEST_CASE( "./sameName", "Tests with the same name are not allowed" )
TEST_CASE( "Tests with the same name are not allowed", "[Tricky]" )
{
}
@ -298,7 +298,7 @@ struct Boolable
bool m_value;
};
TEST_CASE( "./succeeding/SafeBool", "Objects that evaluated in boolean contexts can be checked")
TEST_CASE( "Objects that evaluated in boolean contexts can be checked", "[Tricky][SafeBool]" )
{
Boolable True( true );
Boolable False( false );
@ -308,7 +308,7 @@ TEST_CASE( "./succeeding/SafeBool", "Objects that evaluated in boolean contexts
CHECK_FALSE( False );
}
TEST_CASE( "Assertions then sections", "" )
TEST_CASE( "Assertions then sections", "[Tricky]" )
{
// This was causing a failure due to the way the console reporter was handling
// the current section
@ -335,7 +335,7 @@ struct Awkward
operator int() const { return 7; }
};
TEST_CASE( "non streamable - with conv. op", "" )
TEST_CASE( "non streamable - with conv. op", "[Tricky]" )
{
Awkward awkward;
std::string s = Catch::toString( awkward );
@ -346,7 +346,7 @@ inline void foo() {}
typedef void (*fooptr_t)();
TEST_CASE( "Comparing function pointers", "[function pointer]" )
TEST_CASE( "Comparing function pointers", "[Tricky][function pointer]" )
{
// This was giving a warning in VS2010
// #179
@ -358,7 +358,7 @@ TEST_CASE( "Comparing function pointers", "[function pointer]" )
class ClassName {};
TEST_CASE( "pointer to class", "" )
TEST_CASE( "pointer to class", "[Tricky]" )
{
ClassName *p = 0;
REQUIRE( p == 0 );
@ -368,7 +368,7 @@ TEST_CASE( "pointer to class", "" )
#include <memory>
TEST_CASE( "null_ptr", "" )
TEST_CASE( "null_ptr", "[Tricky]" )
{
std::unique_ptr<int> ptr;
REQUIRE(ptr.get() == nullptr);
@ -376,7 +376,7 @@ TEST_CASE( "null_ptr", "" )
#endif
TEST_CASE( "X/level/0/a", "" ) { SUCCEED(""); }
TEST_CASE( "X/level/0/b", "[fizz]" ) { SUCCEED(""); }
TEST_CASE( "X/level/1/a", "" ) { SUCCEED(""); }
TEST_CASE( "X/level/1/b", "" ) { SUCCEED("");}
TEST_CASE( "X/level/0/a", "[Tricky]" ) { SUCCEED(""); }
TEST_CASE( "X/level/0/b", "[Tricky][fizz]" ){ SUCCEED(""); }
TEST_CASE( "X/level/1/a", "[Tricky]" ) { SUCCEED(""); }
TEST_CASE( "X/level/1/b", "[Tricky]" ) { SUCCEED(""); }

View File

@ -1,31 +0,0 @@
/*
* Created by Phil on 14/02/2012.
* Copyright 2012 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)
*/
#define CATCH_CONFIG_MAIN
#include "catch_self_test.hpp"
namespace Catch{
NullStreamingReporter::~NullStreamingReporter() {}
Totals EmbeddedRunner::runMatching( const std::string& rawTestSpec, std::size_t groupIndex, std::size_t groupsCount, const std::string& ) {
std::ostringstream oss;
Ptr<Config> config = new Config();
config->setStreamBuf( oss.rdbuf() );
Totals totals;
// Scoped because RunContext doesn't report EndTesting until its destructor
{
RunContext runner( config.get(), m_reporter.get() );
totals = runner.runMatching( rawTestSpec, groupIndex, groupsCount );
}
return totals;
}
}

View File

@ -1,177 +0,0 @@
/*
* Created by Phil on 14/01/2011.
* Copyright 2011 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)
*/
#ifndef TWOBLUECUBES_CATCH_SELF_TEST_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_SELF_TEST_HPP_INCLUDED
#include "catch.hpp"
// Use this external guard here as if we're using the single header version
// this will already be defined
#ifndef TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
#include "catch_interfaces_registry_hub.h"
#endif
#include "set"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpadded"
#endif
namespace Catch {
class NullStreamingReporter : public SharedImpl<IStreamingReporter> {
public:
virtual ~NullStreamingReporter();
static std::string getDescription() {
return "null reporter";
}
private: // IStreamingReporter
virtual ReporterPreferences getPreferences() const {
return ReporterPreferences();
}
virtual void noMatchingTestCases( std::string const& ) {}
virtual void testRunStarting( TestRunInfo const& ) {}
virtual void testGroupStarting( GroupInfo const& ) {}
virtual void testCaseStarting( TestCaseInfo const& ) {}
virtual void sectionStarting( SectionInfo const& ) {}
virtual void assertionStarting( AssertionInfo const& ) {}
virtual bool assertionEnded( AssertionStats const& ) { return false; }
virtual void sectionEnded( SectionStats const& ) {}
virtual void testCaseEnded( TestCaseStats const& ) {}
virtual void testGroupEnded( TestGroupStats const& ) {}
virtual void testRunEnded( TestRunStats const& ) {}
};
class EmbeddedRunner {
public:
EmbeddedRunner() : m_reporter( new NullStreamingReporter() ) {}
Totals runMatching( const std::string& rawTestSpec,
std::size_t groupIndex,
std::size_t groupsCount,
const std::string& reporter = "console" );
private:
Ptr<IStreamingReporter> m_reporter;
};
class MetaTestRunner {
public:
struct Expected { enum Result {
ToSucceed,
ToFail
}; };
MetaTestRunner( Expected::Result expectedResult, std::size_t groupIndex, std::size_t groupsCount )
: m_expectedResult( expectedResult ),
m_groupIndex( groupIndex ),
m_groupsCount( groupsCount )
{}
static void runMatching( const std::string& testSpec,
Expected::Result expectedResult,
std::size_t groupIndex,
std::size_t groupsCount ) {
forEach( getRegistryHub().getTestCaseRegistry().getMatchingTestCases( testSpec ),
MetaTestRunner( expectedResult, groupIndex, groupsCount ) );
}
void operator()( const TestCase& testCase ) {
std::string name;
Totals totals;
{
EmbeddedRunner runner;
name = testCase.getTestCaseInfo().name;
totals = runner.runMatching( name, m_groupIndex, m_groupsCount );
}
switch( m_expectedResult ) {
case Expected::ToSucceed:
if( totals.assertions.failed > 0 ) {
FAIL( "Expected test case '"
<< name
<< "' to succeed but there was/ were "
<< totals.assertions.failed << " failure(s)" );
}
else {
SUCCEED( "Tests passed, as expected" );
}
break;
case Expected::ToFail:
if( totals.assertions.failed == 0 ) {
FAIL( "Expected test case '"
<< name
<< "' to fail but there was/ were "
<< totals.assertions.passed << " success(es)" );
}
else {
SUCCEED( "Tests failed, as expected" );
}
break;
}
}
private:
Expected::Result m_expectedResult;
std::size_t m_groupIndex;
std::size_t m_groupsCount;
};
struct LineInfoRegistry {
static LineInfoRegistry& get() {
static LineInfoRegistry s_instance;
return s_instance;
}
void registerLineInfo( const std::string& name,
const SourceLineInfo& info ) {
m_registry.insert( std::make_pair( name, info ) );
}
const SourceLineInfo* find( const std::string& name ) const {
std::map<std::string, SourceLineInfo>::const_iterator it = m_registry.find( name );
return it == m_registry.end() ? NULL : &(it->second);
}
const std::string infoForName( const std::string& name ) const {
std::map<std::string, SourceLineInfo>::const_iterator it = m_registry.find( name );
if( it == m_registry.end() )
return "";
std::ostringstream oss;
oss << it->second;
return oss.str();
}
std::map<std::string, SourceLineInfo> m_registry;
};
struct LineInfoRegistrar {
LineInfoRegistrar( const char* name, const SourceLineInfo& lineInfo ) {
LineInfoRegistry::get().registerLineInfo( name, lineInfo );
}
};
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#define CATCH_REGISTER_LINE_INFO( name ) ::Catch::LineInfoRegistrar INTERNAL_CATCH_UNIQUE_NAME( lineRegistrar )( name, ::Catch::SourceLineInfo( __FILE__, __LINE__ ) );
#define CATCH_GET_LINE_INFO( name ) ::Catch::LineInfoRegistry::get().infoForName( name )
#endif // TWOBLUECUBES_CATCH_SELF_TEST_HPP_INCLUDED

View File

@ -1,33 +0,0 @@
========================================================================
CONSOLE APPLICATION : TestCatch Project Overview
========================================================================
AppWizard has created this TestCatch application for you.
This file contains a summary of what you will find in each of the files that
make up your TestCatch application.
TestCatch.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
TestCatch.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named TestCatch.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@ -296,10 +296,6 @@
RelativePath="..\..\..\..\include\internal\catch_section.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_self_test.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_stream.hpp"
>
@ -351,10 +347,6 @@
RelativePath="..\..\..\SelfTest\BDDTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\catch_self_test.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\ClassTests.cpp"
>
@ -396,10 +388,6 @@
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="TestCatch">
</Property><Property Name="Solution File" Value="\\psf\Home\Dev\TwoBlueCubes\Dev\GitHub\CatchBugFix\projects\VisualStudio\TestCatch\TestCatch.sln">
</Property><Property Name="Date" Value="Friday, March 02, 2012">
</Property><Property Name="Time" Value="7:43 AM">
</Property></Properties><Event ErrorLevel="0" Project="TestCatch" Source="TestCatch\TestCatch.vcproj" Description="Converting project file '\\psf\Home\Dev\TwoBlueCubes\Dev\GitHub\CatchBugFix\projects\VisualStudio\TestCatch\TestCatch\TestCatch.vcproj'.">
</Event><Event ErrorLevel="1" Project="TestCatch" Source="TestCatch\TestCatch.vcproj" Description="VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.">
</Event><Event ErrorLevel="0" Project="TestCatch" Source="TestCatch\TestCatch.vcproj" Description="Done converting to new project file '\\psf\Home\Dev\TwoBlueCubes\Dev\GitHub\CatchBugFix\projects\VisualStudio\TestCatch\TestCatch\TestCatch.vcxproj'.">
</Event><Event ErrorLevel="3" Project="TestCatch" Source="TestCatch\TestCatch.vcproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="TestCatch.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="TestCatch.sln" Description="Converted">
</Event></UpgradeLog>

View File

@ -1,207 +0,0 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

View File

@ -1,232 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution"><a _locID="Solution">Solution</a>: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)"><a _locID="Project">Project</a>: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'"><a _locID="Converted1">Converted</a></xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">Converted</a>
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Report - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/><a _locID="file1"> files</a>
</xsl:if>
<xsl:if test="count(source)=1">
<a _locID="file2">1 file</a>
</xsl:if>
</td>
<td class="foot">
<a _locID="Converted3">Converted</a>:&#32;<xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
<a _locID="NotConverted">Not converted</a>:&#32;<xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title _locID="ConversionReport0">Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b _locID="TimeOfConversion">Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b _locID="ConversionSettings">Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 B

View File

@ -1,33 +0,0 @@
========================================================================
CONSOLE APPLICATION : TestCatch Project Overview
========================================================================
AppWizard has created this TestCatch application for you.
This file contains a summary of what you will find in each of the files that
make up your TestCatch application.
TestCatch.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
TestCatch.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named TestCatch.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@ -1,8 +0,0 @@
// TestCatch.cpp : Defines the entry point for the console application.
//
int main(int argc, char* argv[])
{
return 0;
}

View File

@ -96,7 +96,6 @@
<ClCompile Include="..\..\..\SelfTest\CmdLineTests.cpp" />
<ClCompile Include="..\..\..\SelfTest\SectionTrackerTests.cpp" />
<ClCompile Include="..\..\..\SelfTest\TestMain.cpp" />
<ClCompile Include="..\..\..\SelfTest\catch_self_test.cpp" />
<ClCompile Include="..\..\..\SelfTest\ClassTests.cpp" />
<ClCompile Include="..\..\..\SelfTest\ConditionTests.cpp" />
<ClCompile Include="..\..\..\SelfTest\ExceptionTests.cpp" />
@ -135,7 +134,6 @@
<ClInclude Include="..\..\..\..\include\internal\catch_resultinfo.hpp" />
<ClInclude Include="..\..\..\..\include\internal\catch_runner_impl.hpp" />
<ClInclude Include="..\..\..\..\include\internal\catch_section.hpp" />
<ClInclude Include="..\..\..\..\include\internal\catch_self_test.hpp" />
<ClInclude Include="..\..\..\..\include\internal\catch_stream.hpp" />
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.hpp" />
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp" />
@ -145,9 +143,6 @@
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_junit.hpp" />
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_xml.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -36,7 +36,6 @@
4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */; };
4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */; };
4ACE21CC166CA1B300FB5509 /* catch_option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACE21CA166CA1B300FB5509 /* catch_option.cpp */; };
4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AE1840A14EE4F230066340D /* catch_self_test.cpp */; };
4AEE032016142F910071E950 /* catch_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE031F16142F910071E950 /* catch_common.cpp */; };
4AEE032316142FC70071E950 /* catch_debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE032216142FC70071E950 /* catch_debugger.cpp */; };
4AEE032516142FF10071E950 /* catch_stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AEE032416142FF10071E950 /* catch_stream.cpp */; };
@ -95,7 +94,6 @@
4A6D0C20149B3D3B00DB3EAA /* CatchSelfTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CatchSelfTest; sourceTree = BUILT_PRODUCTS_DIR; };
4A6D0C26149B3D3B00DB3EAA /* CatchSelfTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = CatchSelfTest.1; sourceTree = "<group>"; };
4A6D0C2D149B3D9E00DB3EAA /* ApproxTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApproxTests.cpp; path = ../../../SelfTest/ApproxTests.cpp; sourceTree = "<group>"; };
4A6D0C2E149B3D9E00DB3EAA /* catch_self_test.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = catch_self_test.hpp; path = ../../../SelfTest/catch_self_test.hpp; sourceTree = "<group>"; };
4A6D0C2F149B3D9E00DB3EAA /* ClassTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClassTests.cpp; path = ../../../SelfTest/ClassTests.cpp; sourceTree = "<group>"; };
4A6D0C30149B3D9E00DB3EAA /* ConditionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConditionTests.cpp; path = ../../../SelfTest/ConditionTests.cpp; sourceTree = "<group>"; };
4A6D0C31149B3D9E00DB3EAA /* ExceptionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExceptionTests.cpp; path = ../../../SelfTest/ExceptionTests.cpp; sourceTree = "<group>"; };
@ -163,7 +161,6 @@
4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_decomposer.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
4ACE21C8166CA19700FB5509 /* catch_option.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_option.hpp; sourceTree = "<group>"; };
4ACE21CA166CA1B300FB5509 /* catch_option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_option.cpp; path = ../../../SelfTest/SurrogateCpps/catch_option.cpp; sourceTree = "<group>"; };
4AE1840A14EE4F230066340D /* catch_self_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_self_test.cpp; path = ../../../SelfTest/catch_self_test.cpp; sourceTree = "<group>"; };
4AEE031F16142F910071E950 /* catch_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_common.cpp; path = ../../../SelfTest/SurrogateCpps/catch_common.cpp; sourceTree = "<group>"; };
4AEE032216142FC70071E950 /* catch_debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_debugger.cpp; path = ../../../SelfTest/SurrogateCpps/catch_debugger.cpp; sourceTree = "<group>"; };
4AEE032416142FF10071E950 /* catch_stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_stream.cpp; path = ../../../SelfTest/SurrogateCpps/catch_stream.cpp; sourceTree = "<group>"; };
@ -220,8 +217,6 @@
isa = PBXGroup;
children = (
4A6D0C35149B3D9E00DB3EAA /* TestMain.cpp */,
4A6D0C2E149B3D9E00DB3EAA /* catch_self_test.hpp */,
4AE1840A14EE4F230066340D /* catch_self_test.cpp */,
266E9AD317290E710061DAB2 /* Introspective Tests */,
4A6D0C40149B3DAB00DB3EAA /* Tests */,
4A6D0C41149B3DE900DB3EAA /* Catch */,
@ -499,7 +494,6 @@
4A6D0C3D149B3D9E00DB3EAA /* MiscTests.cpp in Sources */,
4A6D0C3E149B3D9E00DB3EAA /* TestMain.cpp in Sources */,
4A6D0C3F149B3D9E00DB3EAA /* TrickyTests.cpp in Sources */,
4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */,
4A8E4DD2160A352200194CBD /* catch_tags.cpp in Sources */,
4AEE032016142F910071E950 /* catch_common.cpp in Sources */,
4AEE032316142FC70071E950 /* catch_debugger.cpp in Sources */,

View File

@ -1,6 +1,6 @@
/*
* CATCH v1.0 build 11 (master branch)
* Generated: 2013-10-23 15:34:32.120349
* CATCH v1.0 build 14 (master branch)
* Generated: 2013-11-26 20:54:38.067005
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@ -595,6 +595,7 @@ namespace Catch {
#include <sstream>
#include <iomanip>
#include <limits>
#include <vector>
#ifdef __OBJC__
// #included from: catch_objc_arc.hpp
@ -2124,6 +2125,7 @@ namespace Catch {
: listTests( false ),
listTags( false ),
listReporters( false ),
listTestNamesOnly( false ),
showSuccessfulTests( false ),
shouldDebugBreak( false ),
noThrow( false ),
@ -2137,6 +2139,7 @@ namespace Catch {
bool listTests;
bool listTags;
bool listReporters;
bool listTestNamesOnly;
bool showSuccessfulTests;
bool shouldDebugBreak;
@ -2205,6 +2208,7 @@ namespace Catch {
}
bool listTests() const { return m_data.listTests; }
bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
bool listTags() const { return m_data.listTags; }
bool listReporters() const { return m_data.listReporters; }
@ -4127,6 +4131,13 @@ namespace Clara {
int position;
};
// NOTE: std::auto_ptr is deprecated in c++11/c++0x
#if defined(__cplusplus) && __cplusplus > 199711L
typedef std::unique_ptr<Arg> ArgAutoPtr;
#else
typedef std::auto_ptr<Arg> ArgAutoPtr;
#endif
class ArgBinder {
public:
template<typename F>
@ -4151,7 +4162,7 @@ namespace Clara {
else if( m_arg.isAnyPositional() ) {
if( m_cl->m_arg.get() )
throw std::logic_error( "Only one unpositional argument can be added" );
m_cl->m_arg = std::auto_ptr<Arg>( new Arg( m_arg ) );
m_cl->m_arg = ArgAutoPtr( new Arg( m_arg ) );
}
else
m_cl->m_options.push_back( m_arg );
@ -4195,7 +4206,7 @@ namespace Clara {
m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition )
{
if( other.m_arg.get() )
m_arg = std::auto_ptr<Arg>( new Arg( *other.m_arg ) );
m_arg = ArgAutoPtr( new Arg( *other.m_arg ) );
}
template<typename F>
@ -4365,12 +4376,14 @@ namespace Clara {
Detail::BoundArgFunction<ConfigT> m_boundProcessName;
std::vector<Arg> m_options;
std::map<int, Arg> m_positionalArgs;
std::auto_ptr<Arg> m_arg;
ArgAutoPtr m_arg;
int m_highestSpecifiedArgPosition;
};
} // end namespace Clara
#include <fstream>
namespace Catch {
inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; }
@ -4397,6 +4410,18 @@ namespace Catch {
? ShowDurations::Always
: ShowDurations::Never;
}
inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) {
std::ifstream f( _filename.c_str() );
if( !f.is_open() )
throw std::domain_error( "Unable to load input file: " + _filename );
std::string line;
while( std::getline( f, line ) ) {
line = trim(line);
if( !line.empty() && !startsWith( line, "#" ) )
addTestOrTags( config, line );
}
}
inline Clara::CommandLine<ConfigData> makeCommandLineParser() {
@ -4411,19 +4436,15 @@ namespace Catch {
.longOpt( "help" );
cli.bind( &ConfigData::listTests )
.describe( "list all (or matching) test cases" )
.describe( "list all/matching test cases" )
.shortOpt( "l")
.longOpt( "list-tests" );
cli.bind( &ConfigData::listTags )
.describe( "list all (or matching) tags" )
.describe( "list all/matching tags" )
.shortOpt( "t")
.longOpt( "list-tags" );
cli.bind( &ConfigData::listReporters )
.describe( "list all reporters" )
.longOpt( "list-reporters" );
cli.bind( &ConfigData::showSuccessfulTests )
.describe( "include successful tests in output" )
.shortOpt( "s")
@ -4446,7 +4467,7 @@ namespace Catch {
.hint( "filename" );
cli.bind( &ConfigData::reporterName )
.describe( "reporter to use - defaults to console" )
.describe( "reporter to use (defaults to console)" )
.shortOpt( "r")
.longOpt( "reporter" )
// .hint( "name[:filename]" );
@ -4491,6 +4512,21 @@ namespace Catch {
.longOpt( "durations" )
.hint( "yes/no" );
cli.bind( &loadTestNamesFromFile )
.describe( "load test names to run from a file" )
.shortOpt( "f")
.longOpt( "input-file" )
.hint( "filename" );
// Less common commands which don't have a short form
cli.bind( &ConfigData::listTestNamesOnly )
.describe( "list all/matching test cases names only" )
.longOpt( "list-test-names-only" );
cli.bind( &ConfigData::listReporters )
.describe( "list all reporters" )
.longOpt( "list-reporters" );
return cli;
}
@ -4573,75 +4609,29 @@ namespace Catch {
std::cout << "All available test cases:\n";
else
std::cout << "Matching test cases:\n";
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
// First pass - get max tags
std::size_t maxTagLen = 0;
std::size_t maxNameLen = 0;
for(; it != itEnd; ++it ) {
if( matchesFilters( config.filters(), *it ) ) {
maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen );
maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen );
}
}
// Try to fit everything in. If not shrink tag column first, down to 30
// then shrink name column until it all fits (strings will be wrapped within column)
while( maxTagLen + maxNameLen > CATCH_CONFIG_CONSOLE_WIDTH-5 ) {
if( maxTagLen > 30 )
--maxTagLen;
else
--maxNameLen;
}
std::size_t matchedTests = 0;
for( it = allTests.begin(); it != itEnd; ++it ) {
TextAttributes nameAttr, tagsAttr;
nameAttr.setInitialIndent( 2 ).setIndent( 4 );
tagsAttr.setIndent( 6 );
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
for( std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
it != itEnd;
++it )
if( matchesFilters( config.filters(), *it ) ) {
matchedTests++;
Text nameWrapper( it->getTestCaseInfo().name,
TextAttributes()
.setWidth( maxNameLen+2 )
.setInitialIndent(2)
.setIndent(4) );
Text tagsWrapper( it->getTestCaseInfo().tagsAsString,
TextAttributes()
.setWidth( maxTagLen )
.setInitialIndent(0)
.setIndent( 2 ) );
for( std::size_t i = 0; i < (std::max)( nameWrapper.size(), tagsWrapper.size() ); ++i ) {
Colour::Code colour = Colour::None;
if( it->getTestCaseInfo().isHidden )
colour = Colour::SecondaryText;
std::string nameCol;
if( i < nameWrapper.size() ) {
nameCol = nameWrapper[i];
}
else {
nameCol = " ...";
colour = Colour::SecondaryText;
}
{
TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
Colour::Code colour = testCaseInfo.isHidden
? Colour::SecondaryText
: Colour::None;
Colour colourGuard( colour );
std::cout << nameCol;
}
if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) {
if( i == 0 ) {
Colour colourGuard( Colour::SecondaryText );
std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " ";
}
else {
std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " ";
}
std::cout << tagsWrapper[i];
}
std::cout << "\n";
}
}
std::cout << Text( testCaseInfo.name, nameAttr ) << std::endl;
if( !testCaseInfo.tags.empty() )
std::cout << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl;
}
if( config.filters().empty() )
std::cout << pluralise( matchedTests, "test case" ) << "\n" << std::endl;
else
@ -4649,26 +4639,39 @@ namespace Catch {
return matchedTests;
}
inline std::size_t listTestsNamesOnly( Config const& config ) {
std::size_t matchedTests = 0;
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
for( std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
it != itEnd;
++it )
if( matchesFilters( config.filters(), *it ) ) {
matchedTests++;
TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
std::cout << testCaseInfo.name << std::endl;
}
return matchedTests;
}
inline std::size_t listTags( Config const& config ) {
if( config.filters().empty() )
std::cout << "All available tags:\n";
else
std::cout << "Matching tags:\n";
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end();
std::map<std::string, int> tagCounts;
std::size_t maxTagLen = 0;
for(; it != itEnd; ++it ) {
std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests();
for( std::vector<TestCase>::const_iterator it = allTests.begin(),
itEnd = allTests.end();
it != itEnd;
++it ) {
if( matchesFilters( config.filters(), *it ) ) {
for( std::set<std::string>::const_iterator tagIt = it->getTestCaseInfo().tags.begin(),
tagItEnd = it->getTestCaseInfo().tags.end();
tagIt != tagItEnd;
++tagIt ) {
std::string tagName = *tagIt;
maxTagLen = (std::max)( maxTagLen, tagName.size() );
std::map<std::string, int>::iterator countIt = tagCounts.find( tagName );
if( countIt == tagCounts.end() )
tagCounts.insert( std::make_pair( tagName, 1 ) );
@ -4677,26 +4680,18 @@ namespace Catch {
}
}
}
maxTagLen +=4;
if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 )
maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10;
for( std::map<std::string, int>::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end();
for( std::map<std::string, int>::const_iterator countIt = tagCounts.begin(),
countItEnd = tagCounts.end();
countIt != countItEnd;
++countIt ) {
std::ostringstream oss;
oss << " " << countIt->second << " ";
Text wrapper( "[" + countIt->first + "]", TextAttributes()
.setIndent(2)
.setWidth( maxTagLen ) );
std::cout << wrapper;
std::size_t dots = 2;
if( maxTagLen > wrapper.last().size() )
dots += maxTagLen - wrapper.last().size();
{
Colour colourGuard( Colour::SecondaryText );
std::cout << std::string( dots, '.' );
}
std::cout << countIt->second
<< "\n";
.setInitialIndent( 0 )
.setIndent( oss.str().size() )
.setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) );
std::cout << oss.str() << wrapper << "\n";
}
std::cout << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl;
return tagCounts.size();
@ -4729,6 +4724,8 @@ namespace Catch {
Option<std::size_t> listedCount;
if( config.listTests() )
listedCount = listedCount.valueOr(0) + listTests( config );
if( config.listTestNamesOnly() )
listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config );
if( config.listTags() )
listedCount = listedCount.valueOr(0) + listTags( config );
if( config.listReporters() )
@ -5477,8 +5474,8 @@ namespace Catch {
else {
TestCase const& prev = *m_functions.find( testCase );
std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n"
<< "\tFirst seen at " << SourceLineInfo( prev.getTestCaseInfo().lineInfo ) << "\n"
<< "\tRedefined at " << SourceLineInfo( testCase.getTestCaseInfo().lineInfo ) << std::endl;
<< "\tFirst seen at " << prev.getTestCaseInfo().lineInfo << "\n"
<< "\tRedefined at " << testCase.getTestCaseInfo().lineInfo << std::endl;
exit(1);
}
}
@ -6263,7 +6260,7 @@ namespace Catch {
SourceLineInfo const& _lineInfo )
{
std::string desc = _descOrTags;
bool isHidden( startsWith( _name, "./" ) );
bool isHidden( startsWith( _name, "./" ) ); // Legacy support
std::set<std::string> tags;
TagExtracter( tags ).parse( desc );
if( tags.find( "hide" ) != tags.end() || tags.find( "." ) != tags.end() )
@ -6371,7 +6368,7 @@ namespace Catch {
namespace Catch {
// These numbers are maintained by a script
Version libraryVersion( 1, 0, 11, "master" );
Version libraryVersion( 1, 0, 14, "master" );
}
// #included from: catch_text.hpp
@ -7294,13 +7291,18 @@ namespace Catch {
virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
AssertionResult const& result = _assertionStats.assertionResult;
bool printInfoMessages = true;
// Drop out if result was successful and we're not printing those
if( !m_config->includeSuccessfulResults() && result.isOk() )
if( !m_config->includeSuccessfulResults() && result.isOk() ) {
if( result.getResultType() != ResultWas::Warning )
return false;
printInfoMessages = false;
}
lazyPrint();
AssertionPrinter printer( stream, _assertionStats );
AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
printer.print();
stream << std::endl;
return true;
@ -7358,13 +7360,14 @@ namespace Catch {
class AssertionPrinter {
void operator= ( AssertionPrinter const& );
public:
AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats )
AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
: stream( _stream ),
stats( _stats ),
result( _stats.assertionResult ),
colour( Colour::None ),
message( result.getMessage() ),
messages( _stats.infoMessages )
messages( _stats.infoMessages ),
printInfoMessages( _printInfoMessages )
{
switch( result.getResultType() ) {
case ResultWas::Ok:
@ -7467,6 +7470,8 @@ namespace Catch {
for( std::vector<MessageInfo>::const_iterator it = messages.begin(), itEnd = messages.end();
it != itEnd;
++it ) {
// If this assertion is a warning ignore any INFO messages
if( printInfoMessages || it->type != ResultWas::Info )
stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n";
}
}
@ -7483,6 +7488,7 @@ namespace Catch {
std::string messageLabel;
std::string message;
std::vector<MessageInfo> messages;
bool printInfoMessages;
};
void lazyPrint() {
@ -7568,9 +7574,14 @@ namespace Catch {
}
void printTotals( const Totals& totals ) {
if( totals.assertions.total() == 0 ) {
if( totals.testCases.total() == 0 ) {
stream << "No tests ran";
}
else if( totals.assertions.total() == 0 ) {
Colour colour( Colour::Yellow );
printCounts( "test case", totals.testCases );
stream << " (no assertions)";
}
else if( totals.assertions.failed ) {
Colour colour( Colour::ResultError );
printCounts( "test case", totals.testCases );