diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-19 11:59:26 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-19 19:01:34 +0200 |
commit | 9536b64ac0d6e3151963a11441dde7ade045fb29 (patch) | |
tree | fa992f4f91d0b5052157727c9ef5ebe0e4c356e0 /drivers/dma-buf/selftests.h | |
parent | drm/panfrost: Remove opp table when unloading (diff) | |
download | linux-9536b64ac0d6e3151963a11441dde7ade045fb29.tar.xz linux-9536b64ac0d6e3151963a11441dde7ade045fb29.zip |
dma-buf: Introduce selftesting framework
In light of recent review slip ups, the absence of a suite of tests for
dma-buf became apparent. Given the current plethora of testing
frameworks, opt for one already in use by Intel's CI and so allow easy
hook up into igt.
We introduce a new module that when loaded will execute the list of
selftests and their subtest. The names of the selftests are put into the
modinfo as parameters so that igt can identify each, and run them
independently, principally for ease of error reporting.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190819095928.32091-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/dma-buf/selftests.h')
-rw-r--r-- | drivers/dma-buf/selftests.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dma-buf/selftests.h b/drivers/dma-buf/selftests.h new file mode 100644 index 000000000000..44b44390d23a --- /dev/null +++ b/drivers/dma-buf/selftests.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +/* List each unit test as selftest(name, function) + * + * The name is used as both an enum and expanded as subtest__name to create + * a module parameter. It must be unique and legal for a C identifier. + * + * The function should be of type int function(void). It may be conditionally + * compiled using #if IS_ENABLED(DRM_I915_SELFTEST). + * + * Tests are executed in order by igt/dmabuf_selftest + */ +selftest(sanitycheck, __sanitycheck__) /* keep first (igt selfcheck) */ |