Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <irogers@google.com>
Tested-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Daniel Latypov <dlatypov@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20211104064208.3156807-23-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
b47d2fb4 848ddf59

+8 -23
-1
tools/perf/tests/bpf.c
··· 383 383 struct test_suite suite__bpf = { 384 384 .desc = "BPF filter", 385 385 .test_cases = bpf_tests, 386 - .subtest = { .skip_if_fail = true, }, 387 386 };
+8 -16
tools/perf/tests/builtin-test.c
··· 238 238 for (j = 0; j < ARRAY_SIZE(tests); j++) \ 239 239 for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k]) 240 240 241 - static int test_and_print(struct test_suite *t, bool force_skip, int subtest) 241 + static int test_and_print(struct test_suite *t, int subtest) 242 242 { 243 243 int err; 244 244 245 - if (!force_skip) { 246 - pr_debug("\n--- start ---\n"); 247 - err = run_test(t, subtest); 248 - pr_debug("---- end ----\n"); 249 - } else { 250 - pr_debug("\n--- force skipped ---\n"); 251 - err = TEST_SKIP; 252 - } 245 + pr_debug("\n--- start ---\n"); 246 + err = run_test(t, subtest); 247 + pr_debug("---- end ----\n"); 253 248 254 249 if (!has_subtests(t)) 255 250 pr_debug("%s:", t->desc); ··· 427 432 continue; 428 433 } 429 434 430 - test_and_print(&test_suite, false, 0); 435 + test_and_print(&test_suite, 0); 431 436 } 432 437 433 438 for (e = 0; e < n_dirs; e++) ··· 451 456 } 452 457 453 458 for_each_test(j, k, t) { 454 - int curr = i++, err; 459 + int curr = i++; 455 460 int subi; 456 461 457 462 if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) { ··· 478 483 } 479 484 480 485 if (!has_subtests(t)) { 481 - test_and_print(t, false, -1); 486 + test_and_print(t, -1); 482 487 } else { 483 488 int subn = num_subtests(t); 484 489 /* ··· 490 495 * 35.1: Basic BPF llvm compiling test : Ok 491 496 */ 492 497 int subw = width > 2 ? width - 2 : width; 493 - bool skip = false; 494 498 495 499 if (subn <= 0) { 496 500 color_fprintf(stderr, PERF_COLOR_YELLOW, ··· 512 518 513 519 pr_info("%2d.%1d: %-*s:", i, subi + 1, subw, 514 520 test_description(t, subi)); 515 - err = test_and_print(t, skip, subi); 516 - if (err != TEST_OK && t->subtest.skip_if_fail) 517 - skip = true; 521 + test_and_print(t, subi); 518 522 } 519 523 } 520 524 }
-1
tools/perf/tests/clang.c
··· 29 29 struct test_suite suite__clang = { 30 30 .desc = "builtin clang support", 31 31 .test_cases = clang_tests, 32 - .subtest = { .skip_if_fail = true, }, 33 32 };
-1
tools/perf/tests/llvm.c
··· 216 216 struct test_suite suite__llvm = { 217 217 .desc = "LLVM search and compile", 218 218 .test_cases = llvm_tests, 219 - .subtest = { .skip_if_fail = true, }, 220 219 };
-1
tools/perf/tests/pfm.c
··· 191 191 struct test_suite suite__pfm = { 192 192 .desc = "Test libpfm4 support", 193 193 .test_cases = pfm_tests, 194 - .subtest = { .skip_if_fail = true } 195 194 };
-3
tools/perf/tests/tests.h
··· 40 40 41 41 struct test_suite { 42 42 const char *desc; 43 - struct { 44 - bool skip_if_fail; 45 - } subtest; 46 43 struct test_case *test_cases; 47 44 void *priv; 48 45 };