forked from nolanw/HTMLReader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTMLTestUtilities.m
More file actions
33 lines (27 loc) · 1.01 KB
/
Copy pathHTMLTestUtilities.m
File metadata and controls
33 lines (27 loc) · 1.01 KB
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
// HTMLTestUtilities.m
//
// Public domain. https://github.com/nolanw/HTMLReader
#import "HTMLTestUtilities.h"
NSString * html5libTestPath(void)
{
#define STRINGIFY_EXPAND(a) #a
#define STRINGIFY(a) @STRINGIFY_EXPAND(a)
return STRINGIFY(HTML5LIBTESTPATH);
}
BOOL ShouldRunTestsForParameterizedTestClass(Class class)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSString *scope = [defaults stringForKey:XCTestScopeKey];
if ([scope isEqualToString:XCTestScopeAll] || [scope isEqualToString:XCTestScopeSelf]) {
return YES;
} else if ([scope isEqualToString:XCTestScopeNone]) {
return NO;
} else {
NSArray *tests = [scope componentsSeparatedByString:@","];
BOOL invertScope = [defaults boolForKey:@"XCTestInvertScope"];
return [tests containsObject:NSStringFromClass(class)] != invertScope;
}
#pragma clang diagnostic pop
}