Skip to content

Commit

Permalink
Implemented unit testing target and basic class parsing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz committed Jul 26, 2010
1 parent 9b84f99 commit 84598f7
Show file tree
Hide file tree
Showing 138 changed files with 6,299 additions and 9 deletions.
20 changes: 20 additions & 0 deletions AppledocTests_prefix.pch
@@ -0,0 +1,20 @@
//
// AppledocTests_prefix.pch
// appledoc
//
// Created by Tomaz Kragelj on 22.7.10.
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import "NSObject+GBObject.h"
#import "NSException+GBException.h"
#import "NSFileManager+GBFileManager.h"
#import "GBLog.h"

#define HC_SHORTHAND
#import <OCHamcrest/OCHamcrest.h>
#import <OCMock/OCMock.h>
#import <SenTestingKit/SenTestingKit.h>
#endif
4 changes: 2 additions & 2 deletions Application/GBAppledocApplication.h
Expand Up @@ -8,7 +8,7 @@

#import <Foundation/Foundation.h>
#import "DDCliApplication.h"
#import "GBApplicationSettingsProvider.h"
#import "GBApplicationSettingsProviding.h"

/** The appledoc application handler.
Expand All @@ -28,6 +28,6 @@
3. Generating output: This is the final phase where we use the in-memory data to generate output. This step is driven
by `GBGenerator` class.
*/
@interface GBAppledocApplication : NSObject <GBApplicationSettingsProvider, DDCliApplicationDelegate>
@interface GBAppledocApplication : NSObject <GBApplicationSettingsProviding, DDCliApplicationDelegate>

@end
1 change: 1 addition & 0 deletions Application/GBAppledocApplication.m
Expand Up @@ -8,6 +8,7 @@

#import "DDCliUtil.h"
#import "DDGetoptLongParser.h"
#import "GBParser.h"
#import "GBAppledocApplication.h"

static NSString *kGBArgLogFormat = @"logformat";
Expand Down
@@ -1,5 +1,5 @@
//
// GBApplicationSettingsProvider.h
// GBApplicationSettingsProviding.h
// appledoc
//
// Created by Tomaz Kragelj on 23.7.10.
Expand All @@ -12,6 +12,6 @@
Application-level settings providers provide application-wide settings and properties that affect application handling.
*/
@protocol GBApplicationSettingsProvider
@protocol GBApplicationSettingsProviding

@end
1 change: 1 addition & 0 deletions Libraries/OCHamcrest.framework/Headers
1 change: 1 addition & 0 deletions Libraries/OCHamcrest.framework/OCHamcrest
1 change: 1 addition & 0 deletions Libraries/OCHamcrest.framework/Resources
52 changes: 52 additions & 0 deletions Libraries/OCHamcrest.framework/Versions/A/Headers/HCAllOf.h
@@ -0,0 +1,52 @@
//
// OCHamcrest - HCAllOf.h
// Copyright 2009 www.hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//

// Inherited
#import <OCHamcrest/HCBaseMatcher.h>


/**
Calculates the logical conjunction of multiple matchers.
Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher returns
@c NO.
*/
@interface HCAllOf : HCBaseMatcher
{
NSArray* matchers;
}

+ (HCAllOf*) allOf:(NSArray*)theMatchers;
- (id) initWithMatchers:(NSArray*)theMatchers;

@end


#ifdef __cplusplus
extern "C" {
#endif

/**
Evaluates to @c YES only if @b all of the passed in matchers evaluate to @c YES.
@param matcher Comma-separated list of matchers ending with @c nil.
*/
id<HCMatcher> HC_allOf(id<HCMatcher> matcher, ...);

#ifdef __cplusplus
}
#endif


#ifdef HC_SHORTHAND

/**
Shorthand for HC_allOf, available if HC_SHORTHAND is defined.
*/
#define allOf HC_allOf

#endif
52 changes: 52 additions & 0 deletions Libraries/OCHamcrest.framework/Versions/A/Headers/HCAnyOf.h
@@ -0,0 +1,52 @@
//
// OCHamcrest - HCAnyOf.h
// Copyright 2009 www.hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//

// Inherited
#import <OCHamcrest/HCBaseMatcher.h>


/**
Calculates the logical disjunction of multiple matchers.
Evaluation is shortcut, so the subsequent matchers are not called if an earlier matcher returns
@c YES.
*/
@interface HCAnyOf : HCBaseMatcher
{
NSArray* matchers;
}

+ (HCAnyOf*) anyOf:(NSArray*)theMatchers;
- (id) initWithMatchers:(NSArray*)theMatchers;

@end


#ifdef __cplusplus
extern "C" {
#endif

/**
Evaluates to @c YES if @b any of the passed in matchers evaluate to @c YES.
@param matcher Comma-separated list of matchers ending with @c nil.
*/
id<HCMatcher> HC_anyOf(id<HCMatcher> matcher, ...);

#ifdef __cplusplus
}
#endif


#ifdef HC_SHORTHAND

/**
Shorthand for HC_anyOf, available if HC_SHORTHAND is defined.
*/
#define anyOf HC_anyOf

#endif
@@ -0,0 +1,30 @@
//
// OCHamcrest - HCBaseDescription.h
// Copyright 2009 www.hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//

// Inherited
#import <Foundation/Foundation.h>
#import <OCHamcrest/HCDescription.h>


/**
Base class for all HCDescription implementations.
*/
@interface HCBaseDescription : NSObject<HCDescription>
@end


/**
Methods that must be provided by subclasses of HCBaseDescription.
*/
@interface HCBaseDescription (SubclassMustImplement)

/**
Append the string @a str to the description.
*/
- (void) append:(NSString*)str;

@end
21 changes: 21 additions & 0 deletions Libraries/OCHamcrest.framework/Versions/A/Headers/HCBaseMatcher.h
@@ -0,0 +1,21 @@
//
// OCHamcrest - HCBaseMatcher.h
// Copyright 2009 www.hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//

// Inherited
#import <Foundation/Foundation.h>
#import <OCHamcrest/HCMatcher.h>


/**
Base class for all Matcher implementations.
Most implementations can just implement matches: and let matches:describingMismatchTo: call
it. But if it makes more sense to generate the mismatch description during the matching,
override matches:describingMismatchTo: and have matches: call it with a nil description.
*/
@interface HCBaseMatcher : NSObject<HCMatcher>
@end
87 changes: 87 additions & 0 deletions Libraries/OCHamcrest.framework/Versions/A/Headers/HCBoxNumber.h
@@ -0,0 +1,87 @@
//
// OCHamcrest - HCBoxNumber.h
// Copyright 2009 www.hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//

#ifdef __cplusplus

namespace hamcrest {

/**
Boxes scalar value in NSNumber, specialized per type.
*/
template <typename T>
inline
NSNumber* boxNumber(T value)
{ return nil; }

template <>
inline
NSNumber* boxNumber(BOOL value)
{ return [NSNumber numberWithBool:value]; }

template <>
inline
NSNumber* boxNumber(char value)
{ return [NSNumber numberWithChar:value]; }

template <>
inline
NSNumber* boxNumber(double value)
{ return [NSNumber numberWithDouble:value]; }

template <>
inline
NSNumber* boxNumber(float value)
{ return [NSNumber numberWithFloat:value]; }

template <>
inline
NSNumber* boxNumber(int value)
{ return [NSNumber numberWithInt:value]; }

template <>
inline
NSNumber* boxNumber(long value)
{ return [NSNumber numberWithLong:value]; }

template <>
inline
NSNumber* boxNumber(long long value)
{ return [NSNumber numberWithLongLong:value]; }

template <>
inline
NSNumber* boxNumber(short value)
{ return [NSNumber numberWithShort:value]; }

template <>
inline
NSNumber* boxNumber(unsigned char value)
{ return [NSNumber numberWithUnsignedChar:value]; }

template <>
inline
NSNumber* boxNumber(unsigned int value)
{ return [NSNumber numberWithUnsignedInt:value]; }

template <>
inline
NSNumber* boxNumber(unsigned long value)
{ return [NSNumber numberWithUnsignedLong:value]; }

template <>
inline
NSNumber* boxNumber(unsigned long long value)
{ return [NSNumber numberWithUnsignedLongLong:value]; }

template <>
inline
NSNumber* boxNumber(unsigned short value)
{ return [NSNumber numberWithUnsignedShort:value]; }

} // namespace hamcrest

#endif // __cplusplus
56 changes: 56 additions & 0 deletions Libraries/OCHamcrest.framework/Versions/A/Headers/HCDescribedAs.h
@@ -0,0 +1,56 @@
//
// OCHamcrest - HCDescribedAs.h
// Copyright 2009 www.hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//

// Inherited
#import <OCHamcrest/HCBaseMatcher.h>


/**
Provides a custom description to another matcher.
*/
@interface HCDescribedAs : HCBaseMatcher
{
NSString* descriptionTemplate;
id<HCMatcher> matcher;
NSArray* values;
}

+ (HCDescribedAs*) describedAs:(NSString*)description
forMatcher:(id<HCMatcher>)aMatcher
overValues:(NSArray*)templateValues;
- (id) initWithDescription:(NSString*)description
forMatcher:(id<HCMatcher>)aMatcher
overValues:(NSArray*)templateValues;

@end


#ifdef __cplusplus
extern "C" {
#endif

/**
Wraps an existing matcher and overrides the description when it fails.
Optional values following the matcher are substituted for \%0, \%1, etc.
The last argument must be nil.
*/
id<HCMatcher> HC_describedAs(NSString* description, id<HCMatcher> matcher, ...);

#ifdef __cplusplus
}
#endif


#ifdef HC_SHORTHAND

/**
Shorthand for HC_describedAs, available if HC_SHORTHAND is defined.
*/
#define describedAs HC_describedAs

#endif

0 comments on commit 84598f7

Please sign in to comment.