google_test_runner.mm 914 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #import <UIKit/UIKit.h>
  5. #import <XCTest/XCTest.h>
  6. #import "base/test/ios/google_test_runner_delegate.h"
  7. #if !defined(__has_feature) || !__has_feature(objc_arc)
  8. #error "This file requires ARC support."
  9. #endif
  10. @interface GoogleTestRunner : XCTestCase
  11. @end
  12. @implementation GoogleTestRunner
  13. - (void)testRunGoogleTests {
  14. self.continueAfterFailure = false;
  15. id appDelegate = UIApplication.sharedApplication.delegate;
  16. XCTAssertTrue(
  17. [appDelegate conformsToProtocol:@protocol(GoogleTestRunnerDelegate)]);
  18. id<GoogleTestRunnerDelegate> runnerDelegate =
  19. static_cast<id<GoogleTestRunnerDelegate>>(appDelegate);
  20. XCTAssertTrue(runnerDelegate.supportsRunningGoogleTests);
  21. XCTAssertTrue([runnerDelegate runGoogleTests] == 0);
  22. }
  23. @end