diff options
Diffstat (limited to 'render-test/ios/tests/Tests.m')
-rw-r--r-- | render-test/ios/tests/Tests.m | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/render-test/ios/tests/Tests.m b/render-test/ios/tests/Tests.m index 5dd52a7fa3..c8fef0fa8a 100644 --- a/render-test/ios/tests/Tests.m +++ b/render-test/ios/tests/Tests.m @@ -17,19 +17,28 @@ - (void)testStartRenderTestRunner { IosTestRunner* runner = [[IosTestRunner alloc] init]; XCTAssert(runner, @"IOSTestRunner is not initialized correctly"); - - NSString* result = [runner getResultPath]; - XCTAssert(result, @"IOSTestRunner does not produce a result file"); + NSString* styleResult = [runner getStyleResultPath]; + XCTAssert(styleResult, @"IOSTestRunner does not produce a style test result file"); + NSString* metricResult = [runner getMetricResultPath]; + XCTAssert(metricResult, @"IOSTestRunner does not produce a metric test result file"); + NSFileManager *fileManager = [NSFileManager defaultManager]; - BOOL fileFound = [fileManager fileExistsAtPath: result]; - XCTAssert(fileFound, @"Test result html '%@' doese not exit", result); - - NSURL *url = [NSURL fileURLWithPath:result]; - XCTAttachment *attachmentURL = [XCTAttachment attachmentWithContentsOfFileAtURL: url]; - XCTAssert(attachmentURL, @"Failed to attach test result '%@'", result); - attachmentURL.lifetime = XCTAttachmentLifetimeKeepAlways; - [self addAttachment:attachmentURL]; + BOOL fileFound = [fileManager fileExistsAtPath: styleResult]; + XCTAssert(fileFound, @"Test result html '%@' doese not exit", styleResult); + NSURL *styleURL = [NSURL fileURLWithPath:styleResult]; + XCTAttachment *attachment1URL = [XCTAttachment attachmentWithContentsOfFileAtURL: styleURL]; + XCTAssert(attachment1URL, @"Failed to attach test result '%@'", styleResult); + attachment1URL.lifetime = XCTAttachmentLifetimeKeepAlways; + [self addAttachment:attachment1URL]; + + fileFound = [fileManager fileExistsAtPath: metricResult]; + XCTAssert(fileFound, @"Test result html '%@' doese not exit", metricResult); + NSURL *metricURL = [NSURL fileURLWithPath:metricResult]; + XCTAttachment *attachment2URL = [XCTAttachment attachmentWithContentsOfFileAtURL: metricURL]; + XCTAssert(attachment2URL, @"Failed to attach test result '%@'", metricResult); + attachment2URL.lifetime = XCTAttachmentLifetimeKeepAlways; + [self addAttachment:attachment2URL]; BOOL success = [runner getTestStatus]; XCTAssert(success, @"IOSTestRunner reports error because some of the tests are not passed, please check the test report"); |