Skip to content

Commit b47d2fb

Browse files
captain5050acmel
authored andcommitted
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 <[email protected]> Tested-by: Sohaib Mohamed <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Brendan Higgins <[email protected]> Cc: Daniel Latypov <[email protected]> Cc: David Gow <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jin Yao <[email protected]> Cc: John Garry <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Clarke <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 848ddf5 commit b47d2fb

File tree

6 files changed

+8
-23
lines changed

6 files changed

+8
-23
lines changed

tools/perf/tests/bpf.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,5 +383,4 @@ static struct test_case bpf_tests[] = {
383383
struct test_suite suite__bpf = {
384384
.desc = "BPF filter",
385385
.test_cases = bpf_tests,
386-
.subtest = { .skip_if_fail = true, },
387386
};

tools/perf/tests/builtin-test.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,13 @@ static int run_test(struct test_suite *test, int subtest)
238238
for (j = 0; j < ARRAY_SIZE(tests); j++) \
239239
for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k])
240240

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)
242242
{
243243
int err;
244244

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");
253248

254249
if (!has_subtests(t))
255250
pr_debug("%s:", t->desc);
@@ -432,7 +427,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width,
432427
continue;
433428
}
434429

435-
test_and_print(&test_suite, false, 0);
430+
test_and_print(&test_suite, 0);
436431
}
437432

438433
for (e = 0; e < n_dirs; e++)
@@ -456,7 +451,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
456451
}
457452

458453
for_each_test(j, k, t) {
459-
int curr = i++, err;
454+
int curr = i++;
460455
int subi;
461456

462457
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)
483478
}
484479

485480
if (!has_subtests(t)) {
486-
test_and_print(t, false, -1);
481+
test_and_print(t, -1);
487482
} else {
488483
int subn = num_subtests(t);
489484
/*
@@ -495,7 +490,6 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
495490
* 35.1: Basic BPF llvm compiling test : Ok
496491
*/
497492
int subw = width > 2 ? width - 2 : width;
498-
bool skip = false;
499493

500494
if (subn <= 0) {
501495
color_fprintf(stderr, PERF_COLOR_YELLOW,
@@ -518,9 +512,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
518512

519513
pr_info("%2d.%1d: %-*s:", i, subi + 1, subw,
520514
test_description(t, subi));
521-
err = test_and_print(t, skip, subi);
522-
if (err != TEST_OK && t->subtest.skip_if_fail)
523-
skip = true;
515+
test_and_print(t, subi);
524516
}
525517
}
526518
}

tools/perf/tests/clang.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ static struct test_case clang_tests[] = {
2929
struct test_suite suite__clang = {
3030
.desc = "builtin clang support",
3131
.test_cases = clang_tests,
32-
.subtest = { .skip_if_fail = true, },
3332
};

tools/perf/tests/llvm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,4 @@ static struct test_case llvm_tests[] = {
216216
struct test_suite suite__llvm = {
217217
.desc = "LLVM search and compile",
218218
.test_cases = llvm_tests,
219-
.subtest = { .skip_if_fail = true, },
220219
};

tools/perf/tests/pfm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,4 @@ static struct test_case pfm_tests[] = {
191191
struct test_suite suite__pfm = {
192192
.desc = "Test libpfm4 support",
193193
.test_cases = pfm_tests,
194-
.subtest = { .skip_if_fail = true }
195194
};

tools/perf/tests/tests.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ struct test_case {
4040

4141
struct test_suite {
4242
const char *desc;
43-
struct {
44-
bool skip_if_fail;
45-
} subtest;
4643
struct test_case *test_cases;
4744
void *priv;
4845
};

0 commit comments

Comments
 (0)