perf test: Remove skip_if_fail
authorIan Rogers <irogers@google.com>
Thu, 4 Nov 2021 06:42:08 +0000 (23:42 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 13 Nov 2021 21:11:50 +0000 (18:11 -0300)
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>
tools/perf/tests/bpf.c
tools/perf/tests/builtin-test.c
tools/perf/tests/clang.c
tools/perf/tests/llvm.c
tools/perf/tests/pfm.c
tools/perf/tests/tests.h

index e6691ed7201c8240b5822b8e830648278c4d4cb5..2048c9a08e8f68cde4b1ad251c9ffeabe6eb4011 100644 (file)
@@ -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, },
 };
index 19b1228dbd5d56c00ad3304fd7e448d331735493..8cb5a1c3489eafc822f574691336c164db115238 100644 (file)
@@ -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);
                        }
                }
        }
index ba06a2257574395c3a085f1b2a9d82dd4776cd23..a7111005d5b9f481b1ca32a22b2db89b26c27681 100644 (file)
@@ -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, },
 };
index f27ef00d65e9a441a9708a5e463aee7f82bbc859..8ac0a3a457ef53c1d13b322ce7f26559e687608f 100644 (file)
@@ -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, },
 };
index 651fee4ef819b36a64024c472719dcc7b86f330d..71b76deb1f9277c249c7ce6d249ef39c626b1c5a 100644 (file)
@@ -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 }
 };
index 15051801c790139515bf4909928704aef5eab6bd..8f65098110fcf1670a0488f64cb108b071fb9f47 100644 (file)
@@ -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;
 };