Run specific test from ios_chrome_ui_egtests (something like gtest_filter)

61 views
Skip to first unread message

vita...@google.com

unread,
Jun 25, 2018, 5:21:10 AM6/25/18
to Chromium-dev
How to run a specific test from ios_chrome_ui_egtests?

I tried 

out/Debug-iphonesimulator/iossim \
-c "--gtest_filter=SigninInteractionControllerTestCase.*" \

and it just runs all tests.

Sylvain Defresne

unread,
Jun 25, 2018, 8:08:46 AM6/25/18
to Vitalii Iarko, Chromium-dev
--gtest_filter does not work with earl grey tests as they are not based on gtest.

As they are based on XCUITests, they integrate nicely with Xcode test runner, so they easiest way to run a selected test is to generate Xcode project ("gn gen --ide=xcode --filters=//ios/chrome/* out/Debug-iphonesimulator"), open the Xcode project ("open out/Debug-iphonesimulator/all.xcworkspace"). Then in Xcode, select the test app you want to run, and in the Test navigator (the icon looks like a tilted square with a dash inside), select the test/test suite you want to run and click on the small arrow on its right.

Note that if you use src/ios/build/tools/setup-gn.py, then an Xcode project is already created in out/build/all.xcworkspace.
-- Sylvain

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/7a49ade6-dd66-4da9-a834-8ed5591dbfb1%40chromium.org.

Dirk Pranke

unread,
Jun 26, 2018, 3:47:54 PM6/26/18
to Sylvain Defresne, Vitalii Iarko, Chromium-dev
Is there a programmatic (i.e., command-line) way to specify the list of tests to run, rather than running them from the IDE? 

Sylvain Defresne

unread,
Jun 27, 2018, 6:30:56 AM6/27/18
to Dirk Pranke, Vitalii Iarko, Chromium-dev
Not that I know of. 
-- Sylvain

Yuke Liao

unread,
Jun 27, 2018, 7:52:34 AM6/27/18
to sdef...@chromium.org, Dirk Pranke, Vitalii Iarko, Chromium-dev
I think you can do:

out/Debug-iphonesimulator/iossim \
-t SigninInteractionControllerTestCase \

iossim is poorly documented, not sure if this is the exact command to use, but -t is the argument that allows you to run specific test (suite).

Olivier Robin

unread,
Jun 27, 2018, 8:11:30 AM6/27/18
to Yuke Liao, Sylvain Defresne, dpr...@chromium.org, Vitalii Iarko, Chromium-dev
To run a single test, you can use
out/Debug-iphonesimulator/iossim \
-t "SigninInteractionControllerTestCase/testName" \



To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEfVu_LqEhWxVTr6_Czsh0ngn0NXb3ATHiny6VYty1CKpj7s8Q%40mail.gmail.com.

Nico Weber

unread,
Jun 27, 2018, 8:15:15 AM6/27/18
to Sylvain Defresne, Dirk Pranke, vita...@google.com, Chromium-dev
Is there any reason these tests can't use gtest, which everyone is already familiar with?

Reply all
Reply to author
Forward
0 new messages