Lines Matching refs:test_state
70 env.test_state->stdout_saved = stdout; in stdio_hijack_init()
109 stdout = env.test_state->stdout_saved; in stdio_restore()
110 stderr = env.test_state->stdout_saved; in stdio_restore()
112 if (env.test_state->stdout_saved) in stdio_restore()
113 fclose(env.test_state->stdout_saved); in stdio_restore()
114 env.test_state->stdout_saved = NULL; in stdio_restore()
347 static void print_test_result(const struct prog_test_def *test, const struct test_state *test_state) in print_test_result() argument
349 int skipped_cnt = test_state->skip_cnt; in print_test_result()
350 int subtests_cnt = test_state->subtest_num; in print_test_result()
353 if (test_state->error_cnt) in print_test_result()
404 const struct test_state *test_state, in dump_test_log() argument
409 bool test_failed = test_state->error_cnt > 0; in dump_test_log()
410 bool force_log = test_state->force_log; in dump_test_log()
428 if (test_state->log_cnt && print_test) in dump_test_log()
429 print_test_log(test_state->log_buf, test_state->log_cnt); in dump_test_log()
435 jsonw_write_log_message(w, test_state->log_buf, test_state->log_cnt); in dump_test_log()
441 for (i = 0; i < test_state->subtest_num; i++) { in dump_test_log()
442 subtest_state = &test_state->subtest_states[i]; in dump_test_log()
475 print_test_result(test, test_state); in dump_test_log()
522 struct test_state *test_state = env.test_state; in test__end_subtest() local
526 test_state->error_cnt++; in test__end_subtest()
529 test_state->sub_succ_cnt++; in test__end_subtest()
531 test_state->skip_cnt++; in test__end_subtest()
535 print_subtest_name(test->test_num, test_state->subtest_num, in test__end_subtest()
548 struct test_state *state = env.test_state; in test__start_subtest()
605 env.test_state->force_log = true; in test__force_log()
613 env.test_state->skip_cnt++; in test__skip()
621 env.test_state->error_cnt++; in test__fail()
838 static struct test_state test_states[ARRAY_SIZE(prog_test_defs)];
1275 env.test_state->error_cnt++; in crash_handler()
1276 dump_test_log(env.test, env.test_state, true, false, NULL); in crash_handler()
1378 struct test_state *state = &test_states[test_num]; in run_one_test()
1382 env.test_state = state; in run_one_test()
1463 static int dispatch_thread_send_subtests(int sock_fd, struct test_state *state) in dispatch_thread_send_subtests()
1505 struct test_state *state; in dispatch_thread()
1601 struct test_state *state = &test_states[i]; in calculate_summary_and_print_errors()
1642 struct test_state *state = &test_states[i]; in calculate_summary_and_print_errors()
1786 static int worker_main_send_subtests(int sock, struct test_state *state) in worker_main_send_subtests()
1854 struct test_state *state = &test_states[test_to_run]; in worker_main()
1919 struct test_state *test_state = &test_states[i]; in free_test_states() local
1921 for (j = 0; j < test_state->subtest_num; j++) in free_test_states()
1922 free_subtest_state(&test_state->subtest_states[j]); in free_test_states()
1924 free(test_state->subtest_states); in free_test_states()
1925 free(test_state->log_buf); in free_test_states()
1926 test_state->subtest_states = NULL; in free_test_states()
1927 test_state->log_buf = NULL; in free_test_states()