-
Notifications
You must be signed in to change notification settings - Fork 432
/
FBXCTestContext.h
70 lines (52 loc) · 1.73 KB
/
FBXCTestContext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import <FBControlCore/FBControlCore.h>
NS_ASSUME_NONNULL_BEGIN
@class FBSimulator;
@class FBXCTestCommandLine;
@class FBXCTestLogger;
@protocol FBXCTestReporter;
@protocol FBXCTestReporterWithFiles;
/**
Context for the Test Run.
Separate from configuration as these properties are not serializable.
*/
@interface FBXCTestContext : NSObject
#pragma mark Initializers
/**
The Context for a Test Run.
If a Simulator is required, it will be created or fetched.
@param reporter the reporter to report to.
@param logger the logger to log with.
@return a new context.
*/
+ (instancetype)contextWithReporter:(nullable id<FBXCTestReporter,FBXCTestReporterWithFiles>)reporter logger:(nullable FBXCTestLogger *)logger;
#pragma mark Properties
/**
The Logger to log to.
*/
@property (nonatomic, strong, readonly, nullable) FBXCTestLogger *logger;
/**
The Reporter to report to.
*/
@property (nonatomic, strong, readonly, nullable) id<FBXCTestReporter,FBXCTestReporterWithFiles> reporter;
#pragma mark Public Methods
/**
Obtains the Simulator for an iOS Test Run.
@param commmandLine the configuration to use.
@return A future that wraps the Simulator;.
*/
- (FBFuture<FBSimulator *> *)simulatorForCommandLine:(FBXCTestCommandLine *)commmandLine;
/**
Causes the Simulator to be released from the test run.
@param simulator the Simulator to release.
@return a future that resolves when the simulator has been freed.
*/
- (FBFuture<NSNull *> *)finishedExecutionOnSimulator:(FBSimulator *)simulator;
@end
NS_ASSUME_NONNULL_END