• Rohit Rao's avatar
    Reland "[ios] Adds the ability to run unittests using XCTest." · f9b096d8
    Rohit Rao authored
    Original change's description:
    > Revert "[ios] Adds the ability to run unittests using XCTest."
    > 
    > This reverts commit b6c231b5.
    > 
    > Reason for revert: Suspected for causing compiling errors on mac.
    > 
    > Original change's description:
    > > [ios] Adds the ability to run unittests using XCTest.
    > > 
    > > This new functionality is hidden behind both a GN arg
    > > (enable_run_ios_unittests_with_xctest) and a commandline switch
    > > (--enable-run-unittests-with-xctest), in order to default it to off
    > > until the bots are updated to properly run XCTest-based unittests.
    > > 
    > > The iOS test runner is updated to run in one of two modes.  When
    > > --enable-run-unittests-with-xctest is false (the default), behavior is
    > > unchanged; TestSuite::Run() calls UIApplicationMain(), then the
    > > UIApplicationDelegate calls TestSuite::Run() again, which actually runs
    > > the tests when invoked the second time.  When the switch is set to true,
    > > the second invocation of TestSuite::Run() is made by our XCTestCase
    > > subclass rather than by the application delegate.
    > > 
    > > Xcode provides the ability to run XCTests and XCUITests from the
    > > commandline, but does not provide any other way to install and run an
    > > app outside of this test-based workflow.  (We had an alternative that
    > > used third party libraries, but they no longer work on iOS 13.)  This
    > > makes it difficult to install and run GoogleTest-based tests on iOS
    > > devices, since they run as a single self-contained application, but it
    > > would not be practical to drop GoogleTest support on iOS.  Instead, we
    > > are exploring invoking these tests via XCTest, which would allow us to
    > > use Xcode's tooling but still run the same GoogleTest-based tests as on
    > > other platforms.
    > > 
    > > BUG=635509
    > > 
    > > Change-Id: I26c67d9c7e16a744f43a20f2d8c5839ca8b3c31a
    > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787593
    > > Reviewed-by: Dirk Pranke <dpranke@chromium.org>
    > > Reviewed-by: Mark Mentovai <mark@chromium.org>
    > > Reviewed-by: Justin Cohen <justincohen@chromium.org>
    > > Commit-Queue: Rohit Rao <rohitrao@chromium.org>
    > > Cr-Commit-Position: refs/heads/master@{#694749}
    > 
    > TBR=rohitrao@chromium.org,dpranke@chromium.org,justincohen@chromium.org,mark@chromium.org
    > 
    > Change-Id: Ic67605ab0292551500a163e993c6d93fec3048c0
    > No-Presubmit: true
    > No-Tree-Checks: true
    > No-Try: true
    > Bug: 635509,1002144
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1791798
    > Reviewed-by: Tarun Bansal <tbansal@chromium.org>
    > Commit-Queue: Tarun Bansal <tbansal@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#694814}
    
    TBR=rohitrao@chromium.org,dpranke@chromium.org,justincohen@chromium.org,tbansal@chromium.org,mark@chromium.org
    
    Change-Id: I94e59823c379e1afb4e9e965bfe602d06400e8b5
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 635509, 1002144
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1790069Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
    Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
    Commit-Queue: Rohit Rao <rohitrao@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#694950}
    f9b096d8
test_support_ios.h 763 Bytes