File size: 1,483 Bytes
608ec36 | 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 | // Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "IntegrationTestIosTest.h"
#import "IntegrationTestPlugin.h"
#import "FLTIntegrationTestRunner.h"
#pragma mark - Deprecated
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
@implementation IntegrationTestIosTest
- (BOOL)testIntegrationTest:(NSString **)testResult {
NSLog(@"==================== Test Results =====================");
NSMutableArray<NSString *> *failedTests = [NSMutableArray array];
NSMutableArray<NSString *> *testNames = [NSMutableArray array];
[[FLTIntegrationTestRunner new] testIntegrationTestWithResults:^(SEL testSelector, BOOL success, NSString *message) {
NSString *testName = NSStringFromSelector(testSelector);
[testNames addObject:testName];
if (success) {
NSLog(@"%@ passed.", testName);
} else {
NSLog(@"%@ failed: %@", testName, message);
[failedTests addObject:testName];
}
}];
NSLog(@"================== Test Results End ====================");
BOOL testPass = failedTests.count == 0;
if (!testPass && testResult != NULL) {
*testResult =
[NSString stringWithFormat:@"Detected failed integration test(s) %@ among %@",
failedTests.description, testNames.description];
}
return testPass;
}
@end
#pragma clang diagnostic pop
|