blob: c26e0ac1a672427835920b48e2e96825cac84d22 [file] [log] [blame] [view]
Dirk Pranke31e346e2020-07-15 00:54:061# Test Wrapper API
2
3In order to simplify the calling conventions for tests that we run on our
4continuous integration system, we require them to follow a simple API
5convention. For a given GN label //X:Y and build directory //Z in a checkout
6(e.g., //url:url_unittests and //out/Release), we expect there to be:
7
8 * A file `$Z/$Y.runtime_deps` containing a list of files needed to run
9 the test (in the format produced by `gn desc //Z //X:Y runtime_deps`,
10 which is a newline-separated list of paths relative to Z)
11 * An executable file `$Z/bin/run_$Y` which does everything needed to set
12 up and run the test with all of the appropriate flags. This will usually
13 be a vpython script.
14 * (on Windows) A file `$Z/bin/run_$Y.bat` file that will turn around
15 and invoke the corresponding run_$ vpython script.
16
17If you create a directory snapshot with the files listed in the .runtime_deps
18file, cd to $Z, and run bin/run_$Y, then the test should run to completion
19successfully.
20
21The script file MUST honor the `GTEST_SHARD_INDEX` and `GTEST_TOTAL_SHARDS`
22environment variables as documented in
23[the Test Executable API](test_executable_api.md) and SHOULD conform to
24the Test Executable API in other respects (i.e., honor the
25`--isolated-script-test-filter` arg and other command line flags specified
26in that API).
27
Alison Gale81f4f2c72024-04-22 19:33:3128TODO(crbug.com/40564748): Convert everything to the Test Executable API, and
Dirk Pranke31e346e2020-07-15 00:54:0629change the above SHOULD to a MUST.