File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,27 @@ @interface GoogleTests : XCTestCase
82
82
return nil ;
83
83
}
84
84
85
- id config = [NSKeyedUnarchiver unarchiveObjectWithFile: filePath];
85
+ id config;
86
+ NSError * error;
87
+ if (@available (macOS 10.13 , iOS 11 , tvOS 11 , *)) {
88
+ NSData * data = [NSData dataWithContentsOfFile: filePath
89
+ options: kNilOptions
90
+ error: &error];
91
+ if (!data) {
92
+ NSLog (@" Failed to fill data with contents of file. %@ " , error);
93
+ return nil ;
94
+ }
95
+
96
+ config = [NSKeyedUnarchiver unarchivedObjectOfClass: NSObject .class
97
+ fromData:data
98
+ error:&error];
99
+ } else {
100
+ config = [NSKeyedUnarchiver unarchiveObjectWithFile: filePath];
101
+ }
102
+
86
103
if (!config) {
87
- NSLog (@" Failed to load any configuaration from %@ =%@ " , configEnvVar,
88
- filePath);
104
+ NSLog (@" Failed to load any configuaration from %@ =%@ . %@ " , configEnvVar,
105
+ filePath, error );
89
106
return nil ;
90
107
}
91
108
@@ -214,6 +231,13 @@ void XCTestMethod(XCTestCase* self, SEL _cmd) {
214
231
// Let XCode know that the test ran and succeeded.
215
232
XCTAssertTrue (true );
216
233
return ;
234
+ } else if (result->Skipped ()) {
235
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130400 || \
236
+ __TV_OS_VERSION_MAX_ALLOWED >= 130400 || \
237
+ __MAC_OS_X_VERSION_MAX_ALLOWED >= 101504
238
+ // Let XCode know that the test was skipped.
239
+ XCTSkip ();
240
+ #endif
217
241
}
218
242
219
243
// Test failed :-(. Record the failure such that XCode will navigate directly
You can’t perform that action at this time.
0 commit comments