Lines Matching refs:msg

1312 static inline const char *str_msg(const struct msg *msg, char *buf)  in str_msg()  argument
1314 switch (msg->type) { in str_msg()
1316 sprintf(buf, "MSG_DO_TEST %d", msg->do_test.num); in str_msg()
1320 msg->test_done.num, in str_msg()
1321 msg->test_done.have_log); in str_msg()
1325 msg->subtest_done.num, in str_msg()
1326 msg->subtest_done.have_log); in str_msg()
1330 strlen(msg->test_log.log_buf), in str_msg()
1331 msg->test_log.is_last); in str_msg()
1344 static int send_message(int sock, const struct msg *msg) in send_message() argument
1349 fprintf(stderr, "Sending msg: %s\n", str_msg(msg, buf)); in send_message()
1350 return send(sock, msg, sizeof(*msg), 0); in send_message()
1353 static int recv_message(int sock, struct msg *msg) in recv_message() argument
1358 memset(msg, 0, sizeof(*msg)); in recv_message()
1359 ret = recv(sock, msg, sizeof(*msg), 0); in recv_message()
1362 fprintf(stderr, "Received msg: %s\n", str_msg(msg, buf)); in recv_message()
1422 static int read_prog_test_msg(int sock_fd, struct msg *msg, enum msg_type type) in read_prog_test_msg() argument
1424 if (recv_message(sock_fd, msg) < 0) in read_prog_test_msg()
1427 if (msg->type != type) { in read_prog_test_msg()
1428 printf("%s: unexpected message type %d. expected %d\n", __func__, msg->type, type); in read_prog_test_msg()
1445 struct msg msg; in dispatch_thread_read_log() local
1447 if (read_prog_test_msg(sock_fd, &msg, MSG_TEST_LOG)) { in dispatch_thread_read_log()
1452 fprintf(log_fp, "%s", msg.test_log.log_buf); in dispatch_thread_read_log()
1453 if (msg.test_log.is_last) in dispatch_thread_read_log()
1465 struct msg msg; in dispatch_thread_send_subtests() local
1476 if (read_prog_test_msg(sock_fd, &msg, MSG_SUBTEST_DONE)) in dispatch_thread_send_subtests()
1479 subtest_state->name = strdup(msg.subtest_done.name); in dispatch_thread_send_subtests()
1480 subtest_state->error_cnt = msg.subtest_done.error_cnt; in dispatch_thread_send_subtests()
1481 subtest_state->skipped = msg.subtest_done.skipped; in dispatch_thread_send_subtests()
1482 subtest_state->filtered = msg.subtest_done.filtered; in dispatch_thread_send_subtests()
1485 if (msg.subtest_done.have_log) in dispatch_thread_send_subtests()
1528 struct msg msg_do_test; in dispatch_thread()
1542 struct msg msg; in dispatch_thread() local
1544 if (read_prog_test_msg(sock_fd, &msg, MSG_TEST_DONE)) in dispatch_thread()
1546 if (test_to_run != msg.test_done.num) 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()
1557 if (msg.test_done.have_log) { in dispatch_thread()
1582 struct msg msg_exit; in dispatch_thread()
1756 struct msg msg_log; in worker_main_send_log()
1789 struct msg msg; in worker_main_send_subtests() local
1792 memset(&msg, 0, sizeof(msg)); in worker_main_send_subtests()
1793 msg.type = MSG_SUBTEST_DONE; in worker_main_send_subtests()
1798 msg.subtest_done.num = i; in worker_main_send_subtests()
1800 strncpy(msg.subtest_done.name, subtest_state->name, MAX_SUBTEST_NAME); in worker_main_send_subtests()
1802 msg.subtest_done.error_cnt = subtest_state->error_cnt; in worker_main_send_subtests()
1803 msg.subtest_done.skipped = subtest_state->skipped; in worker_main_send_subtests()
1804 msg.subtest_done.filtered = subtest_state->filtered; in worker_main_send_subtests()
1805 msg.subtest_done.have_log = false; in worker_main_send_subtests()
1809 msg.subtest_done.have_log = true; in worker_main_send_subtests()
1812 if (send_message(sock, &msg) < 0) { in worker_main_send_subtests()
1819 if (msg.subtest_done.have_log) in worker_main_send_subtests()
1840 struct msg msg; in worker_main() local
1842 if (recv_message(sock, &msg) < 0) in worker_main()
1845 switch (msg.type) { in worker_main()
1852 int test_to_run = msg.do_test.num; in worker_main()
1855 struct msg msg; in worker_main() local
1865 memset(&msg, 0, sizeof(msg)); in worker_main()
1866 msg.type = MSG_TEST_DONE; in worker_main()
1867 msg.test_done.num = test_to_run; in worker_main()
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()
1872 msg.test_done.have_log = false; in worker_main()
1876 msg.test_done.have_log = true; in worker_main()
1878 if (send_message(sock, &msg) < 0) { in worker_main()
1884 if (msg.test_done.have_log) in worker_main()