diff options
author | zmiao <miao.zhao@mapbox.com> | 2020-01-21 23:23:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 23:23:35 +0200 |
commit | 1ade6c77849aec2c8486a568720258547aa1d670 (patch) | |
tree | 4c2dc4cf31f24aa6df15716265858cc6e1859fdc /render-test/ios/tests | |
parent | 6dc435f66465eff76e730053d80efae90fa249c5 (diff) | |
download | qtlocation-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')
-rw-r--r-- | render-test/ios/tests/Info.plist | 22 | ||||
-rw-r--r-- | render-test/ios/tests/Tests.m | 38 |
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 |