This commit is contained in:
Phil Nash
2011-04-26 08:32:40 +01:00
parent 02c877f916
commit 823ea3efd4
74 changed files with 773 additions and 15587 deletions

View File

@@ -0,0 +1,61 @@
/*
* ClassTests.cpp
* Catch - Test
*
* Created by Phil on 09/11/2010.
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "catch.hpp"
namespace
{
class TestClass
{
std::string s;
public:
TestClass()
: s( "hello" )
{}
void succeedingCase()
{
REQUIRE( s == "hello" );
}
void failingCase()
{
REQUIRE( s == "world" );
}
};
}
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds" )
METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails" )
struct Fixture
{
Fixture() : m_a( 1 ) {}
int m_a;
};
TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method based test run that succeeds" )
{
REQUIRE( m_a == 1 );
}
// 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" )
{
REQUIRE( m_a == 2 );
}
}

View File

@@ -0,0 +1,267 @@
/*
* ConditionTests.cpp
* Catch - Test
*
* Created by Phil on 08/11/2010.
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "catch.hpp"
#include <string>
#include <limits>
struct TestData
{
TestData()
: int_seven( 7 ),
str_hello( "hello" ),
float_nine_point_one( 9.1f ),
double_pi( 3.1415926535 )
{}
int int_seven;
std::string str_hello;
float float_nine_point_one;
double double_pi;
};
// The "failing" tests all use the CHECK macro, which continues if the specific test fails.
// 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" )
{
TestData data;
REQUIRE( data.int_seven == 7 );
REQUIRE( data.float_nine_point_one == Approx( 9.1f ) );
REQUIRE( data.double_pi == Approx( 3.1415926535 ) );
REQUIRE( data.str_hello == "hello" );
REQUIRE( data.str_hello.size() == 5 );
double x = 1.1 + 0.1 + 0.1;
REQUIRE( x == Approx( 1.3 ) );
}
TEST_CASE( "./failing/conditions/equality",
"Equality checks that should fail" )
{
TestData data;
CHECK( data.int_seven == 6 );
CHECK( data.int_seven == 8 );
CHECK( data.int_seven == 0 );
CHECK( data.float_nine_point_one == Approx( 9.11f ) );
CHECK( data.float_nine_point_one == Approx( 9.0f ) );
CHECK( data.float_nine_point_one == Approx( 1 ) );
CHECK( data.float_nine_point_one == Approx( 0 ) );
CHECK( data.double_pi == Approx( 3.1415 ) );
CHECK( data.str_hello == "goodbye" );
CHECK( data.str_hello == "hell" );
CHECK( data.str_hello == "hello1" );
CHECK( data.str_hello.size() == 6 );
double x = 1.1 + 0.1 + 0.1;
CHECK( x == Approx( 1.301 ) );
}
TEST_CASE( "./succeeding/conditions/inequality",
"Inequality checks that should succeed" )
{
TestData data;
REQUIRE( data.int_seven != 6 );
REQUIRE( data.int_seven != 8 );
REQUIRE( data.float_nine_point_one != Approx( 9.11f ) );
REQUIRE( data.float_nine_point_one != Approx( 9.0f ) );
REQUIRE( data.float_nine_point_one != Approx( 1 ) );
REQUIRE( data.float_nine_point_one != Approx( 0 ) );
REQUIRE( data.double_pi != Approx( 3.1415 ) );
REQUIRE( data.str_hello != "goodbye" );
REQUIRE( data.str_hello != "hell" );
REQUIRE( data.str_hello != "hello1" );
REQUIRE( data.str_hello.size() != 6 );
}
TEST_CASE( "./failing/conditions/inequality",
"Inequality checks that should fails" )
{
TestData data;
CHECK( data.int_seven != 7 );
CHECK( data.float_nine_point_one != Approx( 9.1f ) );
CHECK( data.double_pi != Approx( 3.1415926535 ) );
CHECK( data.str_hello != "hello" );
CHECK( data.str_hello.size() != 5 );
}
// Ordering comparison tests
TEST_CASE( "./succeeding/conditions/ordered",
"Ordering comparison checks that should succeed" )
{
TestData data;
REQUIRE( data.int_seven < 8 );
REQUIRE( data.int_seven > 6 );
REQUIRE( data.int_seven > 0 );
REQUIRE( data.int_seven > -1 );
REQUIRE( data.int_seven >= 7 );
REQUIRE( data.int_seven >= 6 );
REQUIRE( data.int_seven <= 7 );
REQUIRE( data.int_seven <= 8 );
REQUIRE( data.float_nine_point_one > 9 );
REQUIRE( data.float_nine_point_one < 10 );
REQUIRE( data.float_nine_point_one < 9.2 );
REQUIRE( data.str_hello <= "hello" );
REQUIRE( data.str_hello >= "hello" );
REQUIRE( data.str_hello < "hellp" );
REQUIRE( data.str_hello < "zebra" );
REQUIRE( data.str_hello > "hellm" );
REQUIRE( data.str_hello > "a" );
}
TEST_CASE( "./failing/conditions/ordered",
"Ordering comparison checks that should fail" )
{
TestData data;
CHECK( data.int_seven > 7 );
CHECK( data.int_seven < 7 );
CHECK( data.int_seven > 8 );
CHECK( data.int_seven < 6 );
CHECK( data.int_seven < 0 );
CHECK( data.int_seven < -1 );
CHECK( data.int_seven >= 8 );
CHECK( data.int_seven <= 6 );
CHECK( data.float_nine_point_one < 9 );
CHECK( data.float_nine_point_one > 10 );
CHECK( data.float_nine_point_one > 9.2 );
CHECK( data.str_hello > "hello" );
CHECK( data.str_hello < "hello" );
CHECK( data.str_hello > "hellp" );
CHECK( data.str_hello > "z" );
CHECK( data.str_hello < "hellm" );
CHECK( data.str_hello < "a" );
CHECK( data.str_hello >= "z" );
CHECK( data.str_hello <= "a" );
}
// Comparisons with int literals
TEST_CASE( "./succeeding/conditions/int literals",
"Comparisons with int literals don't warn when mixing signed/ unsigned" )
{
int i = 1;
unsigned int ui = 2;
long l = 3;
unsigned long ul = 4;
char c = 5;
unsigned char uc = 6;
REQUIRE( i == 1 );
REQUIRE( ui == 2 );
REQUIRE( l == 3 );
REQUIRE( ul == 4 );
REQUIRE( c == 5 );
REQUIRE( uc == 6 );
REQUIRE( 1 == i );
REQUIRE( 2 == ui );
REQUIRE( 3 == l );
REQUIRE( 4 == ul );
REQUIRE( 5 == c );
REQUIRE( 6 == uc );
REQUIRE( (std::numeric_limits<unsigned long>::max)() > ul );
}
// These are not built normally to avoid warnings about signed/ unsigned
#ifdef ALLOW_TESTS_THAT_WARN
TEST_CASE( "succeeding/conditions/negative ints",
"Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" )
{
CHECK( ( -1 > 2u ) );
CHECK( -1 > 2u );
CHECK( ( 2u < -1 ) );
CHECK( 2u < -1 );
const int minInt = (std::numeric_limits<int>::min)();
CHECK( ( minInt > 2u ) );
CHECK( minInt > 2u );
}
#endif
TEST_CASE( "./succeeding/conditions/ptr",
"Pointers can be compared to null" )
{
TestData* p = NULL;
TestData* pNULL = NULL;
REQUIRE( p == NULL );
REQUIRE( p == pNULL );
TestData data;
p = &data;
REQUIRE( p != NULL );
const TestData* cp = p;
REQUIRE( cp != NULL );
const TestData* const cpc = p;
REQUIRE( cpc != NULL );
// REQUIRE( NULL != p ); // gives warning, but should compile and run ok
}
// Not (!) tests
// The problem with the ! operator is that it has right-to-left associativity.
// This means we can't isolate it when we decompose. The simple REQUIRE( !false ) form, therefore,
// cannot have the operand value extracted. The test will work correctly, and the situation
// 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" )
{
bool falseValue = false;
REQUIRE( !false );
REQUIRE_FALSE( false );
REQUIRE( !falseValue );
REQUIRE_FALSE( falseValue );
REQUIRE( !(1 == 2) );
REQUIRE_FALSE( 1 == 2 );
}
TEST_CASE( "./failing/conditions/not",
"'Not' checks that should fail" )
{
bool trueValue = true;
CHECK( !true );
CHECK_FALSE( true );
CHECK( !trueValue );
CHECK_FALSE( trueValue );
CHECK( !(1 == 1) );
CHECK_FALSE( 1 == 1 );
}

View File

@@ -0,0 +1,122 @@
/*
* ExceptionTests.cpp
* Catch - Test
*
* Created by Phil on 09/11/2010.
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "catch.hpp"
#include <string>
#include <stdexcept>
namespace
{
ATTRIBUTE_NORETURN
int thisThrows();
int thisThrows()
{
throw std::domain_error( "expected exception" );
/*NOTREACHED*/
}
int thisDoesntThrow()
{
return 0;
}
}
TEST_CASE( "./succeeding/exceptions/explicit", "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" )
{
CHECK_THROWS_AS( thisThrows(), std::string );
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error );
CHECK_NOTHROW( thisThrows() );
}
TEST_CASE_NORETURN( "./failing/exceptions/implicit", "When unchecked exceptions are thrown they are always failures" )
{
throw std::domain_error( "unexpected exception" );
/*NOTREACHED*/
}
TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" )
{
try
{
throw std::domain_error( "unexpected exception" );
}
catch(...)
{
}
}
class CustomException
{
public:
CustomException( const std::string& msg )
: m_msg( msg )
{}
std::string getMessage() const
{
return m_msg;
}
private:
std::string m_msg;
};
CATCH_TRANSLATE_EXCEPTION( CustomException& ex )
{
return ex.getMessage();
}
CATCH_TRANSLATE_EXCEPTION( double& ex )
{
return Catch::toString( ex );
}
TEST_CASE_NORETURN( "./failing/exceptions/custom", "Unexpected custom exceptions can be translated" )
{
throw CustomException( "custom exception" );
}
TEST_CASE( "./failing/exceptions/custom/nothrow", "Custom exceptions can be translated when testing for nothrow" )
{
REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) );
}
TEST_CASE( "./failing/exceptions/custom/throw", "Custom exceptions can be translated when testing for throwing as something else" )
{
REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ), std::exception );
}
TEST_CASE_NORETURN( "./failing/exceptions/custom/double", "Unexpected custom exceptions can be translated" )
{
throw double( 3.14 );
}
TEST_CASE( "./failing/exceptions/in-section", "Exceptions thrown from sections report file/ line or section" )
{
SECTION( "the section", "" )
{
SECTION( "the section2", "" )
{
throw std::domain_error( "Exception from section" );
}
}
}

View File

@@ -0,0 +1,29 @@
/*
* GeneratorTests.cpp
* Catch - Test
*
* Created by Phil on 28/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)
*
*/
#include "catch.hpp"
size_t multiply( size_t a, size_t b )
{
return a*b;
}
TEST_CASE( "./succeeding/generators/1", "Generators over two ranges" )
{
using namespace Catch::Generators;
size_t i = GENERATE( between( 1, 5 ).then( values( 15, 20, 21 ).then( 36 ) ) );
size_t j = GENERATE( between( 100, 107 ) );
REQUIRE( multiply( i, 2 ) == i*2 );
REQUIRE( multiply( j, 2 ) == j*2 );
}

View File

@@ -0,0 +1,51 @@
/*
* MessageTests.cpp
* Catch - Test
*
* Created by Phil on 09/11/2010.
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "catch.hpp"
TEST_CASE( "./succeeding/message", "INFO and WARN do not abort tests" )
{
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( "./failing/message/info/1", "INFO gets logged on failure" )
{
INFO( "this message should be logged" );
INFO( "so should this" );
int a = 2;
REQUIRE( a == 1 );
}
TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" )
{
INFO( "this message should be logged" );
int a = 2;
CHECK( a == 2 );
INFO( "this message should be logged, too" );
CHECK( a == 1 );
INFO( "and this, but later" );
CHECK( a == 0 );
INFO( "but not this" );
CHECK( a == 2 );
}
TEST_CASE( "./failing/message/fail", "FAIL aborts the test" )
{
FAIL( "This is a " << "failure" ); // This should output the message and abort
}

View File

@@ -0,0 +1,123 @@
/*
* MiscTests.cpp
* Catch - Test
*
* Created by Phil on 29/11/2010.
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "catch.hpp"
#include <iostream>
TEST_CASE( "./succeeding/Misc/Sections", "random SECTION tests" )
{
int a = 1;
int b = 2;
SECTION( "s1", "doesn't equal" )
{
REQUIRE( a != b );
REQUIRE( b != a );
}
SECTION( "s2", "not equal" )
{
REQUIRE( a != b);
}
}
TEST_CASE( "./succeeding/Misc/Sections/nested", "nested SECTION tests" )
{
int a = 1;
int b = 2;
SECTION( "s1", "doesn't equal" )
{
REQUIRE( a != b );
REQUIRE( b != a );
SECTION( "s2", "not equal" )
{
REQUIRE( a != b);
}
}
}
TEST_CASE( "./mixed/Misc/Sections/nested2", "nested SECTION tests" )
{
int a = 1;
int b = 2;
SECTION( "s1", "doesn't equal" )
{
SECTION( "s2", "equal" )
{
REQUIRE( a == b );
}
SECTION( "s3", "not equal" )
{
REQUIRE( a != b );
}
SECTION( "s4", "less than" )
{
REQUIRE( a < b );
}
}
}
TEST_CASE( "./mixed/Misc/Sections/loops", "looped SECTION tests" )
{
int a = 1;
for( int b = 0; b < 10; ++b )
{
std::ostringstream oss;
oss << "b is currently: " << b;
SECTION( "s1", oss.str() )
{
CHECK( b > a );
}
}
}
TEST_CASE( "./mixed/Misc/loops", "looped tests" )
{
static const int fib[] = { 1, 1, 2, 3, 5, 8, 13, 21 };
for( size_t i=0; i < sizeof(fib)/sizeof(int); ++i )
{
INFO( "Testing if fib[" << i << "] (" << fib[i] << ") is even" );
CHECK( ( fib[i] % 2 ) == 0 );
}
}
TEST_CASE( "./succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" )
{
std::cout << "Some information";
std::cerr << "An error";
}
const char* makeString( bool makeNull )
{
return makeNull ? NULL : "valid string";
}
TEST_CASE( "./succeeding/Misc/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 );
}

View File

@@ -0,0 +1,75 @@
/*
* main.cpp
* Catch - Test
*
* Created by Phil on 22/10/2010.
* Copyright 2010 Two Blue Cubes Ltd
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
//#include "../catch_with_main.hpp"
#include "internal/catch_self_test.hpp"
#include "catch_runner.hpp"
int main (int argc, char * const argv[])
{
return Catch::Main( argc, argv );
}
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 );
}
SECTION( "selftest/expected result/succeeding tests",
"Tests in the 'succeeding' branch succeed" )
{
MetaTestRunner::runMatching( "./succeeding/*", MetaTestRunner::Expected::ToSucceed );
}
}
///////////////////////////////////////////////////////////////////////////
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" )
{
runner.runMatching( "./succeeding/*" );
CHECK( runner.getSuccessCount() == 223 );
CHECK( runner.getFailureCount() == 0 );
}
SECTION( "selftest/test counts/failing tests",
"Number of 'failing' tests is fixed" )
{
runner.runMatching( "./failing/*" );
CHECK( runner.getSuccessCount() == 0 );
CHECK( runner.getFailureCount() == 60 );
}
}
}
TEST_CASE( "meta/Misc/Sections", "looped tests" )
{
Catch::EmbeddedRunner runner;
runner.runMatching( "./mixed/Misc/Sections/nested2" );
CHECK( runner.getSuccessCount() == 2 );
CHECK( runner.getFailureCount() == 1 );
}

View File

@@ -0,0 +1,237 @@
/*
* TrickyTests.cpp
* Catch - Test
*
* Created by Phil on 09/11/2010.
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "catch.hpp"
namespace Catch
{
template<>
std::string toString<std::pair<int, int> >( const std::pair<int, int>& value )
{
std::ostringstream oss;
oss << "std::pair( " << value.first << ", " << value.second << " )";
return oss.str();
}
}
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/Tricky/std::pair",
"Parsing a std::pair"
)
{
std::pair<int, int> aNicePair( 1, 2 );
// !TBD: would be nice if this could compile without the extra parentheses
REQUIRE( (std::pair<int, int>( 1, 2 )) == aNicePair );
}
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./inprogress/failing/Tricky/trailing expression",
"Where the is more to the expression after the RHS"
)
{
/*
int a = 1;
int b = 2;
// This only captures part of the expression, but issues a warning about the rest
REQUIRE( a == 2 || b == 2 );
*/
WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
}
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./inprogress/failing/Tricky/compound lhs",
"Where the LHS is not a simple value"
)
{
/*
int a = 1;
int b = 2;
// This only captures part of the expression, but issues a warning about the rest
REQUIRE( a+1 == b-1 );
*/
WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
}
struct Opaque
{
int val;
bool operator ==( const Opaque& o ) const
{
return val == o.val;
}
};
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./failing/Tricky/non streamable type",
"A failing expression with a non streamable type is still captured"
)
{
Opaque o1, o2;
o1.val = 7;
o2.val = 8;
CHECK( &o1 == &o2 );
CHECK( o1 == o2 );
}
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./failing/string literals",
"string literals of different sizes can be compared"
)
{
REQUIRE( std::string( "first" ) == "second" );
}
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/side-effects",
"An expression with side-effects should only be evaluated once"
)
{
int i = 7;
REQUIRE( i++ == 7 );
REQUIRE( i++ == 8 );
}
namespace A {
struct X
{
X() : a(4), b(2), c(7) {}
X(int v) : a(v), b(2), c(7) {}
int a;
int b;
int c;
};
}
namespace B {
struct Y
{
Y() : a(4), b(2), c(7) {}
Y(int v) : a(v), b(2), c(7) {}
int a;
int b;
int c;
};
}
bool operator==(const A::X& lhs, const B::Y& rhs)
{
return (lhs.a == rhs.a);
}
bool operator==(const B::Y& lhs, const A::X& rhs)
{
return (lhs.a == rhs.a);
}
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/koenig",
"Operators at different namespace levels not hijacked by Koenig lookup"
)
{
A::X x;
B::Y y;
REQUIRE( x == y );
}
namespace ObjectWithConversions
{
struct Object
{
operator unsigned int() {return 0xc0000000;}
};
///////////////////////////////////////////////////////////////////////////////
TEST_CASE
(
"./succeeding/koenig",
"Operators at different namespace levels not hijacked by Koenig lookup"
)
{
Object o;
REQUIRE(0xc0000000 == o );
}
}
namespace ObjectWithNonConstEqualityOperator
{
struct Test
{
Test( unsigned int v )
: m_value(v)
{}
bool operator==( const Test&rhs )
{
return (m_value == rhs.m_value);
}
bool operator==( const Test&rhs ) const
{
return (m_value != rhs.m_value);
}
unsigned int m_value;
};
TEST_CASE("./succeeding/non-const==", "Demonstrate that a non-const == is not used")
{
Test t( 1 );
REQUIRE( t == 1 );
}
}
namespace EnumBitFieldTests
{
enum Bits {bit0 = 0x0001, bit1 = 0x0002, bit2 = 0x0004, bit3 = 0x0008, bit1and2 = 0x0006,
bit30 = 0x40000000, bit31 = 0x80000000,
bit30and31 = 0xc0000000};
TEST_CASE("./succeeding/enum/bits", "Test enum bit values")
{
REQUIRE( 0xc0000000 == bit30and31 );
}
}
struct Obj
{
Obj():prop(&p){}
int p;
int* prop;
};
TEST_CASE("./succeeding/boolean member", "")
{
Obj obj;
REQUIRE( obj.prop != NULL );
}

View File

@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCatch", "TestCatch\TestCatch.vcproj", "{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Debug|Win32.ActiveCfg = Debug|Win32
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Debug|Win32.Build.0 = Debug|Win32
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Release|Win32.ActiveCfg = Release|Win32
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,33 @@
========================================================================
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

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

View File

@@ -0,0 +1,382 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="TestCatch"
ProjectGUID="{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}"
RootNamespace="TestCatch"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\..\SelfTest\TestMain.cpp"
>
</File>
</Filter>
<Filter
Name="Include"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\..\..\include\catch.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\catch_objc.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\catch_objc_main.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\catch_runner.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\catch_with_main.hpp"
>
</File>
<Filter
Name="Internal"
>
<File
RelativePath="..\..\..\..\include\internal\catch_capture.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_commandline.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_common.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_config.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_debugger.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_evaluate.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_exception_translator_registry.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_generators.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_generators_impl.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_hub.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_hub_impl.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_interfaces_capture.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_interfaces_exception.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_interfaces_reporter.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_interfaces_runner.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_interfaces_testcase.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_list.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_reporter_registrars.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_reporter_registry.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_result_type.h"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_resultinfo.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_runner_impl.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_section.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_self_test.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_stream.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_test_case_info.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_test_registry.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\internal\catch_xmlwriter.hpp"
>
</File>
</Filter>
<Filter
Name="Reporters"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\..\..\..\include\reporters\catch_reporter_basic.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\reporters\catch_reporter_junit.hpp"
>
</File>
<File
RelativePath="..\..\..\..\include\reporters\catch_reporter_xml.hpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="TestCases"
>
<File
RelativePath="..\..\..\SelfTest\ClassTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\ConditionTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\ExceptionTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\GeneratorTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\MessageTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\MiscTests.cpp"
>
</File>
<File
RelativePath="..\..\..\SelfTest\TrickyTests.cpp"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,436 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
4A060CEC1362030B00BBA8F8 /* TestMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CE41362030B00BBA8F8 /* TestMain.cpp */; };
4A060CED1362030B00BBA8F8 /* TrickyTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CE51362030B00BBA8F8 /* TrickyTests.cpp */; };
4A060CEE1362030B00BBA8F8 /* ExceptionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CE61362030B00BBA8F8 /* ExceptionTests.cpp */; };
4A060CEF1362030B00BBA8F8 /* ClassTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CE71362030B00BBA8F8 /* ClassTests.cpp */; };
4A060CF01362030B00BBA8F8 /* MiscTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CE81362030B00BBA8F8 /* MiscTests.cpp */; };
4A060CF11362030B00BBA8F8 /* ConditionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CE91362030B00BBA8F8 /* ConditionTests.cpp */; };
4A060CF21362030B00BBA8F8 /* MessageTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CEA1362030B00BBA8F8 /* MessageTests.cpp */; };
4A060CF31362030B00BBA8F8 /* GeneratorTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A060CEB1362030B00BBA8F8 /* GeneratorTests.cpp */; };
8DD76F6A0486A84900D96B5E /* Test.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859E8B029090EE04C91782 /* Test.1 */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F690486A84900D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
8DD76F6A0486A84900D96B5E /* Test.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
4A060CE41362030B00BBA8F8 /* TestMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestMain.cpp; path = ../SelfTest/TestMain.cpp; sourceTree = SOURCE_ROOT; };
4A060CE51362030B00BBA8F8 /* TrickyTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TrickyTests.cpp; path = ../SelfTest/TrickyTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CE61362030B00BBA8F8 /* ExceptionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExceptionTests.cpp; path = ../SelfTest/ExceptionTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CE71362030B00BBA8F8 /* ClassTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClassTests.cpp; path = ../SelfTest/ClassTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CE81362030B00BBA8F8 /* MiscTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MiscTests.cpp; path = ../SelfTest/MiscTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CE91362030B00BBA8F8 /* ConditionTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConditionTests.cpp; path = ../SelfTest/ConditionTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CEA1362030B00BBA8F8 /* MessageTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MessageTests.cpp; path = ../SelfTest/MessageTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CEB1362030B00BBA8F8 /* GeneratorTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeneratorTests.cpp; path = ../SelfTest/GeneratorTests.cpp; sourceTree = SOURCE_ROOT; };
4A060CF41362033300BBA8F8 /* catch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch.hpp; path = ../../include/catch.hpp; sourceTree = SOURCE_ROOT; };
4A060CF51362033300BBA8F8 /* catch_runner.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner.hpp; path = ../../include/catch_runner.hpp; sourceTree = SOURCE_ROOT; };
4A060CF61362033300BBA8F8 /* catch_with_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_with_main.hpp; path = ../../include/catch_with_main.hpp; sourceTree = SOURCE_ROOT; };
4A060CF71362036F00BBA8F8 /* catch_reporter_xml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_xml.hpp; path = ../../include/reporters/catch_reporter_xml.hpp; sourceTree = SOURCE_ROOT; };
4A060CF81362036F00BBA8F8 /* catch_reporter_basic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_basic.hpp; path = ../../include/reporters/catch_reporter_basic.hpp; sourceTree = SOURCE_ROOT; };
4A060CF91362036F00BBA8F8 /* catch_reporter_junit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_junit.hpp; path = ../../include/reporters/catch_reporter_junit.hpp; sourceTree = SOURCE_ROOT; };
4A060CFA1362038F00BBA8F8 /* catch_exception_translator_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_exception_translator_registry.hpp; path = ../../include/internal/catch_exception_translator_registry.hpp; sourceTree = SOURCE_ROOT; };
4A060CFB1362038F00BBA8F8 /* catch_interfaces_exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_interfaces_exception.h; path = ../../include/internal/catch_interfaces_exception.h; sourceTree = SOURCE_ROOT; };
4A060CFC136203B800BBA8F8 /* catch_section.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_section.hpp; path = ../../include/internal/catch_section.hpp; sourceTree = SOURCE_ROOT; };
4A060CFD136203B800BBA8F8 /* catch_runner_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_runner_impl.hpp; path = ../../include/internal/catch_runner_impl.hpp; sourceTree = SOURCE_ROOT; };
4A060CFE136203B800BBA8F8 /* catch_interfaces_capture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_interfaces_capture.h; path = ../../include/internal/catch_interfaces_capture.h; sourceTree = SOURCE_ROOT; };
4A060CFF136203B800BBA8F8 /* catch_test_case_info.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_test_case_info.hpp; path = ../../include/internal/catch_test_case_info.hpp; sourceTree = SOURCE_ROOT; };
4A060D00136203B800BBA8F8 /* catch_test_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_test_registry.hpp; path = ../../include/internal/catch_test_registry.hpp; sourceTree = SOURCE_ROOT; };
4A060D01136203B800BBA8F8 /* catch_test_case_registry_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_test_case_registry_impl.hpp; path = ../../include/internal/catch_test_case_registry_impl.hpp; sourceTree = SOURCE_ROOT; };
4A060D02136203B800BBA8F8 /* catch_capture.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_capture.hpp; path = ../../include/internal/catch_capture.hpp; sourceTree = SOURCE_ROOT; };
4A060D03136203B800BBA8F8 /* catch_hub_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_hub_impl.hpp; path = ../../include/internal/catch_hub_impl.hpp; sourceTree = SOURCE_ROOT; };
4A060D04136203B800BBA8F8 /* catch_hub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_hub.h; path = ../../include/internal/catch_hub.h; sourceTree = SOURCE_ROOT; };
4A060D05136203B800BBA8F8 /* catch_interfaces_reporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_interfaces_reporter.h; path = ../../include/internal/catch_interfaces_reporter.h; sourceTree = SOURCE_ROOT; };
4A060D06136203B800BBA8F8 /* catch_commandline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_commandline.hpp; path = ../../include/internal/catch_commandline.hpp; sourceTree = SOURCE_ROOT; };
4A060D07136203B800BBA8F8 /* catch_config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_config.hpp; path = ../../include/internal/catch_config.hpp; sourceTree = SOURCE_ROOT; };
4A060D08136203B800BBA8F8 /* catch_self_test.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_self_test.hpp; path = ../../include/internal/catch_self_test.hpp; sourceTree = SOURCE_ROOT; };
4A060D09136203B800BBA8F8 /* catch_resultinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_resultinfo.hpp; path = ../../include/internal/catch_resultinfo.hpp; sourceTree = SOURCE_ROOT; };
4A060D0A136203B800BBA8F8 /* catch_result_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_result_type.h; path = ../../include/internal/catch_result_type.h; sourceTree = SOURCE_ROOT; };
4A060D0B136203B800BBA8F8 /* catch_interfaces_testcase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_interfaces_testcase.h; path = ../../include/internal/catch_interfaces_testcase.h; sourceTree = SOURCE_ROOT; };
4A060D0C136203B800BBA8F8 /* catch_interfaces_runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_interfaces_runner.h; path = ../../include/internal/catch_interfaces_runner.h; sourceTree = SOURCE_ROOT; };
4A060D0D136203B800BBA8F8 /* catch_generators.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_generators.hpp; path = ../../include/internal/catch_generators.hpp; sourceTree = SOURCE_ROOT; };
4A060D0E136203B800BBA8F8 /* catch_evaluate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_evaluate.hpp; path = ../../include/internal/catch_evaluate.hpp; sourceTree = SOURCE_ROOT; };
4A060D0F136203B800BBA8F8 /* catch_debugger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_debugger.hpp; path = ../../include/internal/catch_debugger.hpp; sourceTree = SOURCE_ROOT; };
4A060D10136203B800BBA8F8 /* catch_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = catch_common.h; path = ../../include/internal/catch_common.h; sourceTree = SOURCE_ROOT; };
4A060D11136203B800BBA8F8 /* catch_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_stream.hpp; path = ../../include/internal/catch_stream.hpp; sourceTree = SOURCE_ROOT; };
4A060D12136203B800BBA8F8 /* catch_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_list.hpp; path = ../../include/internal/catch_list.hpp; sourceTree = SOURCE_ROOT; };
4A060D13136203B800BBA8F8 /* catch_reporter_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_registry.hpp; path = ../../include/internal/catch_reporter_registry.hpp; sourceTree = SOURCE_ROOT; };
4A060D14136203B800BBA8F8 /* catch_reporter_registrars.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_reporter_registrars.hpp; path = ../../include/internal/catch_reporter_registrars.hpp; sourceTree = SOURCE_ROOT; };
4A060D15136203B800BBA8F8 /* catch_xmlwriter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_xmlwriter.hpp; path = ../../include/internal/catch_xmlwriter.hpp; sourceTree = SOURCE_ROOT; };
4A060D16136203B800BBA8F8 /* catch_generators_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_generators_impl.hpp; path = ../../include/internal/catch_generators_impl.hpp; sourceTree = SOURCE_ROOT; };
8DD76F6C0486A84900D96B5E /* Test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Test; sourceTree = BUILT_PRODUCTS_DIR; };
C6859E8B029090EE04C91782 /* Test.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = Test.1; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F660486A84900D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* Test */ = {
isa = PBXGroup;
children = (
08FB7795FE84155DC02AAC07 /* Source */,
C6859E8C029090F304C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = Test;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
4A060CE41362030B00BBA8F8 /* TestMain.cpp */,
4AA7E96C129FA2A0005A0B97 /* Tests */,
4AFC341312809A12003A0C29 /* Catch */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76F6C0486A84900D96B5E /* Test */,
);
name = Products;
sourceTree = "<group>";
};
4A13FF92135EBED500EC5928 /* Exceptions */ = {
isa = PBXGroup;
children = (
4A060CFA1362038F00BBA8F8 /* catch_exception_translator_registry.hpp */,
4A060CFB1362038F00BBA8F8 /* catch_interfaces_exception.h */,
);
name = Exceptions;
sourceTree = "<group>";
};
4A302E3712D515B700C84B67 /* TestCase registration */ = {
isa = PBXGroup;
children = (
4A060CFC136203B800BBA8F8 /* catch_section.hpp */,
4A060D02136203B800BBA8F8 /* catch_capture.hpp */,
4A060CFF136203B800BBA8F8 /* catch_test_case_info.hpp */,
4A060D00136203B800BBA8F8 /* catch_test_registry.hpp */,
4A060D0B136203B800BBA8F8 /* catch_interfaces_testcase.h */,
4A060CFE136203B800BBA8F8 /* catch_interfaces_capture.h */,
4A060D0A136203B800BBA8F8 /* catch_result_type.h */,
);
name = "TestCase registration";
sourceTree = "<group>";
};
4A302E3812D515DF00C84B67 /* Running & Results */ = {
isa = PBXGroup;
children = (
4A060D07136203B800BBA8F8 /* catch_config.hpp */,
4A060D09136203B800BBA8F8 /* catch_resultinfo.hpp */,
4A060CFD136203B800BBA8F8 /* catch_runner_impl.hpp */,
4A060D0C136203B800BBA8F8 /* catch_interfaces_runner.h */,
4A060D0D136203B800BBA8F8 /* catch_generators.hpp */,
);
name = "Running & Results";
sourceTree = "<group>";
};
4A302E3912D5160400C84B67 /* Hub-Impl */ = {
isa = PBXGroup;
children = (
4A060D01136203B800BBA8F8 /* catch_test_case_registry_impl.hpp */,
4A060D04136203B800BBA8F8 /* catch_hub.h */,
4A060D03136203B800BBA8F8 /* catch_hub_impl.hpp */,
4A060D16136203B800BBA8F8 /* catch_generators_impl.hpp */,
);
name = "Hub-Impl";
sourceTree = "<group>";
};
4A33BE0C12CE93380052A211 /* reporting */ = {
isa = PBXGroup;
children = (
4A060D12136203B800BBA8F8 /* catch_list.hpp */,
4A060D13136203B800BBA8F8 /* catch_reporter_registry.hpp */,
4A060D14136203B800BBA8F8 /* catch_reporter_registrars.hpp */,
4A060D05136203B800BBA8F8 /* catch_interfaces_reporter.h */,
);
name = reporting;
sourceTree = "<group>";
};
4A33BE0F12CE936C0052A211 /* support */ = {
isa = PBXGroup;
children = (
4A060D06136203B800BBA8F8 /* catch_commandline.hpp */,
4A060D0F136203B800BBA8F8 /* catch_debugger.hpp */,
4A060D10136203B800BBA8F8 /* catch_common.h */,
4A060D15136203B800BBA8F8 /* catch_xmlwriter.hpp */,
4A060D11136203B800BBA8F8 /* catch_stream.hpp */,
4A060D0E136203B800BBA8F8 /* catch_evaluate.hpp */,
);
name = support;
sourceTree = "<group>";
};
4AA7E96B129FA282005A0B97 /* Reporters */ = {
isa = PBXGroup;
children = (
4A060CF71362036F00BBA8F8 /* catch_reporter_xml.hpp */,
4A060CF81362036F00BBA8F8 /* catch_reporter_basic.hpp */,
4A060CF91362036F00BBA8F8 /* catch_reporter_junit.hpp */,
);
name = Reporters;
sourceTree = "<group>";
};
4AA7E96C129FA2A0005A0B97 /* Tests */ = {
isa = PBXGroup;
children = (
4A060CE51362030B00BBA8F8 /* TrickyTests.cpp */,
4A060CE61362030B00BBA8F8 /* ExceptionTests.cpp */,
4A060CE71362030B00BBA8F8 /* ClassTests.cpp */,
4A060CE81362030B00BBA8F8 /* MiscTests.cpp */,
4A060CE91362030B00BBA8F8 /* ConditionTests.cpp */,
4A060CEA1362030B00BBA8F8 /* MessageTests.cpp */,
4A060CEB1362030B00BBA8F8 /* GeneratorTests.cpp */,
);
name = Tests;
sourceTree = "<group>";
};
4AFC341312809A12003A0C29 /* Catch */ = {
isa = PBXGroup;
children = (
4A060CF41362033300BBA8F8 /* catch.hpp */,
4A060CF51362033300BBA8F8 /* catch_runner.hpp */,
4A060CF61362033300BBA8F8 /* catch_with_main.hpp */,
4AA7E96B129FA282005A0B97 /* Reporters */,
4AFC341412809A1B003A0C29 /* Internal */,
);
name = Catch;
sourceTree = "<group>";
};
4AFC341412809A1B003A0C29 /* Internal */ = {
isa = PBXGroup;
children = (
4A13FF92135EBED500EC5928 /* Exceptions */,
4A302E3912D5160400C84B67 /* Hub-Impl */,
4A302E3812D515DF00C84B67 /* Running & Results */,
4A302E3712D515B700C84B67 /* TestCase registration */,
4A33BE0F12CE936C0052A211 /* support */,
4A33BE0C12CE93380052A211 /* reporting */,
4A060D08136203B800BBA8F8 /* catch_self_test.hpp */,
);
name = Internal;
sourceTree = "<group>";
};
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
C6859E8B029090EE04C91782 /* Test.1 */,
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F620486A84900D96B5E /* Test */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "Test" */;
buildPhases = (
8DD76F640486A84900D96B5E /* Sources */,
8DD76F660486A84900D96B5E /* Frameworks */,
8DD76F690486A84900D96B5E /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = Test;
productInstallPath = "$(HOME)/bin";
productName = Test;
productReference = 8DD76F6C0486A84900D96B5E /* Test */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "CatchSelfTest" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* Test */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* Test */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
8DD76F640486A84900D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4A060CEC1362030B00BBA8F8 /* TestMain.cpp in Sources */,
4A060CED1362030B00BBA8F8 /* TrickyTests.cpp in Sources */,
4A060CEE1362030B00BBA8F8 /* ExceptionTests.cpp in Sources */,
4A060CEF1362030B00BBA8F8 /* ClassTests.cpp in Sources */,
4A060CF01362030B00BBA8F8 /* MiscTests.cpp in Sources */,
4A060CF11362030B00BBA8F8 /* ConditionTests.cpp in Sources */,
4A060CF21362030B00BBA8F8 /* MessageTests.cpp in Sources */,
4A060CF31362030B00BBA8F8 /* GeneratorTests.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = Test;
};
name = Debug;
};
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = Test;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_GLOBAL_CONSTRUCTORS = NO;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_PEDANTIC = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
USER_HEADER_SEARCH_PATHS = ../../include;
WARNING_CFLAGS = (
"-Wfloat-equal",
"-Wundef",
"-Wshadow",
"-Wpointer-arith",
"-Wcast-qual",
"-Wcast-align",
"-Wwrite-strings",
"-Wconversion",
"-Wsign-compare",
"-Wmissing-noreturn",
"-Wmissing-format-attribute",
"-Wpacked",
"-Winline",
"-Wdisabled-optimization",
"-Wctor-dtor-privacy",
"-Wnon-virtual-dtor",
"-Wreorder",
"-Wold-style-cast",
"-Woverloaded-virtual",
"-ffor-scope",
"-Wextra",
"-Wall",
);
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
USER_HEADER_SEARCH_PATHS = ../../include;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "Test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923208733DC60010E9CD /* Debug */,
1DEB923308733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "CatchSelfTest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923608733DC60010E9CD /* Debug */,
1DEB923708733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Test.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
<FileBreakpoints>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "0"
filePath = "/TwoBlueCubes/Dev/GitHub/Catch/catch_reporter_junit.hpp"
timestampString = "322167915.384904"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "155"
endingLineNumber = "155">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "0"
filePath = "/TwoBlueCubes/Dev/GitHub/Catch/catch_reporter_junit.hpp"
timestampString = "322167915.384942"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "199"
endingLineNumber = "199">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "0"
filePath = "/TwoBlueCubes/Dev/GitHub/Catch/internal/catch_commandline.hpp"
timestampString = "322167915.384952"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "167"
endingLineNumber = "167">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "0"
filePath = "/TwoBlueCubes/Dev/GitHub/Catch/catch_reporter_basic.hpp"
timestampString = "322167915.384982"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "213"
endingLineNumber = "213">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "ConditionTests.cpp"
timestampString = "322167915.893464"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "229"
endingLineNumber = "229">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "0"
filePath = "/TwoBlueCubes/Dev/GitHub/Catch/internal/catch_hub_impl.hpp"
timestampString = "322421671.367839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "82"
endingLineNumber = "82"
landmarkName = "Hub::createStreamBuf ( const std::string&amp; streamName )"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
</Bucket>

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
BuildableName = "Test"
BlueprintName = "Test"
ReferencedContainer = "container:Test.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
displayScaleIsEnabled = "NO"
displayScale = "1.00"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
BuildableName = "Test"
BlueprintName = "Test"
ReferencedContainer = "container:Test.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-t ./inprogress/*"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-r junit"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-r xml"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t ./succeeding/*"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-s"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "-t explore/*"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-o %debug"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t &quot;./succeeding/conditions/unsigned-negative&quot;"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t &quot;./failing/conditions/unsigned-negative&quot;"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t &quot;investigation/neg comp&quot;"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "-t meta/*"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-b"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-l"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t example/*"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t ./failing/*"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t ./inprogress/succeeding/side-effects"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-h"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t &quot;./failing/string literals&quot;"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-t ./succeeding/generators/*"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
displayScaleIsEnabled = "NO"
displayScale = "1.00"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
BuildableName = "Test"
BlueprintName = "Test"
ReferencedContainer = "container:Test.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Test.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8DD76F620486A84900D96B5E</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,21 @@
//
// CatchOCTestCase.h
// OCTest
//
// Created by Phil on 13/11/2010.
// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "catch_objc.hpp"
#import <Cocoa/Cocoa.h>
#import "TestObj.h"
@interface TestFixture : NSObject <OcFixture>
{
TestObj* obj;
}
@end

View File

@@ -0,0 +1,45 @@
//
// CatchOCTestCase.mm
// OCTest
//
// Created by Phil Nash on 13/11/2010.
// Copyright 2010 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)
#import "CatchOCTestCase.h"
@implementation TestFixture
-(void) setUp
{
obj = [[TestObj alloc] init];
}
-(void) tearDown
{
[obj release];
}
OC_TEST_CASE( "OCTest/test1", "This is a test case" )
{
REQUIRE( obj.int_val == 0 );
obj.int_val = 1;
REQUIRE( obj.int_val == 1 );
}
OC_TEST_CASE( "OCTest/test2", "This is another test case" )
{
REQUIRE( obj.int_val == 0 );
obj.int_val = 2;
REQUIRE( obj.int_val == 2 );
}
@end

View File

@@ -0,0 +1 @@
#import "catch_objc_main.hpp"

View File

@@ -0,0 +1,79 @@
.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
.\"See Also:
.\"man mdoc.samples for a complete listing of options
.\"man mdoc for the short list of editing options
.\"/usr/share/misc/mdoc.template
.Dd 13/11/2010 \" DATE
.Dt OCTest 1 \" Program name and manual section number
.Os Darwin
.Sh NAME \" Section Header - required - don't modify
.Nm OCTest,
.\" The following lines are read in generating the apropos(man -k) database. Use only key
.\" words here as the database is built based on the words here and in the .ND line.
.Nm Other_name_for_same_program(),
.Nm Yet another name for the same program.
.\" Use .Nm macro to designate other names for the documented program.
.Nd This line parsed for whatis database.
.Sh SYNOPSIS \" Section Header - required - don't modify
.Nm
.Op Fl abcd \" [-abcd]
.Op Fl a Ar path \" [-a path]
.Op Ar file \" [file]
.Op Ar \" [file ...]
.Ar arg0 \" Underlined argument - use .Ar anywhere to underline
arg2 ... \" Arguments
.Sh DESCRIPTION \" Section Header - required - don't modify
Use the .Nm macro to refer to your program throughout the man page like such:
.Nm
Underlining is accomplished with the .Ar macro like this:
.Ar underlined text .
.Pp \" Inserts a space
A list of items with descriptions:
.Bl -tag -width -indent \" Begins a tagged list
.It item a \" Each item preceded by .It macro
Description of item a
.It item b
Description of item b
.El \" Ends the list
.Pp
A list of flags and their descriptions:
.Bl -tag -width -indent \" Differs from above in tag removed
.It Fl a \"-a flag as a list item
Description of -a flag
.It Fl b
Description of -b flag
.El \" Ends the list
.Pp
.\" .Sh ENVIRONMENT \" May not be needed
.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
.\" .It Ev ENV_VAR_1
.\" Description of ENV_VAR_1
.\" .It Ev ENV_VAR_2
.\" Description of ENV_VAR_2
.\" .El
.Sh FILES \" File used or created by the topic of the man page
.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
.It Pa /usr/share/file_name
FILE_1 description
.It Pa /Users/joeuser/Library/really_long_file_name
FILE_2 description
.El \" Ends the list
.\" .Sh DIAGNOSTICS \" May not be needed
.\" .Bl -diag
.\" .It Diagnostic Tag
.\" Diagnostic informtion here.
.\" .It Diagnostic Tag
.\" Diagnostic informtion here.
.\" .El
.Sh SEE ALSO
.\" List links in ascending order by section, alphabetically within a section.
.\" Please do not reference files that do not exist without filing a bug report
.Xr a 1 ,
.Xr b 1 ,
.Xr c 1 ,
.Xr a 2 ,
.Xr b 2 ,
.Xr a 3 ,
.Xr b 3
.\" .Sh BUGS \" Document known, unremedied bugs
.\" .Sh HISTORY \" Document history if command behaves in a unique manner

View File

@@ -0,0 +1,28 @@
/*
* OCTest.mm
* OCTest
*
* Created by Phil on 13/11/2010.
* Copyright 2010 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)
*
*/
#import "catch.hpp"
#import "TestObj.h"
TEST_CASE( "OCTest/TestObj", "tests TestObj" )
{
TestObj* obj = [[TestObj alloc] init];
REQUIRE( obj.int_val == 0 );
obj.int_val = 1;
REQUIRE( obj.int_val == 1 );
[obj release];
}

View File

@@ -0,0 +1,250 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
4A5953B5128E95B8009DC1B9 /* TestObj.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5953B4128E95B8009DC1B9 /* TestObj.m */; };
4A5953B7128E95D6009DC1B9 /* OCTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A5953B6128E95D6009DC1B9 /* OCTest.mm */; };
4A5953F1128E9A61009DC1B9 /* CatchOCTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */; };
8DD76F9A0486AA7600D96B5E /* Main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* Main.mm */; settings = {ATTRIBUTES = (); }; };
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
8DD76F9F0486AA7600D96B5E /* OCTest.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859EA3029092ED04C91782 /* OCTest.1 */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
8DD76F9F0486AA7600D96B5E /* OCTest.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
08FB7796FE84155DC02AAC07 /* Main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Main.mm; sourceTree = "<group>"; };
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCTest_Prefix.pch; sourceTree = "<group>"; };
4A5953B3128E95B8009DC1B9 /* TestObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObj.h; sourceTree = "<group>"; };
4A5953B4128E95B8009DC1B9 /* TestObj.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestObj.m; sourceTree = "<group>"; };
4A5953B6128E95D6009DC1B9 /* OCTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCTest.mm; sourceTree = "<group>"; };
4A5953EF128E9A61009DC1B9 /* CatchOCTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchOCTestCase.h; sourceTree = "<group>"; };
4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CatchOCTestCase.mm; sourceTree = "<group>"; };
4ADB5B8913655AA4001EB00B /* catch_objc_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc_main.hpp; path = ../../../include/catch_objc_main.hpp; sourceTree = SOURCE_ROOT; };
4ADB5B8A13655AA4001EB00B /* catch_objc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = catch_objc.hpp; path = ../../../include/catch_objc.hpp; sourceTree = SOURCE_ROOT; };
8DD76FA10486AA7600D96B5E /* OCTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = OCTest; sourceTree = BUILT_PRODUCTS_DIR; };
C6859EA3029092ED04C91782 /* OCTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = OCTest.1; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* OCTest */ = {
isa = PBXGroup;
children = (
08FB7795FE84155DC02AAC07 /* Source */,
C6859EA2029092E104C91782 /* Documentation */,
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = OCTest;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
4ADB5B8913655AA4001EB00B /* catch_objc_main.hpp */,
4ADB5B8A13655AA4001EB00B /* catch_objc.hpp */,
4AFDF58212CA9E2800F15202 /* Catch */,
32A70AAB03705E1F00C91783 /* OCTest_Prefix.pch */,
08FB7796FE84155DC02AAC07 /* Main.mm */,
4A5953B3128E95B8009DC1B9 /* TestObj.h */,
4A5953B4128E95B8009DC1B9 /* TestObj.m */,
4A5953B6128E95D6009DC1B9 /* OCTest.mm */,
4A5953EF128E9A61009DC1B9 /* CatchOCTestCase.h */,
4A5953F0128E9A61009DC1B9 /* CatchOCTestCase.mm */,
);
name = Source;
sourceTree = "<group>";
};
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
08FB779EFE84155DC02AAC07 /* Foundation.framework */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76FA10486AA7600D96B5E /* OCTest */,
);
name = Products;
sourceTree = "<group>";
};
4AFDF58212CA9E2800F15202 /* Catch */ = {
isa = PBXGroup;
children = (
);
name = Catch;
sourceTree = "<group>";
};
C6859EA2029092E104C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
C6859EA3029092ED04C91782 /* OCTest.1 */,
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F960486AA7600D96B5E /* OCTest */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "OCTest" */;
buildPhases = (
8DD76F990486AA7600D96B5E /* Sources */,
8DD76F9B0486AA7600D96B5E /* Frameworks */,
8DD76F9E0486AA7600D96B5E /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = OCTest;
productInstallPath = "$(HOME)/bin";
productName = OCTest;
productReference = 8DD76FA10486AA7600D96B5E /* OCTest */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "OCTest" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* OCTest */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F960486AA7600D96B5E /* OCTest */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
8DD76F990486AA7600D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8DD76F9A0486AA7600D96B5E /* Main.mm in Sources */,
4A5953B5128E95B8009DC1B9 /* TestObj.m in Sources */,
4A5953B7128E95D6009DC1B9 /* OCTest.mm in Sources */,
4A5953F1128E9A61009DC1B9 /* CatchOCTestCase.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB927508733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = OCTest_Prefix.pch;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = OCTest;
};
name = Debug;
};
1DEB927608733DD40010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = OCTest_Prefix.pch;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = OCTest;
};
name = Release;
};
1DEB927908733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
USER_HEADER_SEARCH_PATHS = ../../../include;
};
name = Debug;
};
1DEB927A08733DD40010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
USER_HEADER_SEARCH_PATHS = ../../../include;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "OCTest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB927508733DD40010E9CD /* Debug */,
1DEB927608733DD40010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "OCTest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB927908733DD40010E9CD /* Debug */,
1DEB927A08733DD40010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'OCTest' target in the 'OCTest' project.
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif

View File

@@ -0,0 +1,21 @@
//
// TestObj.h
// OCTest
//
// Created by Phil on 13/11/2010.
// Copyright 2010 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)
#import <Cocoa/Cocoa.h>
@interface TestObj : NSObject {
int int_val;
}
@property (nonatomic, assign ) int int_val;
@end

View File

@@ -0,0 +1,18 @@
//
// TestObj.m
// OCTest
//
// Created by Phil on 13/11/2010.
// Copyright 2010 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)
#import "TestObj.h"
@implementation TestObj
@synthesize int_val;
@end

View File

@@ -0,0 +1,108 @@
/*
* iTchRunnerAppDelegate.h
* iTchRunner
*
* Created by Phil on 07/02/2011.
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
*
*/
#import "iTchRunnerMainView.h"
@interface iTchRunnerAppDelegate : NSObject <UIApplicationDelegate>
{
UIWindow *window;
}
@end
@implementation iTchRunnerAppDelegate
///////////////////////////////////////////////////////////////////////////////
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[window setUserInteractionEnabled:YES];
[window setMultipleTouchEnabled:YES];
CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
iTchRunnerMainView* view = [[iTchRunnerMainView alloc] initWithFrame:screenRect];
[window addSubview:view];
[window makeKeyAndVisible];
[view release];
return YES;
}
///////////////////////////////////////////////////////////////////////////////
- (void)dealloc
{
[window release];
[super dealloc];
}
///////////////////////////////////////////////////////////////////////////////
- (void)applicationWillResignActive:(UIApplication *)application
{
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
}
///////////////////////////////////////////////////////////////////////////////
- (void)applicationDidEnterBackground:(UIApplication *)application
{
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/
}
///////////////////////////////////////////////////////////////////////////////
- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/
}
///////////////////////////////////////////////////////////////////////////////
- (void)applicationDidBecomeActive:(UIApplication *)application
{
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}
///////////////////////////////////////////////////////////////////////////////
- (void)applicationWillTerminate:(UIApplication *)application
{
/*
Called when the application is about to terminate.
See also applicationDidEnterBackground:.
*/
}
///////////////////////////////////////////////////////////////////////////////
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
/*
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
*/
}
@end

View File

@@ -0,0 +1,135 @@
/*
* iTchRunnerMainView.h
* iTchRunner
*
* Created by Phil on 07/02/2011.
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
*
*/
#include "internal/catch_config.hpp"
#include "internal/catch_runner_impl.hpp"
#include "internal/catch_hub_impl.hpp"
#include "catch.hpp"
#include "iTchRunnerReporter.h"
#import <UIKit/UIKit.h>
@interface iTchRunnerMainView : UIView<iTchRunnerDelegate, UIActionSheetDelegate>
{
UITextField* appName;
}
@end
@implementation iTchRunnerMainView
///////////////////////////////////////////////////////////////////////////////
-(id) initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame]))
{
// Initialization code
self.backgroundColor = [UIColor blackColor];
appName = [[UITextField alloc] initWithFrame: CGRectMake( 0, 50, 320, 50 )];
[self addSubview: appName];
[appName release];
appName.textColor = [[UIColor alloc] initWithRed:0.35 green:0.35 blue:1 alpha:1];
[appName.textColor release];
appName.textAlignment = UITextAlignmentCenter;
appName.text = [NSString stringWithFormat:@"CATCH tests"];
UIActionSheet* menu = [[UIActionSheet alloc] initWithTitle:@"Options"
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:@"Run all tests", nil];
[menu showInView: self];
[menu release];
}
return self;
}
///////////////////////////////////////////////////////////////////////////////
-(void) dealloc
{
[appName removeFromSuperview];
[super dealloc];
}
///////////////////////////////////////////////////////////////////////////////
-(void) actionSheet: (UIActionSheet*) sheet clickedButtonAtIndex: (NSInteger) index
{
Catch::Config config;
config.setReporter( new Catch::iTchRunnerReporter( self ) );
Catch::Runner runner( config );
config.getReporter()->StartGroup( "" );
runner.runAll( true );
config.getReporter()->EndGroup( "", runner.getSuccessCount(), runner.getFailureCount() );
if( runner.getFailureCount() == 0 )
{
NSLog( @"no failures" );
if( runner.getSuccessCount() > 0 )
appName.textColor = [[UIColor alloc] initWithRed:0.35 green:1 blue:0.35 alpha:1];
}
else
{
NSLog( @"%d failures", runner.getFailureCount() );
appName.textColor = [[UIColor alloc] initWithRed:1 green:0.35 blue:0.35 alpha:1];
}
}
///////////////////////////////////////////////////////////////////////////////
-(void) testWasRun: (const Catch::ResultInfo*) pResultInfo
{
const Catch::ResultInfo& resultInfo = *pResultInfo;
std::ostringstream oss;
if( resultInfo.hasExpression() )
{
oss << resultInfo.getExpression();
if( resultInfo.ok() )
oss << " succeeded";
else
oss << " failed";
}
switch( resultInfo.getResultType() )
{
case Catch::ResultWas::ThrewException:
if( resultInfo.hasExpression() )
oss << " with unexpected";
else
oss << "Unexpected";
oss << " exception with message: '" << resultInfo.getMessage() << "'";
break;
case Catch::ResultWas::Info:
oss << "info: '" << resultInfo.getMessage() << "'";
break;
case Catch::ResultWas::Warning:
oss << "warning: '" << resultInfo.getMessage() << "'";
break;
case Catch::ResultWas::ExplicitFailure:
oss << "failed with message: '" << resultInfo.getMessage() << "'";
break;
default:
break;
}
if( resultInfo.hasExpression() )
{
oss << " for: " << resultInfo.getExpandedExpression();
}
oss << std::endl;
NSLog( @"%s", oss.str().c_str() );
}
@end

View File

@@ -0,0 +1,105 @@
/*
* iTchRunnerReporter.h
* iTchRunner
*
* Created by Phil on 07/02/2011.
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
*
*/
#include "catch.hpp"
@protocol iTchRunnerDelegate
-(void) testWasRun: (const Catch::ResultInfo*) result;
@end
namespace Catch
{
class iTchRunnerReporter : public IReporter
{
public:
///////////////////////////////////////////////////////////////////////////
iTchRunnerReporter
(
id<iTchRunnerDelegate> delegate
)
: m_succeeded( 0 ),
m_failed( 0 ),
m_delegate( delegate )
{
}
///////////////////////////////////////////////////////////////////////////
static std::string getDescription
()
{
return "Captures results for iOS runner";
}
///////////////////////////////////////////////////////////////////////////
size_t getSucceeded
()
const
{
return m_succeeded;
}
///////////////////////////////////////////////////////////////////////////
size_t getFailed
()
const
{
return m_failed;
}
///////////////////////////////////////////////////////////////////////////
void reset()
{
m_succeeded = 0;
m_failed = 0;
}
private: // IReporter
///////////////////////////////////////////////////////////////////////////
virtual void StartTesting
()
{}
///////////////////////////////////////////////////////////////////////////
virtual void EndTesting
(
std::size_t succeeded,
std::size_t failed
)
{
m_succeeded = succeeded;
m_failed = failed;
}
///////////////////////////////////////////////////////////////////////////
virtual void Result
(
const ResultInfo& result
)
{
[m_delegate testWasRun: &result];
}
///////////////////////////////////////////////////////////////////////////
// Deliberately unimplemented:
virtual void StartGroup( const std::string& ){}
virtual void EndGroup( const std::string&, std::size_t, std::size_t ){}
virtual void StartTestCase( const TestCaseInfo& ){}
virtual void StartSection( const std::string&, const std::string ){}
virtual void EndSection( const std::string&, std::size_t, std::size_t ){}
virtual void EndTestCase( const TestCaseInfo&, std::size_t, std::size_t, const std::string&, const std::string& ){}
private:
size_t m_succeeded;
size_t m_failed;
id<iTchRunnerDelegate> m_delegate;
};
}

View File

@@ -0,0 +1,20 @@
//
// iTchRunnerMain.mm
// iTchRunner
//
// Created by Phil on 04/02/2011.
// Copyright Two Blue Cubes Ltd 2011. All rights reserved.
//
#import "internal/iTchRunnerAppDelegate.h"
#include "catch_objc.hpp"
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Catch::registerTestMethods();
int retVal = UIApplicationMain(argc, argv, nil, @"iTchRunnerAppDelegate");
[pool release];
return retVal;
}

View File

@@ -0,0 +1,6 @@
* Select Project -> New Target. Select Cocoa Touch -> Application. Click next and name it something like "Unit Tests"
* While the target info is displayed, find: 'User Header Search Paths' and add a path to the Catch folder
* Open the plist file for the target (Unit Test-Info.plist, if you used that name). Delete the entry for "Main nib file base name: MainWindow"
* From the overview drop-down select the new target.
* Add the file Catch/Runner/iTchRunnerMain.mm into your project - but only in the new target
* Write tests (adding files under test into the target as necessary)