Skip to content

Commit

Permalink
selftests/bpf: fix clearing buffered output between tests/subtests
Browse files Browse the repository at this point in the history
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 <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Andrii Nakryiko authored and Alexei Starovoitov committed Jul 31, 2019
1 parent 116e7db commit bf8ff0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/test_progs.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ static void dump_test_log(const struct prog_test_def *test, bool failed)
if (env.log_buf[env.log_cnt - 1] != '\n')
fprintf(stdout, "\n");
}
env.log_cnt = 0;
}
env.log_cnt = 0;
}

void test__end_subtest()
Expand Down

0 comments on commit bf8ff0f

Please sign in to comment.