Commit 02373681 authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe/kunit: Simplify xe_migrate live tests code layout

The test case logic is implemented by the functions compiled as
part of the core Xe driver module and then exported to build and
register the test suite in the live test module.

But we don't need to export individual test case functions, we may
just export the entire test suite. And we don't need to register
this test suite in a separate file, it can be done in the main
file of the live test module.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240708111210.1154-4-michal.wajdeczko@intel.com
parent ff10c99a
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# "live" kunit tests # "live" kunit tests
obj-$(CONFIG_DRM_XE_KUNIT_TEST) += xe_live_test.o obj-$(CONFIG_DRM_XE_KUNIT_TEST) += xe_live_test.o
xe_live_test-y = xe_live_test_mod.o \ xe_live_test-y = xe_live_test_mod.o \
xe_migrate_test.o \
xe_mocs_test.o xe_mocs_test.o
# Normal kunit tests # Normal kunit tests
......
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
extern struct kunit_suite xe_bo_test_suite; extern struct kunit_suite xe_bo_test_suite;
extern struct kunit_suite xe_dma_buf_test_suite; extern struct kunit_suite xe_dma_buf_test_suite;
extern struct kunit_suite xe_migrate_test_suite;
kunit_test_suite(xe_bo_test_suite); kunit_test_suite(xe_bo_test_suite);
kunit_test_suite(xe_dma_buf_test_suite); kunit_test_suite(xe_dma_buf_test_suite);
kunit_test_suite(xe_migrate_test_suite);
MODULE_AUTHOR("Intel Corporation"); MODULE_AUTHOR("Intel Corporation");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <kunit/test.h> #include <kunit/test.h>
#include <kunit/visibility.h> #include <kunit/visibility.h>
#include "tests/xe_migrate_test.h"
#include "tests/xe_pci_test.h" #include "tests/xe_pci_test.h"
#include "xe_pci.h" #include "xe_pci.h"
...@@ -354,8 +353,19 @@ static int migrate_test_run_device(struct xe_device *xe) ...@@ -354,8 +353,19 @@ static int migrate_test_run_device(struct xe_device *xe)
return 0; return 0;
} }
void xe_migrate_sanity_kunit(struct kunit *test) static void xe_migrate_sanity_kunit(struct kunit *test)
{ {
xe_call_for_each_device(migrate_test_run_device); xe_call_for_each_device(migrate_test_run_device);
} }
EXPORT_SYMBOL_IF_KUNIT(xe_migrate_sanity_kunit);
static struct kunit_case xe_migrate_tests[] = {
KUNIT_CASE(xe_migrate_sanity_kunit),
{}
};
VISIBLE_IF_KUNIT
struct kunit_suite xe_migrate_test_suite = {
.name = "xe_migrate",
.test_cases = xe_migrate_tests,
};
EXPORT_SYMBOL_IF_KUNIT(xe_migrate_test_suite);
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright © 2022 Intel Corporation
*/
#include "xe_migrate_test.h"
#include <kunit/test.h>
static struct kunit_case xe_migrate_tests[] = {
KUNIT_CASE(xe_migrate_sanity_kunit),
{}
};
static struct kunit_suite xe_migrate_test_suite = {
.name = "xe_migrate",
.test_cases = xe_migrate_tests,
};
kunit_test_suite(xe_migrate_test_suite);
/* SPDX-License-Identifier: GPL-2.0 AND MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_MIGRATE_TEST_H_
#define _XE_MIGRATE_TEST_H_
struct kunit;
void xe_migrate_sanity_kunit(struct kunit *test);
#endif
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