Lines Matching refs:test
6 #include <kunit/test.h>
18 * xe_kunit_helper_alloc_xe_device - Allocate a &xe_device for a KUnit test.
19 * @test: the &kunit where this &xe_device will be used
23 * The xe_device allocation is managed by the test.
31 struct xe_device *xe_kunit_helper_alloc_xe_device(struct kunit *test,
36 xe = drm_kunit_helper_alloc_drm_device(test, dev,
39 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xe);
46 struct kunit *test = kunit_get_current_test();
48 test->priv = priv;
52 * xe_kunit_helper_xe_device_test_init - Prepare a &xe_device for a KUnit test.
53 * @test: the &kunit where this fake &xe_device will be used
56 * pointer as &kunit.priv to allow the test code to access it.
69 int xe_kunit_helper_xe_device_test_init(struct kunit *test)
75 dev = drm_kunit_helper_alloc_device(test);
76 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev);
78 xe = xe_kunit_helper_alloc_xe_device(test, dev);
79 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xe);
82 KUNIT_ASSERT_EQ(test, err, 0);
84 err = kunit_add_action_or_reset(test, kunit_action_restore_priv, test->priv);
85 KUNIT_ASSERT_EQ(test, err, 0);
87 test->priv = xe;