Commit e08696ae authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Removes DCHECKs from GoogleTestRunner.

DCHECKs crash the running XCTest without producing any useful log
output.  Instead, switch to XCTAssertTrue() so that an error message
will be displayed when bots are misconfigured.

BUG=1002739

Change-Id: If902ea15e2b89090fcd355ad7bfb04828e71561a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1799082
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695773}
parent 63e3af96
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#include "base/logging.h"
#import "base/test/ios/google_test_runner_delegate.h" #import "base/test/ios/google_test_runner_delegate.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -18,12 +17,15 @@ ...@@ -18,12 +17,15 @@
@implementation GoogleTestRunner @implementation GoogleTestRunner
- (void)testRunGoogleTests { - (void)testRunGoogleTests {
self.continueAfterFailure = false;
id appDelegate = UIApplication.sharedApplication.delegate; id appDelegate = UIApplication.sharedApplication.delegate;
DCHECK([appDelegate conformsToProtocol:@protocol(GoogleTestRunnerDelegate)]); XCTAssertTrue(
[appDelegate conformsToProtocol:@protocol(GoogleTestRunnerDelegate)]);
id<GoogleTestRunnerDelegate> runnerDelegate = id<GoogleTestRunnerDelegate> runnerDelegate =
static_cast<id<GoogleTestRunnerDelegate>>(appDelegate); static_cast<id<GoogleTestRunnerDelegate>>(appDelegate);
DCHECK(runnerDelegate.supportsRunningGoogleTests); XCTAssertTrue(runnerDelegate.supportsRunningGoogleTests);
XCTAssertTrue([runnerDelegate runGoogleTests] == 0); XCTAssertTrue([runnerDelegate runGoogleTests] == 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment