discover: Reimplement native-parser as a Bison parser
[petitboot] / test / parser / test-native-simple.c
1 #include "parser-test.h"
2
3 #if 0 /* PARSER_EMBEDDED_CONFIG */
4
5 name native-option
6 image /vmlinuz
7 args console=hvc0
8 initrd /initrd
9
10 #endif
11
12 void run_test(struct parser_test *test)
13 {
14         struct discover_boot_option *opt;
15         struct discover_context *ctx;
16
17         test_read_conf_embedded(test, "/boot/petitboot.conf");
18
19         test_run_parser(test, "native");
20
21         ctx = test->ctx;
22
23         check_boot_option_count(ctx, 1);
24
25         opt = get_boot_option(ctx, 0);
26
27         check_name(opt, "native-option");
28         check_resolved_local_resource(opt->boot_image, ctx->device, "/vmlinuz");
29         check_args(opt, "console=hvc0");
30         check_resolved_local_resource(opt->initrd, ctx->device, "/initrd");
31 }