New test suite

0 views
Skip to first unread message

Anton Gerasimov

unread,
Mar 19, 2021, 3:32:10 AM3/19/21
to ecosyst...@chromium.org
Hello,
 
Could you please provide a sort of «step by step» (or any docs) how to create a new test suite (with a single test) in the Chromium project?
 
Thank you,
Anton
 
--
 

Stephen Mcgruer

unread,
Mar 19, 2021, 7:26:21 AM3/19/21
to Anton Gerasimov, ecosystem-infra
Hi Anton,

Thanks for your email. The answer depends on what kind of test suite you are looking to create. The Chromium project has many forms of tests, covering everything from unittests, to end-to-end integration tests, to performance testing.

A good place to start would be this documentation, which lays out the types of tests in Chromium. If you can read that and give some indication as to what test type might fit your case, we can either help you directly or find some folks to loop who can help :)

Thanks,
Stephen

--
You received this message because you are subscribed to the Google Groups "ecosystem-infra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ecosystem-inf...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/ecosystem-infra/1616139127.682517152%40f393.i.mail.ru.

Anton Gerasimov

unread,
Mar 19, 2021, 7:42:54 AM3/19/21
to Stephen Mcgruer, ecosystem-infra
Hi Stephen,
Thanks for a reply.
 
I just wanted to start from a single unit test (changing it, etc.) but rebuilding the unit_tests.exe suite takes ~ 2 hours on my PC.
My idea was to put a single test into an empty new suite — to make build fast. But actually I’m lost in tons of the docs how to make it.
 
I will go through your link, thank you.
 
Anton
 
Пятница, 19 марта 2021, 14:26 +03:00 от Stephen Mcgruer <smcg...@chromium.org>:
 
 
--
Quentin Tarantino
 

Stephen Mcgruer

unread,
Mar 19, 2021, 7:56:08 AM3/19/21
to Anton Gerasimov, ecosystem-infra
Hi Anton,

For unittests, if you want to create a new separate executable I believe you will need to edit an appropriate BUILD.gn file and declare your own test() target. The mailing list you're emailing is for a test that doesn't interact with C++ unittests often (we are part of the Web Tests branch of that original document I sent you :)), but looking at the definition for an existing test() declaration (for net_unittests) it looks like you would need to:

1. define the list of source files needed (your specific foo_unittest.cc file)
2. define the list of deps (dependency) targets needed (probably the underlying components you are testing, as well as "//testing/gmock" and "//testing/gtest")

You would then run something like 'ninja your_target_name' (possibly after running 'gn gen'? I'm not sure!).

If you have more questions on this, I would probably suggest cc-ing chromi...@chromium.org which is a (much) wider mailing list that will have folks who are familiar with setting up unittest targets in BUILD.gn files :).

Thanks,
Stephen

Anton Gerasimov

unread,
Mar 19, 2021, 10:07:43 AM3/19/21
to Stephen Mcgruer, ecosystem-infra
Hi Stephen,
Thanks!

I dropped a mail here https://groups.google.com/a/chromium.org/g/chromium-dev but it’s still not in the list. Hope someone will react. Direct mailing to chromi...@chromium.org is not working.
Anyway, will try a plan you proposed.
 
Anton
 
Пятница, 19 марта 2021, 14:56 +03:00 от Stephen Mcgruer <smcg...@chromium.org>:
Reply all
Reply to author
Forward
0 new messages