Names the profile this process writes next and the one its children will. */
| 1325 | |
| 1326 | /* Names the profile this process writes next and the one its children will. */ |
| 1327 | static bool tf_coverage_route(const char *directory, const char *own, const char *child) { |
| 1328 | int own_length = |
| 1329 | snprintf(tf_coverage_profile, sizeof(tf_coverage_profile), "%s/%s.profraw", directory, own); |
| 1330 | /* `%c`: an exec'd child maps its counters onto the file (see Children). */ |
| 1331 | int child_length = snprintf(tf_coverage_child_pattern, sizeof(tf_coverage_child_pattern), |
| 1332 | "%s/%s.%%p%%c.profraw", directory, child); |
| 1333 | if (own_length <= 0 || (size_t)own_length >= sizeof(tf_coverage_profile) || child_length <= 0 || |
| 1334 | (size_t)child_length >= sizeof(tf_coverage_child_pattern)) { |
| 1335 | return false; |
| 1336 | } |
| 1337 | __llvm_profile_set_filename(tf_coverage_profile); |
| 1338 | return cbm_setenv("LLVM_PROFILE_FILE", tf_coverage_child_pattern, 1) == 0; |
| 1339 | } |
| 1340 | |
| 1341 | /* Between tests the interval is suite setup, and so is any child it spawns. */ |
| 1342 | static bool tf_coverage_route_setup(const char *suite_dir) { |
no test coverage detected