Skip to content

Commit bf8ff0f

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
selftests/bpf: fix clearing buffered output between tests/subtests
Clear buffered output once test or subtests finishes even if test was successful. Not doing this leads to accumulation of output from previous tests and on first failed tests lots of irrelevant output will be dumped, greatly confusing things. v1->v2: fix Fixes tag, add more context to patch Fixes: 3a516a0 ("selftests/bpf: add sub-tests support for test_progs") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 116e7db commit bf8ff0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/test_progs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ static void dump_test_log(const struct prog_test_def *test, bool failed)
4646
if (env.log_buf[env.log_cnt - 1] != '\n')
4747
fprintf(stdout, "\n");
4848
}
49-
env.log_cnt = 0;
5049
}
50+
env.log_cnt = 0;
5151
}
5252

5353
void test__end_subtest()

0 commit comments

Comments
 (0)