summaryrefslogtreecommitdiff
path: root/render-test/ios/tests/Tests.m
diff options
context:
space:
mode:
authorzmiao <miao.zhao@mapbox.com>2020-01-21 23:23:35 +0200
committerGitHub <noreply@github.com>2020-01-21 23:23:35 +0200
commit1ade6c77849aec2c8486a568720258547aa1d670 (patch)
tree4c2dc4cf31f24aa6df15716265858cc6e1859fdc /render-test/ios/tests/Tests.m
parent6dc435f66465eff76e730053d80efae90fa249c5 (diff)
downloadqtlocation-mapboxgl-1ade6c77849aec2c8486a568720258547aa1d670.tar.gz
[test-runner] Enable IOS RenderTestRunner and run it on Firebase (#16111)
* [test-runner] Setup iOS RenderTestRunner * [test-runner] Make app runnable on firebase * Add iOS platform dependent expectation and ignores; Run prepare script via cmake * Make RenderTestRunner report test status
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