[igt-dev] [PATCH i-g-t 2/2] tests/amdgpu/amd_kunit: add KUnit AMDGPU tests

Isabella Basso isabbasso at riseup.net
Fri Jun 17 15:47:53 UTC 2022


This adds an IGT runner for the kernel's newly introduced KUnit tests
under the AMDGPU driver.

Signed-off-by: Isabella Basso <isabbasso at riseup.net>
---
 tests/amdgpu/amd_kunit.c | 34 ++++++++++++++++++++++++++++++++++
 tests/amdgpu/meson.build |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 tests/amdgpu/amd_kunit.c

diff --git a/tests/amdgpu/amd_kunit.c b/tests/amdgpu/amd_kunit.c
new file mode 100644
index 00000000..258c8383
--- /dev/null
+++ b/tests/amdgpu/amd_kunit.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2022 Isabella Basso do Amaral <isabbasso at riseup.net>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <libkmod.h>
+
+#include "igt.h"
+#include "igt_kmod.h"
+
+IGT_TEST_DESCRIPTION("KUnit AMDGPU module testing");
+
+igt_simple_main
+{
+	igt_kunit("amdgpu", NULL, NULL, 0);
+}
diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
index 12c2ba99..0b864e75 100644
--- a/tests/amdgpu/meson.build
+++ b/tests/amdgpu/meson.build
@@ -10,6 +10,7 @@ if libdrm_amdgpu.found()
 			  'amd_cs_nop',
 			  'amd_hotplug',
 			  'amd_info',
+			  'amd_kunit',
 			  'amd_prime',
 			  'amd_max_bpc',
 			  'amd_module_load',
-- 
2.36.1



More information about the igt-dev mailing list