mirror of
https://github.com/torvalds/linux.git
synced 2026-11-25 07:52:34 +00:00
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 <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Tomi Sarvela <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
31 lines
549 B
C
31 lines
549 B
C
// SPDX-License-Identifier: MIT
|
|
|
|
/*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __SELFTEST_H__
|
|
#define __SELFTEST_H__
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#define selftest(name, func) int func(void);
|
|
#include "selftests.h"
|
|
#undef selftest
|
|
|
|
struct subtest {
|
|
int (*func)(void *data);
|
|
const char *name;
|
|
};
|
|
|
|
int __subtests(const char *caller,
|
|
const struct subtest *st,
|
|
int count,
|
|
void *data);
|
|
#define subtests(T, data) \
|
|
__subtests(__func__, T, ARRAY_SIZE(T), data)
|
|
|
|
#define SUBTEST(x) { x, #x }
|
|
|
|
#endif /* __SELFTEST_H__ */
|