blob: 177c212b898bd86b8d13fc4dbaad97ad07cc913e [file] [log] [blame] [view]
Mirko Bonadei2f5efcc2023-03-07 11:00:371# Add a new test binary
2
3This page lists all the steps needed in order to add an `rtc_test` target to
4WebRTC's BUILD.gn files and ensure the test binary will run on the presubmit and
5postsubmit infrastructure.
6
71. While working on your CL, add an `rtc_test` target, with `testonly = true`,
8 and `../test:test_main` among its dependencies (`rtc_test` targets require
9 a `main()` function).
10
112. Add the newly created `rtc_test` target to the `group("default")` target in
12 the root [BUILD.gn](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/BUILD.gn).
13 The target needs to be added within the `rtc_include_tests` section.
14
153. Add the name of the newly created `rtc_test` into
16 [infra/specs/gn_isolate_map.pyl](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/infra/specs/gn_isolate_map.pyl).
17
184. Add the name of the newly created `rtc_test` into
19 [infra/specs/test_suites.pyl](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/infra/specs/test_suites.pyl).
20 By default, you should add it to the `android_tests`, `desktop_tests` and
21 `ios_simulator_tests` sections.
22
235. Run the script
24 [infra/specs/generate_buildbot_json.py](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/infra/specs/generate_buildbot_json.py)
25 (no arguments) to generate the JSON scripts based on the previsouly modified .pyl scripts.
26
276. Build, test, review and submit!
28
29The bots will execute the new configs as part of the CQ. Inspect some logs to
30verify that your test is in fact executed by the bots where you expect them to be.
31
32The details of the (many) config files are described in
33https://chromium.googlesource.com/chromium/src/testing/+/HEAD/buildbot/README.md.