]>
git.saurik.com Git - apple/hfs.git/blob - tests/hfs-tests.h
5 // Created by Chris Suter on 8/11/15.
12 #include <sys/cdefs.h>
17 typedef struct test_ctx
{
21 typedef int (* test_fn_t
)(test_ctx_t
*);
30 #define TEST_DECL(test_name, ...) \
31 static int run_##test_name(test_ctx_t *); \
32 struct test test_##test_name = { \
34 .test_fn = run_##test_name, \
37 static __attribute__((constructor)) \
38 void register_test_##test_name(void) { \
39 register_test(&test_##test_name); \
43 #define TEST(x, ...) TEST_DECL(x, ##__VA_ARGS__)
46 void register_test(test_t
*test
);
50 #endif /* hfs_tests_c */