Lines Matching refs:tester
92 static int tester_init(struct test_loader *tester) in tester_init() argument
94 if (!tester->log_buf) { in tester_init()
95 tester->log_buf_sz = TEST_LOADER_LOG_BUF_SZ; in tester_init()
96 tester->log_buf = calloc(tester->log_buf_sz, 1); in tester_init()
97 if (!ASSERT_OK_PTR(tester->log_buf, "tester_log_buf")) in tester_init()
104 void test_loader_fini(struct test_loader *tester) in test_loader_fini() argument
106 if (!tester) in test_loader_fini()
109 free(tester->log_buf); in test_loader_fini()
361 static int parse_test_spec(struct test_loader *tester, in parse_test_spec() argument
607 static void prepare_case(struct test_loader *tester, in prepare_case() argument
619 bpf_program__set_log_buf(prog, tester->log_buf, tester->log_buf_sz); in prepare_case()
633 tester->log_buf[0] = '\0'; in prepare_case()
759 static bool can_execute_unpriv(struct test_loader *tester, struct test_spec *spec) in can_execute_unpriv() argument
883 void run_subtest(struct test_loader *tester, in run_subtest() argument
911 if (!can_execute_unpriv(tester, spec)) { in run_subtest()
948 prepare_case(tester, spec, tobj, tprog); in run_subtest()
961 emit_verifier_log(tester->log_buf, false /*force*/); in run_subtest()
966 emit_verifier_log(tester->log_buf, true /*force*/); in run_subtest()
970 emit_verifier_log(tester->log_buf, false /*force*/); in run_subtest()
971 validate_msgs(tester->log_buf, &subspec->expect_msgs, emit_verifier_log); in run_subtest()
975 tester->log_buf, tester->log_buf_sz); in run_subtest()
978 emit_xlated(tester->log_buf, false /*force*/); in run_subtest()
979 validate_msgs(tester->log_buf, &subspec->expect_xlated, emit_xlated); in run_subtest()
984 tester->log_buf, tester->log_buf_sz); in run_subtest()
993 emit_jited(tester->log_buf, false /*force*/); in run_subtest()
994 validate_msgs(tester->log_buf, &subspec->jited, emit_jited); in run_subtest()
1024 if (tester->pre_execution_cb) { in run_subtest()
1025 err = tester->pre_execution_cb(tobj); in run_subtest()
1052 static void process_subtest(struct test_loader *tester, in process_subtest() argument
1064 if (tester_init(tester) < 0) in process_subtest()
1083 err = parse_test_spec(tester, obj, prog, &specs[i++]); in process_subtest()
1097 run_subtest(tester, &open_opts, obj_bytes, obj_byte_cnt, in process_subtest()
1100 run_subtest(tester, &open_opts, obj_bytes, obj_byte_cnt, in process_subtest()
1111 void test_loader__run_subtests(struct test_loader *tester, in test_loader__run_subtests() argument
1116 process_subtest(tester, skel_name, elf_bytes_factory); in test_loader__run_subtests()