Dirk Pranke | 31e346e | 2020-07-15 00:54:06 | [diff] [blame] | 1 | # Test Wrapper API |
| 2 | |
| 3 | In order to simplify the calling conventions for tests that we run on our |
| 4 | continuous integration system, we require them to follow a simple API |
| 5 | convention. 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 | |
| 17 | If you create a directory snapshot with the files listed in the .runtime_deps |
| 18 | file, cd to $Z, and run bin/run_$Y, then the test should run to completion |
| 19 | successfully. |
| 20 | |
| 21 | The script file MUST honor the `GTEST_SHARD_INDEX` and `GTEST_TOTAL_SHARDS` |
| 22 | environment variables as documented in |
| 23 | [the Test Executable API](test_executable_api.md) and SHOULD conform to |
| 24 | the Test Executable API in other respects (i.e., honor the |
| 25 | `--isolated-script-test-filter` arg and other command line flags specified |
| 26 | in that API). |
| 27 | |
Alison Gale | 81f4f2c7 | 2024-04-22 19:33:31 | [diff] [blame] | 28 | TODO(crbug.com/40564748): Convert everything to the Test Executable API, and |
Dirk Pranke | 31e346e | 2020-07-15 00:54:06 | [diff] [blame] | 29 | change the above SHOULD to a MUST. |