summaryrefslogtreecommitdiff
path: root/render-test/ios/tests
diff options
context:
space:
mode:
Diffstat (limited to 'render-test/ios/tests')
-rw-r--r--render-test/ios/tests/Info.plist22
-rw-r--r--render-test/ios/tests/Tests.m38
2 files changed, 60 insertions, 0 deletions
diff --git a/render-test/ios/tests/Info.plist b/render-test/ios/tests/Info.plist
new file mode 100644
index 0000000000..aa599858d6
--- /dev/null
+++ b/render-test/ios/tests/Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>RenderTestAppTests</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.mapbox.RenderTestAppTests</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>1.0</string>
+ <key>CFBundleName</key>
+ <string>RenderTestAppTests</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
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