summaryrefslogtreecommitdiffstats
path: root/test/parser/test-grub2-search-args.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/parser/test-grub2-search-args.c')
-rw-r--r--test/parser/test-grub2-search-args.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/parser/test-grub2-search-args.c b/test/parser/test-grub2-search-args.c
new file mode 100644
index 0000000..ffce853
--- /dev/null
+++ b/test/parser/test-grub2-search-args.c
@@ -0,0 +1,33 @@
+
+/* check for multiple styles of option parsing for the 'search' command */
+
+#include "parser-test.h"
+
+#if 0 /* PARSER_EMBEDDED_CONFIG */
+
+# no --set arugment will set the 'root' var
+search a
+search --set=v1 b
+search --set v2 c
+
+menuentry $root$v1$v2 {
+ linux /vmlinux
+}
+
+#endif
+
+void run_test(struct parser_test *test)
+{
+ struct discover_boot_option *opt;
+ struct discover_context *ctx;
+
+ ctx = test->ctx;
+
+ test_read_conf_embedded(test, "/grub/grub.cfg");
+
+ test_run_parser(test, "grub2");
+
+ check_boot_option_count(ctx, 1);
+ opt = get_boot_option(ctx, 0);
+ check_name(opt, "abc");
+}
OpenPOWER on IntegriCloud