Lines Matching refs:state
548 struct test_state *state = env.test_state; in test__start_subtest() local
555 state->subtest_num++; in test__start_subtest()
556 state->subtest_states = in test__start_subtest()
557 realloc(state->subtest_states, in test__start_subtest()
558 state->subtest_num * sub_state_size); in test__start_subtest()
559 if (!state->subtest_states) { in test__start_subtest()
564 subtest_state = &state->subtest_states[state->subtest_num - 1]; in test__start_subtest()
571 state->subtest_num); in test__start_subtest()
579 state->subtest_num); in test__start_subtest()
585 state->subtest_num, in test__start_subtest()
995 static error_t parse_arg(int key, char *arg, struct argp_state *state) in parse_arg() argument
997 struct test_env *env = state->input; in parse_arg()
1106 argp_usage(state); in parse_arg()
1378 struct test_state *state = &test_states[test_num]; in run_one_test() local
1382 env.test_state = state; in run_one_test()
1384 stdio_hijack(&state->log_buf, &state->log_cnt); in run_one_test()
1400 state->tested = true; in run_one_test()
1405 print_test_result(test, state); in run_one_test()
1414 dump_test_log(test, state, false, false, NULL); in run_one_test()
1463 static int dispatch_thread_send_subtests(int sock_fd, struct test_state *state) in dispatch_thread_send_subtests() argument
1467 int subtest_num = state->subtest_num; in dispatch_thread_send_subtests()
1469 state->subtest_states = malloc(subtest_num * sizeof(*subtest_state)); in dispatch_thread_send_subtests()
1472 subtest_state = &state->subtest_states[i]; in dispatch_thread_send_subtests()
1505 struct test_state *state; in dispatch_thread() local
1549 state = &test_states[test_to_run]; in dispatch_thread()
1550 state->tested = true; in dispatch_thread()
1551 state->error_cnt = msg.test_done.error_cnt; in dispatch_thread()
1552 state->skip_cnt = msg.test_done.skip_cnt; in dispatch_thread()
1553 state->sub_succ_cnt = msg.test_done.sub_succ_cnt; in dispatch_thread()
1554 state->subtest_num = msg.test_done.subtest_num; in dispatch_thread()
1559 &state->log_buf, in dispatch_thread()
1560 &state->log_cnt)) in dispatch_thread()
1565 if (!state->subtest_num) in dispatch_thread()
1568 if (dispatch_thread_send_subtests(sock_fd, state)) in dispatch_thread()
1573 dump_test_log(test, state, false, true, NULL); in dispatch_thread()
1601 struct test_state *state = &test_states[i]; in calculate_summary_and_print_errors() local
1603 if (!state->tested) in calculate_summary_and_print_errors()
1606 sub_succ_cnt += state->sub_succ_cnt; in calculate_summary_and_print_errors()
1607 skip_cnt += state->skip_cnt; in calculate_summary_and_print_errors()
1609 if (state->error_cnt) in calculate_summary_and_print_errors()
1642 struct test_state *state = &test_states[i]; in calculate_summary_and_print_errors() local
1644 if (!state->tested || !state->error_cnt) in calculate_summary_and_print_errors()
1647 dump_test_log(test, state, true, true, w); in calculate_summary_and_print_errors()
1775 static void free_subtest_state(struct subtest_state *state) in free_subtest_state() argument
1777 if (state->log_buf) { in free_subtest_state()
1778 free(state->log_buf); in free_subtest_state()
1779 state->log_buf = NULL; in free_subtest_state()
1780 state->log_cnt = 0; in free_subtest_state()
1782 free(state->name); in free_subtest_state()
1783 state->name = NULL; in free_subtest_state()
1786 static int worker_main_send_subtests(int sock, struct test_state *state) in worker_main_send_subtests() argument
1795 for (i = 0; i < state->subtest_num; i++) { in worker_main_send_subtests()
1796 subtest_state = &state->subtest_states[i]; in worker_main_send_subtests()
1807 if (verbose() || state->force_log || subtest_state->error_cnt) { in worker_main_send_subtests()
1827 for (; i < state->subtest_num; i++) in worker_main_send_subtests()
1828 free_subtest_state(&state->subtest_states[i]); in worker_main_send_subtests()
1829 free(state->subtest_states); in worker_main_send_subtests()
1854 struct test_state *state = &test_states[test_to_run]; in worker_main() local
1868 msg.test_done.error_cnt = state->error_cnt; in worker_main()
1869 msg.test_done.skip_cnt = state->skip_cnt; in worker_main()
1870 msg.test_done.sub_succ_cnt = state->sub_succ_cnt; in worker_main()
1871 msg.test_done.subtest_num = state->subtest_num; in worker_main()
1874 if (verbose() || state->force_log || state->error_cnt) { in worker_main()
1875 if (state->log_cnt) in worker_main()
1885 worker_main_send_log(sock, state->log_buf, state->log_cnt); in worker_main()
1887 if (state->log_buf) { in worker_main()
1888 free(state->log_buf); in worker_main()
1889 state->log_buf = NULL; in worker_main()
1890 state->log_cnt = 0; in worker_main()
1893 if (state->subtest_num) in worker_main()
1894 if (worker_main_send_subtests(sock, state)) in worker_main()