diff options
author | Artem Pavlenko <artem@mapnik.org> | 2020-02-14 16:56:46 +0000 |
---|---|---|
committer | Artem Pavlenko <artem@mapnik.org> | 2020-02-14 16:56:46 +0000 |
commit | 145c053a02d918d74002ea690dac398ee588a374 (patch) | |
tree | c645ffaec12822f0668858181248cd7365fc4e20 /platform/ios/test/common/Tests.m | |
parent | 37a4660ca367f141b9e0dedf3932c74f0ee0c920 (diff) | |
parent | 59294aaef333bdd455bd13d6bab6fca730379b52 (diff) | |
download | qtlocation-mapboxgl-upstream/galinelle_setStyle++_updated.tar.gz |
Merge branch 'master' into galinelle_setStyle++_updatedupstream/galinelle_setStyle++_updated
Diffstat (limited to 'platform/ios/test/common/Tests.m')
-rw-r--r-- | platform/ios/test/common/Tests.m | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/platform/ios/test/common/Tests.m b/platform/ios/test/common/Tests.m new file mode 100644 index 0000000000..8d0719705a --- /dev/null +++ b/platform/ios/test/common/Tests.m @@ -0,0 +1,37 @@ +#import <XCTest/XCTest.h> +#import "iosTestRunner.h" +@interface Tests : XCTestCase + +@end + +@implementation Tests + +- (void)setUp { + [super setUp]; +} + +- (void)tearDown { + [super tearDown]; +} + +- (void)testStartTestRunner { + IosTestRunner* runner = [[IosTestRunner alloc] init]; + XCTAssert(runner, @"IOSTestRunner is not initialized correctly"); + + NSString* testResult = [runner getResultPath]; + XCTAssert(testResult, @"IOSTestRunner did not produce a test result file"); + + NSFileManager *fileManager = [NSFileManager defaultManager]; + BOOL fileFound = [fileManager fileExistsAtPath: testResult]; + XCTAssert(fileFound, @"Test result file '%@' does not exit", testResult); + NSURL *resultURL = [NSURL fileURLWithPath:testResult]; + XCTAttachment *attachment1URL = [XCTAttachment attachmentWithContentsOfFileAtURL: resultURL]; + XCTAssert(attachment1URL, @"Failed to attach test result '%@'", testResult); + attachment1URL.lifetime = XCTAttachmentLifetimeKeepAlways; + [self addAttachment:attachment1URL]; + + BOOL success = [runner getTestStatus]; + XCTAssert(success, @"IOSTestRunner reports error because some of the tests are not passed, please check the test report"); +} + +@end |