mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
Instead of iterating over available Xe devices within a testcase,
without being able to distinguish potential failures from different
devices on system with many Xe devices, introduce helpers that will
allow to treat each Xe device as a parameter for the testcase like:
static void bar(struct kunit *test)
{
struct xe_device *xe = test->priv;
...
}
struct kunit_case foo_live_tests[] = {
KUNIT_CASE_PARAM(bar, xe_pci_live_device_gen_param),
{}
};
struct kunit_suite foo_suite = {
.name = "foo_live",
.test_cases = foo_live_tests,
.init = xe_kunit_helper_xe_device_live_test_init,
};
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240720142528.530-3-michal.wajdeczko@intel.com
20 lines
436 B
C
20 lines
436 B
C
/* SPDX-License-Identifier: GPL-2.0 AND MIT */
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_KUNIT_HELPERS_H_
|
|
#define _XE_KUNIT_HELPERS_H_
|
|
|
|
struct device;
|
|
struct kunit;
|
|
struct xe_device;
|
|
|
|
struct xe_device *xe_kunit_helper_alloc_xe_device(struct kunit *test,
|
|
struct device *dev);
|
|
int xe_kunit_helper_xe_device_test_init(struct kunit *test);
|
|
|
|
int xe_kunit_helper_xe_device_live_test_init(struct kunit *test);
|
|
|
|
#endif
|