From: Ian Rogers Date: Thu, 4 Nov 2021 06:42:08 +0000 (-0700) Subject: perf test: Remove skip_if_fail X-Git-Tag: v6.6.17~8807^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b47d2fb40f507a531417f3a893aa822be355ae5f;p=platform%2Fkernel%2Flinux-rpi.git perf test: Remove skip_if_fail Remove optionality, always run tests in a suite even if one fails. This brings perf's test more inline with kunit that lacks this notion. Signed-off-by: Ian Rogers Tested-by: Sohaib Mohamed Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Brendan Higgins Cc: Daniel Latypov Cc: David Gow Cc: Ingo Molnar Cc: Jin Yao Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211104064208.3156807-23-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index e6691ed..2048c9a 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c @@ -383,5 +383,4 @@ static struct test_case bpf_tests[] = { struct test_suite suite__bpf = { .desc = "BPF filter", .test_cases = bpf_tests, - .subtest = { .skip_if_fail = true, }, }; diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 19b1228..8cb5a1c 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -238,18 +238,13 @@ static int run_test(struct test_suite *test, int subtest) for (j = 0; j < ARRAY_SIZE(tests); j++) \ for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k]) -static int test_and_print(struct test_suite *t, bool force_skip, int subtest) +static int test_and_print(struct test_suite *t, int subtest) { int err; - if (!force_skip) { - pr_debug("\n--- start ---\n"); - err = run_test(t, subtest); - pr_debug("---- end ----\n"); - } else { - pr_debug("\n--- force skipped ---\n"); - err = TEST_SKIP; - } + pr_debug("\n--- start ---\n"); + err = run_test(t, subtest); + pr_debug("---- end ----\n"); if (!has_subtests(t)) pr_debug("%s:", t->desc); @@ -432,7 +427,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width, continue; } - test_and_print(&test_suite, false, 0); + test_and_print(&test_suite, 0); } for (e = 0; e < n_dirs; e++) @@ -456,7 +451,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) } for_each_test(j, k, t) { - int curr = i++, err; + int curr = i++; int subi; if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) { @@ -483,7 +478,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) } if (!has_subtests(t)) { - test_and_print(t, false, -1); + test_and_print(t, -1); } else { int subn = num_subtests(t); /* @@ -495,7 +490,6 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) * 35.1: Basic BPF llvm compiling test : Ok */ int subw = width > 2 ? width - 2 : width; - bool skip = false; if (subn <= 0) { color_fprintf(stderr, PERF_COLOR_YELLOW, @@ -518,9 +512,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) pr_info("%2d.%1d: %-*s:", i, subi + 1, subw, test_description(t, subi)); - err = test_and_print(t, skip, subi); - if (err != TEST_OK && t->subtest.skip_if_fail) - skip = true; + test_and_print(t, subi); } } } diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c index ba06a22..a711100 100644 --- a/tools/perf/tests/clang.c +++ b/tools/perf/tests/clang.c @@ -29,5 +29,4 @@ static struct test_case clang_tests[] = { struct test_suite suite__clang = { .desc = "builtin clang support", .test_cases = clang_tests, - .subtest = { .skip_if_fail = true, }, }; diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c index f27ef00..8ac0a3a 100644 --- a/tools/perf/tests/llvm.c +++ b/tools/perf/tests/llvm.c @@ -216,5 +216,4 @@ static struct test_case llvm_tests[] = { struct test_suite suite__llvm = { .desc = "LLVM search and compile", .test_cases = llvm_tests, - .subtest = { .skip_if_fail = true, }, }; diff --git a/tools/perf/tests/pfm.c b/tools/perf/tests/pfm.c index 651fee4..71b76de 100644 --- a/tools/perf/tests/pfm.c +++ b/tools/perf/tests/pfm.c @@ -191,5 +191,4 @@ static struct test_case pfm_tests[] = { struct test_suite suite__pfm = { .desc = "Test libpfm4 support", .test_cases = pfm_tests, - .subtest = { .skip_if_fail = true } }; diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index 1505180..8f65098 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -40,9 +40,6 @@ struct test_case { struct test_suite { const char *desc; - struct { - bool skip_if_fail; - } subtest; struct test_case *test_cases; void *priv; };