[PATCH v2] drm/tests: Add back seed value information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As reported by Michał the drm_mm and drm_buddy unit tests lost the
printk with seed value after they where refactored into KUnit. This
patch add back this important information to assure reproducibility and
convert them to the KUnit API.

Reported-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>
Signed-off-by: Arthur Grillo <arthurgrillo@xxxxxxxxxx>
---
v1->v2: https://lore.kernel.org/all/20221026211458.68432-1-arthurgrillo@xxxxxxxxxx/
- Correct compilation issues
- Change tags order
- Remove useless line change
- Write commit message in imperative form
- Remove redundant message part
- Correct some grammars nits
- Correct checkpatch issues

---
 drivers/gpu/drm/tests/drm_buddy_test.c | 4 ++++
 drivers/gpu/drm/tests/drm_mm_test.c    | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
index 62f69589a72d..258137e9c047 100644
--- a/drivers/gpu/drm/tests/drm_buddy_test.c
+++ b/drivers/gpu/drm/tests/drm_buddy_test.c
@@ -731,6 +731,10 @@ static int drm_buddy_init_test(struct kunit *test)
 	while (!random_seed)
 		random_seed = get_random_u32();
 
+	kunit_info(test,
+		   "Testing DRM buddy manager, with random_seed=0x%x\n",
+		   random_seed);
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c
index c4b66eeae203..bec006e044a4 100644
--- a/drivers/gpu/drm/tests/drm_mm_test.c
+++ b/drivers/gpu/drm/tests/drm_mm_test.c
@@ -2214,6 +2214,10 @@ static int drm_mm_init_test(struct kunit *test)
 	while (!random_seed)
 		random_seed = get_random_u32();
 
+	kunit_info(test,
+		   "Testing DRM range manager, with random_seed=0x%x max_iterations=%u max_prime=%u\n",
+		   random_seed, max_iterations, max_prime);
+
 	return 0;
 }
 
-- 
2.37.3




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux