From 6d815401b10aaf7facba5f0676931a9908c1ba5b Mon Sep 17 00:00:00 2001 From: Juha Alanen Date: Thu, 13 Feb 2020 14:12:44 +0200 Subject: [test-runner] Share common code between iOS test runners --- test/ios/AppDelegate.h | 7 ------- test/ios/AppDelegate.m | 38 -------------------------------------- test/ios/Gemfile | 3 --- test/ios/LaunchScreen.storyboard | 27 --------------------------- test/ios/Main.storyboard | 27 --------------------------- test/ios/ViewController.h | 6 ------ test/ios/ViewController.m | 22 ---------------------- test/ios/iosTestRunner.mm | 2 +- test/ios/ios_test_runner.cpp | 2 +- test/ios/ios_test_runner.hpp | 14 -------------- test/ios/main.m | 9 --------- test/ios/tests/Tests.m | 37 ------------------------------------- 12 files changed, 2 insertions(+), 192 deletions(-) delete mode 100644 test/ios/AppDelegate.h delete mode 100644 test/ios/AppDelegate.m delete mode 100644 test/ios/Gemfile delete mode 100644 test/ios/LaunchScreen.storyboard delete mode 100644 test/ios/Main.storyboard delete mode 100644 test/ios/ViewController.h delete mode 100644 test/ios/ViewController.m delete mode 100644 test/ios/ios_test_runner.hpp delete mode 100644 test/ios/main.m delete mode 100644 test/ios/tests/Tests.m (limited to 'test') diff --git a/test/ios/AppDelegate.h b/test/ios/AppDelegate.h deleted file mode 100644 index 134c8063dc..0000000000 --- a/test/ios/AppDelegate.h +++ /dev/null @@ -1,7 +0,0 @@ -#import // UIApplicationDelegate - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end \ No newline at end of file diff --git a/test/ios/AppDelegate.m b/test/ios/AppDelegate.m deleted file mode 100644 index 874d18de2a..0000000000 --- a/test/ios/AppDelegate.m +++ /dev/null @@ -1,38 +0,0 @@ -#import "AppDelegate.h" - -@interface AppDelegate() - -@end - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Insert code here to initialize your application - NSLog(@"didFinishLaunchingWithOptions"); - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - - -@end diff --git a/test/ios/Gemfile b/test/ios/Gemfile deleted file mode 100644 index adc90d98cf..0000000000 --- a/test/ios/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" \ No newline at end of file diff --git a/test/ios/LaunchScreen.storyboard b/test/ios/LaunchScreen.storyboard deleted file mode 100644 index c9b7564332..0000000000 --- a/test/ios/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ios/Main.storyboard b/test/ios/Main.storyboard deleted file mode 100644 index 34d4c7e2ec..0000000000 --- a/test/ios/Main.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ios/ViewController.h b/test/ios/ViewController.h deleted file mode 100644 index 9c7dfc57ec..0000000000 --- a/test/ios/ViewController.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - -@interface ViewController : UIViewController - -@end - diff --git a/test/ios/ViewController.m b/test/ios/ViewController.m deleted file mode 100644 index e9c526122a..0000000000 --- a/test/ios/ViewController.m +++ /dev/null @@ -1,22 +0,0 @@ -#import "ViewController.h" -#import "iosTestRunner.h" - -@interface ViewController () -{ - IosTestRunner* i; -} -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; -// In order to run test runner with app itself instead of with unit test, comment out the following line. -// i = [[IosTestRunner alloc]init]; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - -@end diff --git a/test/ios/iosTestRunner.mm b/test/ios/iosTestRunner.mm index 383b9036ec..d3f6113a05 100644 --- a/test/ios/iosTestRunner.mm +++ b/test/ios/iosTestRunner.mm @@ -1,6 +1,6 @@ #import "iosTestRunner.h" -#include "ios_test_runner.hpp" +#include #include diff --git a/test/ios/ios_test_runner.cpp b/test/ios/ios_test_runner.cpp index 293a2955b5..c99d8c3f30 100644 --- a/test/ios/ios_test_runner.cpp +++ b/test/ios/ios_test_runner.cpp @@ -1,4 +1,4 @@ -#include "ios_test_runner.hpp" +#include #include diff --git a/test/ios/ios_test_runner.hpp b/test/ios/ios_test_runner.hpp deleted file mode 100644 index 3edae22828..0000000000 --- a/test/ios/ios_test_runner.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef ios_test_runner_hpp -#define ios_test_runner_hpp - -#include - -class TestRunner { -public: - TestRunner() = default; - ~TestRunner() = default; - - bool startTest(const std::string& basePath); -}; - -#endif /* ios_test_runner_hpp */ diff --git a/test/ios/main.m b/test/ios/main.m deleted file mode 100644 index f813c8fea9..0000000000 --- a/test/ios/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/test/ios/tests/Tests.m b/test/ios/tests/Tests.m deleted file mode 100644 index 4c2131d61c..0000000000 --- a/test/ios/tests/Tests.m +++ /dev/null @@ -1,37 +0,0 @@ -#import -#import "iosTestRunner.h" -@interface Tests : XCTestCase - -@end - -@implementation Tests - -- (void)setUp { - [super setUp]; -} - -- (void)tearDown { - [super tearDown]; -} - -- (void)testStartUnitTestRunner { - 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 -- cgit v1.2.1