]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-single-line-if.c
discover/grub2: Allow to separate the --id argument using a space char
[petitboot] / test / parser / test-grub2-single-line-if.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 var=empty
6
7 if true; then var=true; else var=false; fi
8
9 menuentry "option $var" {
10         linux   /vmlinux
11 }
12 #endif
13
14 void run_test(struct parser_test *test)
15 {
16         struct discover_boot_option *opt;
17         struct discover_context *ctx;
18
19         test_read_conf_embedded(test, "/grub.cfg");
20
21         test_run_parser(test, "grub2");
22
23         ctx = test->ctx;
24
25         check_boot_option_count(ctx, 1);
26         opt = get_boot_option(ctx, 0);
27
28         check_name(opt, "option true");
29 }