Lines Matching refs:subtest_state
44 if (env.subtest_state) in stdio_hijack_init()
45 env.subtest_state->stdout = stdout; in stdio_hijack_init()
78 if (env.subtest_state) { in stdio_restore_cleanup()
79 fclose(env.subtest_state->stdout); in stdio_restore_cleanup()
80 env.subtest_state->stdout = NULL; in stdio_restore_cleanup()
272 struct subtest_state *subtest_state; in dump_test_log() local
291 subtest_state = &test_state->subtest_states[i]; in dump_test_log()
292 subtest_failed = subtest_state->error_cnt; in dump_test_log()
293 subtest_filtered = subtest_state->filtered; in dump_test_log()
299 if (subtest_state->log_cnt && print_subtest) { in dump_test_log()
300 print_test_log(subtest_state->log_buf, in dump_test_log()
301 subtest_state->log_cnt); in dump_test_log()
305 test->test_name, subtest_state->name, in dump_test_log()
306 test_result(subtest_state->error_cnt, in dump_test_log()
307 subtest_state->skipped)); in dump_test_log()
364 struct subtest_state *subtest_state = env.subtest_state; in test__end_subtest() local
366 if (subtest_state->error_cnt) { in test__end_subtest()
369 if (!subtest_state->skipped) in test__end_subtest()
377 test->test_name, subtest_state->name, in test__end_subtest()
378 test_result(subtest_state->error_cnt, in test__end_subtest()
379 subtest_state->skipped)); in test__end_subtest()
382 env.subtest_state = NULL; in test__end_subtest()
389 struct subtest_state *subtest_state; in test__start_subtest() local
390 size_t sub_state_size = sizeof(*subtest_state); in test__start_subtest()
392 if (env.subtest_state) in test__start_subtest()
404 subtest_state = &state->subtest_states[state->subtest_num - 1]; in test__start_subtest()
406 memset(subtest_state, 0, sub_state_size); in test__start_subtest()
415 subtest_state->name = strdup(subtest_name); in test__start_subtest()
416 if (!subtest_state->name) { in test__start_subtest()
428 subtest_state->filtered = true; in test__start_subtest()
432 env.subtest_state = subtest_state; in test__start_subtest()
433 stdio_hijack_init(&subtest_state->log_buf, &subtest_state->log_cnt); in test__start_subtest()
445 if (env.subtest_state) in test__skip()
446 env.subtest_state->skipped = true; in test__skip()
453 if (env.subtest_state) in test__fail()
454 env.subtest_state->error_cnt++; in test__fail()
1067 if (env.subtest_state) in run_one_test()
1135 struct subtest_state *subtest_state; in dispatch_thread_send_subtests() local
1138 state->subtest_states = malloc(subtest_num * sizeof(*subtest_state)); in dispatch_thread_send_subtests()
1141 subtest_state = &state->subtest_states[i]; in dispatch_thread_send_subtests()
1143 memset(subtest_state, 0, sizeof(*subtest_state)); in dispatch_thread_send_subtests()
1148 subtest_state->name = strdup(msg.subtest_done.name); in dispatch_thread_send_subtests()
1149 subtest_state->error_cnt = msg.subtest_done.error_cnt; in dispatch_thread_send_subtests()
1150 subtest_state->skipped = msg.subtest_done.skipped; in dispatch_thread_send_subtests()
1151 subtest_state->filtered = msg.subtest_done.filtered; in dispatch_thread_send_subtests()
1156 &subtest_state->log_buf, in dispatch_thread_send_subtests()
1157 &subtest_state->log_cnt)) in dispatch_thread_send_subtests()
1418 static void free_subtest_state(struct subtest_state *state) in free_subtest_state()
1433 struct subtest_state *subtest_state; in worker_main_send_subtests() local
1439 subtest_state = &state->subtest_states[i]; in worker_main_send_subtests()
1443 strncpy(msg.subtest_done.name, subtest_state->name, MAX_SUBTEST_NAME); in worker_main_send_subtests()
1445 msg.subtest_done.error_cnt = subtest_state->error_cnt; in worker_main_send_subtests()
1446 msg.subtest_done.skipped = subtest_state->skipped; in worker_main_send_subtests()
1447 msg.subtest_done.filtered = subtest_state->filtered; in worker_main_send_subtests()
1450 if (verbose() || state->force_log || subtest_state->error_cnt) { in worker_main_send_subtests()
1451 if (subtest_state->log_cnt) in worker_main_send_subtests()
1463 worker_main_send_log(sock, subtest_state->log_buf, subtest_state->log_cnt); in worker_main_send_subtests()
1465 free_subtest_state(subtest_state); in worker_main_send_subtests()
1466 free(subtest_state->name); in worker_main_send_subtests()