Lines Matching refs:tester
94 static int tester_init(struct test_loader *tester)
96 if (!tester->log_buf) {
97 tester->log_buf_sz = TEST_LOADER_LOG_BUF_SZ;
98 tester->log_buf = calloc(tester->log_buf_sz, 1);
99 if (!ASSERT_OK_PTR(tester->log_buf, "tester_log_buf"))
106 void test_loader_fini(struct test_loader *tester)
108 if (!tester)
111 free(tester->log_buf);
394 static int parse_test_spec(struct test_loader *tester,
646 static void prepare_case(struct test_loader *tester,
658 bpf_program__set_log_buf(prog, tester->log_buf, tester->log_buf_sz);
672 tester->log_buf[0] = '\0';
798 static bool can_execute_unpriv(struct test_loader *tester, struct test_spec *spec)
922 void run_subtest(struct test_loader *tester,
950 if (!can_execute_unpriv(tester, spec)) {
994 prepare_case(tester, spec, tobj, tprog);
1007 emit_verifier_log(tester->log_buf, false /*force*/);
1012 emit_verifier_log(tester->log_buf, true /*force*/);
1016 emit_verifier_log(tester->log_buf, false /*force*/);
1017 validate_msgs(tester->log_buf, &subspec->expect_msgs, emit_verifier_log);
1021 tester->log_buf, tester->log_buf_sz);
1024 emit_xlated(tester->log_buf, false /*force*/);
1025 validate_msgs(tester->log_buf, &subspec->expect_xlated, emit_xlated);
1030 tester->log_buf, tester->log_buf_sz);
1039 emit_jited(tester->log_buf, false /*force*/);
1040 validate_msgs(tester->log_buf, &subspec->jited, emit_jited);
1070 if (tester->pre_execution_cb) {
1071 err = tester->pre_execution_cb(tobj);
1098 static void process_subtest(struct test_loader *tester,
1110 if (tester_init(tester) < 0)
1111 return; /* failed to initialize tester */
1129 err = parse_test_spec(tester, obj, prog, &specs[i++]);
1143 run_subtest(tester, &open_opts, obj_bytes, obj_byte_cnt,
1146 run_subtest(tester, &open_opts, obj_bytes, obj_byte_cnt,
1157 void test_loader__run_subtests(struct test_loader *tester,
1162 process_subtest(tester, skel_name, elf_bytes_factory);