6 #include "device-handler.h"
10 struct device_handler *handler;
11 struct discover_context *ctx;
18 /* interface required for parsers */
19 void __register_parser(struct parser *parser);
22 struct discover_device *test_create_device(struct discover_context *ctx,
25 #define test_read_conf_data(t, d) \
26 __test_read_conf_data(t, d, sizeof(d))
28 void __test_read_conf_data(struct parser_test *test,
29 const char *buf, size_t len);
30 void test_read_conf_file(struct parser_test *test, const char *filename);
32 int test_run_parser(struct parser_test *test, const char *parser_name);
34 struct discover_boot_option *get_boot_option(struct discover_context *ctx,
38 extern const char __embedded_config[];
39 extern const size_t __embedded_config_size;
40 #define test_read_conf_embedded(t) \
41 __test_read_conf_data(t, __embedded_config, __embedded_config_size)
44 * Checks for parser results.
46 * These return void, but will respond to check failures by printing a reason
47 * for the failure, and exit the test with a non-zero exit status.
51 * Check that we have an expected number of boot options parsed. If not,
52 * print out what we did find, then exit.
54 #define check_boot_option_count(ctx, count) \
55 __check_boot_option_count(ctx, count, __FILE__, __LINE__)
56 void __check_boot_option_count(struct discover_context *ctx, int count,
57 const char *file, int line);
59 #endif /* PARSER_TEST_H */