summaryrefslogtreecommitdiff
path: root/render-test/ios/tests/Tests.m
diff options
context:
space:
mode:
Diffstat (limited to 'render-test/ios/tests/Tests.m')
-rw-r--r--render-test/ios/tests/Tests.m38
1 files changed, 38 insertions, 0 deletions
diff --git a/render-test/ios/tests/Tests.m b/render-test/ios/tests/Tests.m
new file mode 100644
index 0000000000..5dd52a7fa3
--- /dev/null
+++ b/render-test/ios/tests/Tests.m
@@ -0,0 +1,38 @@
+#import <XCTest/XCTest.h>
+#import "iosTestRunner.h"
+@interface Tests : XCTestCase
+
+@end
+
+@implementation Tests
+
+- (void)setUp {
+ [super setUp];
+}
+
+- (void)tearDown {
+ [super tearDown];
+}
+
+- (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");
+
+ 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 success = [runner getTestStatus];
+ XCTAssert(success, @"IOSTestRunner reports error because some of the tests are not passed, please check the test report");
+}
+
+@end