mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 05:15:39 +02:00
Removed all manually maintained project files in favour of instructions on how to use CMake to generate them
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// 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)
|
||||
#ifndef TWOBLUECUBES_CATCHOCTESTCASE_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCHOCTESTCASE_H_INCLUDED
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "TestObj.h"
|
||||
|
||||
@interface TestFixture : NSObject <OcFixture>
|
||||
{
|
||||
TestObj* obj;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif // TWOBLUECUBES_CATCHOCTESTCASE_H_INCLUDED
|
@@ -1,83 +0,0 @@
|
||||
//
|
||||
// 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
|
||||
{
|
||||
arcSafeRelease( obj );
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
OC_TEST_CASE( "OCTest/BOOL", "tests a boolean value" )
|
||||
{
|
||||
CHECK( [obj isTrue] == NO );
|
||||
CHECK( [obj isFalse] == YES );
|
||||
}
|
||||
|
||||
OC_TEST_CASE( "OCTest/throws/objc", "throws an Objective-C exception" )
|
||||
{
|
||||
@throw [[NSException alloc] initWithName: NSGenericException
|
||||
reason: @"Objective-C exception"
|
||||
userInfo: nil];
|
||||
}
|
||||
OC_TEST_CASE( "OCTest/throws/stdc++", "throws a std c++ exception" )
|
||||
{
|
||||
throw std::domain_error( "std C++ exception" );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename T>
|
||||
void useObject( const T& object ){}
|
||||
|
||||
template<typename T>
|
||||
void useObject( const T* object ){}
|
||||
|
||||
OC_TEST_CASE( "OCTest/matchers", "Matches work with OC types (NSString so far)" )
|
||||
{
|
||||
REQUIRE_THAT( @"This is a string", Equals( @"This isnt a string" ) );
|
||||
REQUIRE_THAT( @"This is a string", Contains( @"is a" ) );
|
||||
REQUIRE_THAT( @"This is a string", StartsWith( @"This" ) );
|
||||
REQUIRE_THAT( @"This is a string", EndsWith( @"string" ) );
|
||||
}
|
||||
|
||||
OC_TEST_CASE( "OCTest/matchers/nil", "nil NSString should not crash the test" )
|
||||
{
|
||||
CHECK_THAT( (NSString*)nil, Equals( @"This should fail, but not crash" ) );
|
||||
CHECK_THAT( (NSString*)nil, StartsWith( @"anything" ) );
|
||||
}
|
||||
|
||||
@end
|
@@ -1,2 +0,0 @@
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#import "catch.hpp"
|
@@ -1,79 +0,0 @@
|
||||
.\"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 09/02/2012 \" 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
|
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 );
|
||||
|
||||
arcSafeRelease( obj );
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// 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)
|
||||
#ifndef TWOBLUECUBES_TESTOBJ_H_INCLUDED
|
||||
#define TWOBLUECUBES_TESTOBJ_H_INCLUDED
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface TestObj : NSObject {
|
||||
|
||||
int int_val;
|
||||
}
|
||||
|
||||
-(BOOL) isTrue;
|
||||
-(BOOL) isFalse;
|
||||
|
||||
@property (nonatomic, assign ) int int_val;
|
||||
|
||||
@end
|
||||
|
||||
#endif // TWOBLUECUBES_TESTOBJ_H_INCLUDED
|
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// 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;
|
||||
|
||||
-(BOOL) isTrue {
|
||||
return YES;
|
||||
}
|
||||
-(BOOL) isFalse {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user