mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
perf test: Split monolithic 'util' test suite into sub-tests
Refactor the monolithic 'util' test suite into distinct 'String replacement' and 'BLAKE2s hash' sub-tests using the struct test_case framework. This improves test reporting granularity and is used in a subsequent perf test for JUnit XML test result reporting. Assisted-by: Gemini-CLI:Google Gemini 3 Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
85fe2fdb27
commit
a540f031bb
|
|
@ -86,7 +86,12 @@ static int test_blake2s(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int test__util(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
|
||||
static int test__blake2s_case(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
|
||||
{
|
||||
return test_blake2s();
|
||||
}
|
||||
|
||||
static int test__strreplace(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
|
||||
{
|
||||
TEST_ASSERT_VAL("empty string", test_strreplace(' ', "", "123", ""));
|
||||
TEST_ASSERT_VAL("no match", test_strreplace('5', "123", "4", "123"));
|
||||
|
|
@ -95,7 +100,16 @@ static int test__util(struct test_suite *t __maybe_unused, int subtest __maybe_u
|
|||
TEST_ASSERT_VAL("replace long", test_strreplace('a', "abcabc", "longlong",
|
||||
"longlongbclonglongbc"));
|
||||
|
||||
return test_blake2s();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_SUITE("util", util);
|
||||
static struct test_case tests__util[] = {
|
||||
TEST_CASE("String replacement", strreplace),
|
||||
TEST_CASE("BLAKE2s hash", blake2s_case),
|
||||
{ .name = NULL, }
|
||||
};
|
||||
|
||||
struct test_suite suite__util = {
|
||||
.desc = "util",
|
||||
.test_cases = tests__util,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user