PageRenderTime 52ms CodeModel.GetById 40ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/GHUnitIOS.framework/Versions/A/Headers/GHTestSuite.h

http://github.com/zwaldowski/BlocksKit
C++ Header | 118 lines | 13 code | 16 blank | 89 comment | 0 complexity | 30febeed831a02745b8e07b3eeccf131 MD5 | raw file
  1//
  2//  GHTestSuite.h
  3//  GHUnit
  4//
  5//  Created by Gabriel Handford on 1/25/09.
  6//  Copyright 2009. All rights reserved.
  7//
  8//  Permission is hereby granted, free of charge, to any person
  9//  obtaining a copy of this software and associated documentation
 10//  files (the "Software"), to deal in the Software without
 11//  restriction, including without limitation the rights to use,
 12//  copy, modify, merge, publish, distribute, sublicense, and/or sell
 13//  copies of the Software, and to permit persons to whom the
 14//  Software is furnished to do so, subject to the following
 15//  conditions:
 16//
 17//  The above copyright notice and this permission notice shall be
 18//  included in all copies or substantial portions of the Software.
 19//
 20//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 21//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 22//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 23//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 25//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 26//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 27//  OTHER DEALINGS IN THE SOFTWARE.
 28//
 29
 30//! @cond DEV
 31
 32#import "GHTestGroup.h"
 33
 34/*!
 35 If set, will run it as a "test filter" like the env variable TEST.
 36 */
 37extern NSString *GHUnitTest;
 38
 39
 40/*!
 41 Test suite is an alias for test group.
 42 
 43 A test case is an instance of a test case class with test methods.
 44 A test is a id<GHTest> which represents a target and a selector.
 45 A test group is a collection of tests; A collection of id<GHTest> (GHTest or GHTestGroup).
 46 
 47 For example, if you have 2 test cases, GHTestCase1 (with some test methods) and GHTestCase2 (with some test methods), 
 48 your test suite might look like:
 49 
 50"Tests" (GHTestSuite)
 51  GHTestGroup (collection of tests from GHTestCase1)
 52    - (void)testA1 (GHTest with target GHTestCase1 + testA1)
 53    - (void)testA2 (GHTest with target GHTestCase1 + testA2)
 54  GHTestGroup (collection of tests from GHTestCase2)
 55    - (void)testB1; (GHTest with target GHTestCase2 + testB1)
 56    - (void)testB2; (GHTest with target GHTestCase2 + testB2)  
 57 
 58 */
 59@interface GHTestSuite : GHTestGroup { }
 60
 61/*! 
 62 Create test suite with test cases.
 63 @param name Label to give the suite
 64 @param testCases Array of init'ed test case classes
 65 @param delegate
 66 */
 67- (id)initWithName:(NSString *)name testCases:(NSArray *)testCases delegate:(id<GHTestDelegate>)delegate;
 68
 69/*!
 70 Creates a suite of all tests.
 71 Will load all classes that subclass from GHTestCase, SenTestCase or GTMTestCase (or register test case class).
 72 @result Suite
 73 */
 74+ (GHTestSuite *)allTests;
 75
 76/*!
 77 Create suite of tests with filter.
 78 This is useful for running a single test or all tests in a single test case.
 79 
 80 For example,
 81 'GHSlowTest' -- Runs all test method in GHSlowTest
 82 'GHSlowTest/testSlowA -- Only runs the test method testSlowA in GHSlowTest
 83 
 84 @param testFilter Test filter
 85 @result Suite
 86 */
 87+ (GHTestSuite *)suiteWithTestFilter:(NSString *)testFilter;
 88
 89/*!
 90 Create suite of tests that start with prefix.
 91 @param prefix If test case class starts with the prefix; If nil or empty string, returns all tests
 92 @param options Compare options
 93 */
 94+ (GHTestSuite *)suiteWithPrefix:(NSString *)prefix options:(NSStringCompareOptions)options;
 95
 96/*!
 97 Suite for a single test/method.
 98 @param testCaseClass
 99 @param method
100 @result Suite
101 */
102+ (GHTestSuite *)suiteWithTestCaseClass:(Class)testCaseClass method:(SEL)method;
103
104/*!
105 Return test suite based on environment (TEST=TestFoo/foo)
106 @result Suite
107 */
108+ (GHTestSuite *)suiteFromEnv;
109
110@end
111
112@interface GHTestSuite (JUnitXML)
113
114- (BOOL)writeJUnitXML:(NSError **)error;
115
116@end
117
118//! @endcond