Commit ce28ab13 authored by Arthur Grillo's avatar Arthur Grillo Committed by Maíra Canal

drm/tests: Add back seed value information

As reported by Michał, the drm_mm and drm_buddy unit tests lost the
printk with seed value after they were refactored into KUnit.

Add kunit_info with seed value information to assure reproducibility.
Reported-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Signed-off-by: default avatarArthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20221028221755.340487-1-arthurgrillo@riseup.net
parent 444bbba7
...@@ -726,11 +726,13 @@ static void drm_test_buddy_alloc_limit(struct kunit *test) ...@@ -726,11 +726,13 @@ static void drm_test_buddy_alloc_limit(struct kunit *test)
drm_buddy_fini(&mm); drm_buddy_fini(&mm);
} }
static int drm_buddy_init_test(struct kunit *test) static int drm_buddy_suite_init(struct kunit_suite *suite)
{ {
while (!random_seed) while (!random_seed)
random_seed = get_random_u32(); random_seed = get_random_u32();
kunit_info(suite, "Testing DRM buddy manager, with random_seed=0x%x\n", random_seed);
return 0; return 0;
} }
...@@ -746,7 +748,7 @@ static struct kunit_case drm_buddy_tests[] = { ...@@ -746,7 +748,7 @@ static struct kunit_case drm_buddy_tests[] = {
static struct kunit_suite drm_buddy_test_suite = { static struct kunit_suite drm_buddy_test_suite = {
.name = "drm_buddy", .name = "drm_buddy",
.init = drm_buddy_init_test, .suite_init = drm_buddy_suite_init,
.test_cases = drm_buddy_tests, .test_cases = drm_buddy_tests,
}; };
......
...@@ -2209,11 +2209,15 @@ static void drm_test_mm_color_evict_range(struct kunit *test) ...@@ -2209,11 +2209,15 @@ static void drm_test_mm_color_evict_range(struct kunit *test)
vfree(nodes); vfree(nodes);
} }
static int drm_mm_init_test(struct kunit *test) static int drm_mm_suite_init(struct kunit_suite *suite)
{ {
while (!random_seed) while (!random_seed)
random_seed = get_random_u32(); random_seed = get_random_u32();
kunit_info(suite,
"Testing DRM range manager, with random_seed=0x%x max_iterations=%u max_prime=%u\n",
random_seed, max_iterations, max_prime);
return 0; return 0;
} }
...@@ -2246,7 +2250,7 @@ static struct kunit_case drm_mm_tests[] = { ...@@ -2246,7 +2250,7 @@ static struct kunit_case drm_mm_tests[] = {
static struct kunit_suite drm_mm_test_suite = { static struct kunit_suite drm_mm_test_suite = {
.name = "drm_mm", .name = "drm_mm",
.init = drm_mm_init_test, .suite_init = drm_mm_suite_init,
.test_cases = drm_mm_tests, .test_cases = drm_mm_tests,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment