From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH] Disable gfxterm_menu and cmdline_cat tests
Date: Tue, 8 Apr 2025 18:51:38 +0000 [thread overview]
Message-ID: <20250408185150.3523786-1-phcoder@gmail.com> (raw)
Those tests fail depending on the version of unifont. As we don't distribute
our own unifont it fails for most users. Disable them so that they don't mask
real failures. They can be reinstated once we solve unifont problem
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
grub-core/Makefile.core.def | 10 --
grub-core/tests/cmdline_cat_test.c | 125 --------------------
| 180 -----------------------------
3 files changed, 315 deletions(-)
delete mode 100644 grub-core/tests/cmdline_cat_test.c
delete mode 100644 grub-core/tests/gfxterm_menu.c
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 56e407376..91c7e1a8a 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -2269,16 +2269,6 @@ module = {
common = tests/videotest_checksum.c;
};
-module = {
- name = gfxterm_menu;
- common = tests/gfxterm_menu.c;
-};
-
-module = {
- name = cmdline_cat_test;
- common = tests/cmdline_cat_test.c;
-};
-
module = {
name = bitmap;
common = video/bitmap.c;
diff --git a/grub-core/tests/cmdline_cat_test.c b/grub-core/tests/cmdline_cat_test.c
deleted file mode 100644
index 4748d1bb0..000000000
--- a/grub-core/tests/cmdline_cat_test.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * GRUB -- GRand Unified Bootloader
- * Copyright (C) 2013 Free Software Foundation, Inc.
- *
- * GRUB is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GRUB is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* All tests need to include test.h for GRUB testing framework. */
-#include <grub/test.h>
-#include <grub/dl.h>
-#include <grub/video.h>
-#include <grub/video_fb.h>
-#include <grub/command.h>
-#include <grub/font.h>
-#include <grub/procfs.h>
-#include <grub/env.h>
-#include <grub/normal.h>
-#include <grub/time.h>
-
-GRUB_MOD_LICENSE ("GPLv3+");
-
-
-static const char testfile[] =
- /* Chinese & UTF-8 test from Carbon Jiao. */
- "从硬盘的第一主分区启动\n"
- "The quick brown fox jumped over the lazy dog.\n"
- /* Characters used:
- Code point Description UTF-8 encoding
- ----------- ------------------------------ --------------
- U+263A unfilled smiley face E2 98 BA
- U+00A1 inverted exclamation point C2 A1
- U+00A3 British pound currency symbol C2 A3
- U+03C4 Greek tau CF 84
- U+00E4 lowercase letter a with umlaut C3 A4
- U+2124 set 'Z' symbol (integers) E2 84 A4
- U+2286 subset symbol E2 8A 86
- U+211D set 'R' symbol (real numbers) E2 84 9D */
- "Unicode test: happy\xE2\x98\xBA \xC2\xA3 5.00"
- " \xC2\xA1\xCF\x84\xC3\xA4u! "
- " \xE2\x84\xA4\xE2\x8A\x86\xE2\x84\x9D\n"
- /* Test handling of bad (non-UTF8) sequences*/
- "\x99Hello\xc2Hello\xc1\x81Hello\n";
-;
-
-static char *
-get_test_txt (grub_size_t *sz)
-{
- *sz = grub_strlen (testfile);
- return grub_strdup (testfile);
-}
-
-struct grub_procfs_entry test_txt =
-{
- .name = "test.txt",
- .get_contents = get_test_txt
-};
-
-#define FONT_NAME "Unknown Regular 16"
-
-/* Functional test main method. */
-static void
-cmdline_cat_test (void)
-{
- unsigned i;
- grub_font_t font;
-
- grub_dl_load ("gfxterm");
- grub_errno = GRUB_ERR_NONE;
-
- font = grub_font_get (FONT_NAME);
- if (font && grub_strcmp (font->name, FONT_NAME) != 0)
- font = 0;
- if (!font)
- font = grub_font_load ("unicode");
-
- if (!font)
- {
- grub_test_assert (0, "unicode font not found: %s", grub_errmsg);
- return;
- }
-
- grub_procfs_register ("test.txt", &test_txt);
-
- for (i = 0; i < GRUB_TEST_VIDEO_SMALL_N_MODES; i++)
- {
- grub_video_capture_start (&grub_test_video_modes[i],
- grub_video_fbstd_colors,
- grub_test_video_modes[i].number_of_colors);
- grub_terminal_input_fake_sequence ((int [])
- { 'c', 'a', 't', ' ',
- '(', 'p', 'r', 'o', 'c', ')',
- '/', 't', 'e', 's', 't', '.',
- 't', 'x', 't', '\n',
- GRUB_TERM_NO_KEY,
- GRUB_TERM_NO_KEY, GRUB_TERM_ESC},
- 23);
-
- grub_video_checksum ("cmdline_cat");
-
- if (!grub_test_use_gfxterm ())
- grub_cmdline_run (1, 0);
-
- grub_test_use_gfxterm_end ();
-
- grub_terminal_input_fake_sequence_end ();
- grub_video_checksum_end ();
- grub_video_capture_end ();
- }
-
- grub_procfs_unregister (&test_txt);
-}
-
-/* Register example_test method as a functional test. */
-GRUB_FUNCTIONAL_TEST (cmdline_cat_test, cmdline_cat_test);
diff --git a/grub-core/tests/gfxterm_menu.c b/grub-core/tests/gfxterm_menu.c
deleted file mode 100644
index ea4352703..000000000
--- a/grub-core/tests/gfxterm_menu.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * GRUB -- GRand Unified Bootloader
- * Copyright (C) 2013 Free Software Foundation, Inc.
- *
- * GRUB is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GRUB is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* All tests need to include test.h for GRUB testing framework. */
-#include <grub/test.h>
-#include <grub/dl.h>
-#include <grub/video.h>
-#include <grub/video_fb.h>
-#include <grub/command.h>
-#include <grub/font.h>
-#include <grub/procfs.h>
-#include <grub/env.h>
-#include <grub/normal.h>
-#include <grub/time.h>
-
-GRUB_MOD_LICENSE ("GPLv3+");
-
-
-static const char testfile[] =
- "menuentry \"test\" {\n"
- "\ttrue\n"
- "}\n"
- "menuentry \"s̛ ơ t o̒ s̒ u o̕̚ 8.04 m̂ñåh̊z̆x̣ a̡ b̢g̢ u᷎ô᷎ ô᷎ O̷ a̖̣ ȃ̐\" --class ubuntu --class linux --class os {\n"
- "\ttrue\n"
- "}\n"
- "menuentry \" הַרמלל(טוֹבָ) לֶךְ\" --class opensuse --class linux --class os {\n"
- "\ttrue\n"
- "}\n"
- "menuentry \"الرملل جِداً لِكَ\" --class gentoo --class linux --class os {\n"
- "\ttrue\n"
- "}\n"
- "menuentry \"ὑπόγυͅον\" --class kubuntu --class linux --class os {\n"
- "\ttrue\n"
- "}\n"
- "menuentry \"سَّ نِّ نَّ نٌّ نّْ\" --class linuxmint --class linux --class os {\n"
- "\ttrue\n"
- "}\n"
- /* Chinese & UTF-8 test from Carbon Jiao. */
- "menuentry \"从硬盘的第一主分区启动\" --class \"windows xp\" --class windows --class os {\n"
- "\ttrue\n"
- "}\n"
- "timeout=3\n";
-
-static char *
-get_test_cfg (grub_size_t *sz)
-{
- *sz = grub_strlen (testfile);
- return grub_strdup (testfile);
-}
-
-struct grub_procfs_entry test_cfg =
-{
- .name = "test.cfg",
- .get_contents = get_test_cfg
-};
-
-struct
-{
- const char *name;
- const char *var;
- const char *val;
-} tests[] =
- {
- { "gfxterm_menu", NULL, NULL },
- { "gfxmenu", "theme", "starfield/theme.txt" },
- { "gfxterm_ar", "lang", "en@arabic" },
- { "gfxterm_cyr", "lang", "en@cyrillic" },
- { "gfxterm_heb", "lang", "en@hebrew" },
- { "gfxterm_gre", "lang", "en@greek" },
- { "gfxterm_ru", "lang", "ru" },
- { "gfxterm_fr", "lang", "fr" },
- { "gfxterm_quot", "lang", "en@quot" },
- { "gfxterm_piglatin", "lang", "en@piglatin" },
- { "gfxterm_ch", "lang", "de_CH" },
- { "gfxterm_red", "menu_color_normal", "red/blue" },
- { "gfxterm_high", "menu_color_highlight", "blue/red" },
- };
-
-#define FONT_NAME "Unknown Regular 16"
-
-/* Functional test main method. */
-static void
-gfxterm_menu (void)
-{
- unsigned i, j;
- grub_font_t font;
-
- grub_dl_load ("png");
- grub_dl_load ("gettext");
- grub_dl_load ("gfxterm");
-
- grub_errno = GRUB_ERR_NONE;
-
- grub_dl_load ("gfxmenu");
-
- font = grub_font_get (FONT_NAME);
- if (font && grub_strcmp (font->name, FONT_NAME) != 0)
- font = 0;
- if (!font)
- font = grub_font_load ("unicode");
-
- if (!font)
- {
- grub_test_assert (0, "unicode font not found: %s", grub_errmsg);
- return;
- }
-
- grub_procfs_register ("test.cfg", &test_cfg);
-
- for (j = 0; j < ARRAY_SIZE (tests); j++)
- for (i = 0; i < GRUB_TEST_VIDEO_SMALL_N_MODES; i++)
- {
- grub_uint64_t start;
-
-#if defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_IEEE1275)
- if (grub_test_video_modes[i].width > 1024)
- continue;
- if (grub_strcmp (tests[j].name, "gfxmenu") == 0
- && grub_test_video_modes[i].width > 800)
- continue;
-#endif
- start = grub_get_time_ms ();
-
- grub_video_capture_start (&grub_test_video_modes[i],
- grub_video_fbstd_colors,
- grub_test_video_modes[i].number_of_colors);
- if (grub_errno)
- {
- grub_test_assert (0, "can't start capture: %d: %s",
- grub_errno, grub_errmsg);
- return;
- }
- grub_terminal_input_fake_sequence ((int []) { -1, -1, -1, GRUB_TERM_KEY_DOWN, -1, 'e',
- -1, GRUB_TERM_KEY_RIGHT, -1, 'x', -1, GRUB_TERM_ESC, -1, GRUB_TERM_ESC }, 14);
-
- grub_video_checksum (tests[j].name);
-
- if (grub_test_use_gfxterm ())
- return;
-
- grub_env_context_open ();
- if (tests[j].var)
- grub_env_set (tests[j].var, tests[j].val);
- grub_normal_execute ("(proc)/test.cfg", 1, 0);
- grub_env_context_close ();
-
- grub_test_use_gfxterm_end ();
-
- grub_terminal_input_fake_sequence_end ();
- grub_video_checksum_end ();
- grub_video_capture_end ();
-
- if (tests[j].var)
- grub_env_unset (tests[j].var);
- grub_printf ("%s %dx%dx%s done %lld ms\n", tests[j].name,
- grub_test_video_modes[i].width,
- grub_test_video_modes[i].height,
- grub_video_checksum_get_modename (), (long long) (grub_get_time_ms () - start));
- }
-
- grub_procfs_unregister (&test_cfg);
-}
-
-/* Register example_test method as a functional test. */
-GRUB_FUNCTIONAL_TEST (gfxterm_menu, gfxterm_menu);
--
2.49.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2025-04-08 18:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 18:51 Vladimir Serbinenko [this message]
2025-04-23 22:27 ` [PATCH] Disable gfxterm_menu and cmdline_cat tests Glenn Washburn
2025-05-05 21:03 ` Glenn Washburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250408185150.3523786-1-phcoder@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.