Quick way to find and run tests

99 views
Skip to first unread message

Lutz

unread,
Aug 17, 2016, 9:38:23 AM8/17/16
to Chromium-dev
Hey devs,

When I make a code change, I regularly run all unit tests that I
touched to make sure things still work properly. However, I don't know
a quick way to do that. It feels very awkward to figure out all build
targets that I have to build and run. Right now, I'm using this
procedure:

- Code search for some_unittest.cc to find corresponding BUILD.gn.
- In BUILD.gn, figure out which target contains the unit test.
- Compile that target.
- Run that target.
- Iterate until test works.

It would be nice if there was a way to automate this process, e.g. a
shell script

run_my_test SomeTest.Name SomeOtherTest.Name ...

Is there something like this? Ideally the script could also figure out
what unit tests my local changes touch and run all related tests. I
know there's git cl try, but the iteration times are very high.

Thanks!

Dirk Pranke

unread,
Aug 17, 2016, 12:23:53 PM8/17/16
to lju...@chromium.org, Chromium-dev
There isn't something already written, but given the introspection that GN can provide,
it wouldn't be too hard to write something; it's quite similar to what `analyze` does on
the builders in `git cl try`.

Of course, you would only get test coverage in your local machine and configuration,
and would still want `git cl try` for completeness, but I agree that the iteration time will
be higher.

-- Dirk

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Reply all
Reply to author
Forward
0 new messages