Given the total number of shards, the shard index, and the test id, returns true iff the test should be run on this shard. The test id is some arbitrary but unique non-negative integer assigned to each test method. Assumes that 0 <= shard_index < total_shards.
| 6906 | // some arbitrary but unique non-negative integer assigned to each test |
| 6907 | // method. Assumes that 0 <= shard_index < total_shards. |
| 6908 | bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) { |
| 6909 | return (test_id % total_shards) == shard_index; |
| 6910 | } |
| 6911 | |
| 6912 | // Compares the name of each test with the user-specified filter to |
| 6913 | // decide whether the test should be run, then records the result in |