mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
perf test: Remove non test case style support.
Convert shell tests to also run using test case style. 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-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
1870356f35
commit
c76ec1cf25
@ -157,9 +157,6 @@ static bool is_supported(const struct test_suite *t)
|
|||||||
|
|
||||||
static test_fnptr test_function(const struct test_suite *t, int subtest)
|
static test_fnptr test_function(const struct test_suite *t, int subtest)
|
||||||
{
|
{
|
||||||
if (t->func)
|
|
||||||
return t->func;
|
|
||||||
|
|
||||||
if (subtest <= 0)
|
if (subtest <= 0)
|
||||||
return t->test_cases[0].run_case;
|
return t->test_cases[0].run_case;
|
||||||
|
|
||||||
@ -413,24 +410,34 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width,
|
|||||||
for_each_shell_test(entlist, n_dirs, st.dir, ent) {
|
for_each_shell_test(entlist, n_dirs, st.dir, ent) {
|
||||||
int curr = i++;
|
int curr = i++;
|
||||||
char desc[256];
|
char desc[256];
|
||||||
struct test_suite test = {
|
struct test_case test_cases[] = {
|
||||||
.desc = shell_test__description(desc, sizeof(desc), st.dir, ent->d_name),
|
{
|
||||||
.func = shell_test__run,
|
.desc = shell_test__description(desc,
|
||||||
|
sizeof(desc),
|
||||||
|
st.dir,
|
||||||
|
ent->d_name),
|
||||||
|
.run_case = shell_test__run,
|
||||||
|
},
|
||||||
|
{ .name = NULL, }
|
||||||
|
};
|
||||||
|
struct test_suite test_suite = {
|
||||||
|
.desc = test_cases[0].desc,
|
||||||
|
.test_cases = test_cases,
|
||||||
.priv = &st,
|
.priv = &st,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!perf_test__matches(test.desc, curr, argc, argv))
|
if (!perf_test__matches(test_suite.desc, curr, argc, argv))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
st.file = ent->d_name;
|
st.file = ent->d_name;
|
||||||
pr_info("%2d: %-*s:", i, width, test.desc);
|
pr_info("%2d: %-*s:", i, width, test_suite.desc);
|
||||||
|
|
||||||
if (intlist__find(skiplist, i)) {
|
if (intlist__find(skiplist, i)) {
|
||||||
color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n");
|
color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
test_and_print(&test, false, -1);
|
test_and_print(&test_suite, false, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (e = 0; e < n_dirs; e++)
|
for (e = 0; e < n_dirs; e++)
|
||||||
|
@ -40,7 +40,6 @@ struct test_case {
|
|||||||
|
|
||||||
struct test_suite {
|
struct test_suite {
|
||||||
const char *desc;
|
const char *desc;
|
||||||
test_fnptr func;
|
|
||||||
struct {
|
struct {
|
||||||
bool skip_if_fail;
|
bool skip_if_fail;
|
||||||
} subtest;
|
} subtest;
|
||||||
|
Loading…
Reference in New Issue
Block a user