Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: MIT
0002 
0003 /*
0004  * Copyright © 2019 Intel Corporation
0005  */
0006 
0007 #ifndef __SELFTEST_H__
0008 #define __SELFTEST_H__
0009 
0010 #include <linux/compiler.h>
0011 
0012 #define selftest(name, func) int func(void);
0013 #include "selftests.h"
0014 #undef selftest
0015 
0016 struct subtest {
0017     int (*func)(void *data);
0018     const char *name;
0019 };
0020 
0021 int __subtests(const char *caller,
0022            const struct subtest *st,
0023            int count,
0024            void *data);
0025 #define subtests(T, data) \
0026     __subtests(__func__, T, ARRAY_SIZE(T), data)
0027 
0028 #define SUBTEST(x) { x, #x }
0029 
0030 #endif /* __SELFTEST_H__ */