zbyszek / rpms / grub2

Forked from rpms/grub2 5 years ago
Clone
31004e6
From 5a030df7b1a5e9a15689be38a09c7ff37d874fbc Mon Sep 17 00:00:00 2001
31004e6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
31004e6
Date: Fri, 3 May 2013 14:09:55 +0200
f74b50e
Subject: [PATCH 411/482] 	New series of tests for gfxterm and gfxmenu.
31004e6
31004e6
---
31004e6
 ChangeLog                             |   4 +
31004e6
 grub-core/Makefile.core.def           |   5 +
31004e6
 grub-core/tests/checksums.c           | 108 ++++++++++---
31004e6
 grub-core/tests/fake_input.c          |   2 +
31004e6
 grub-core/tests/gfxterm_menu.c        | 113 ++++++++++++++
31004e6
 grub-core/tests/lib/functional_test.c |   3 +-
31004e6
 grub-core/tests/video_checksum.c      | 204 ++++++++++++++++++++++++-
31004e6
 grub-core/tests/videotest_checksum.c  | 279 +---------------------------------
31004e6
 include/grub/test.h                   |   5 +
31004e6
 tests/util/grub-shell.in              |   3 +
31004e6
 10 files changed, 426 insertions(+), 300 deletions(-)
31004e6
 create mode 100644 grub-core/tests/gfxterm_menu.c
31004e6
31004e6
diff --git a/ChangeLog b/ChangeLog
31004e6
index ed99c80..5fc7372 100644
31004e6
--- a/ChangeLog
31004e6
+++ b/ChangeLog
31004e6
@@ -1,5 +1,9 @@
31004e6
 2013-05-03  Vladimir Serbinenko  <phcoder@gmail.com>
31004e6
 
31004e6
+	New series of tests for gfxterm and gfxmenu.
31004e6
+
31004e6
+2013-05-03  Vladimir Serbinenko  <phcoder@gmail.com>
31004e6
+
31004e6
 	* grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Allow specifying
31004e6
 	the theme path relative to $prefix/themes.
31004e6
 
31004e6
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
31004e6
index 2fa0ea7..da7637f 100644
31004e6
--- a/grub-core/Makefile.core.def
31004e6
+++ b/grub-core/Makefile.core.def
31004e6
@@ -1747,6 +1747,11 @@ module = {
31004e6
 };
31004e6
 
31004e6
 module = {
31004e6
+  name = gfxterm_menu;
31004e6
+  common = tests/gfxterm_menu.c;
31004e6
+};
31004e6
+
31004e6
+module = {
31004e6
   name = bitmap;
31004e6
   common = video/bitmap.c;
31004e6
   enable = videomodules;
31004e6
diff --git a/grub-core/tests/checksums.c b/grub-core/tests/checksums.c
31004e6
index 583c696..c2d2f5a 100644
31004e6
--- a/grub-core/tests/checksums.c
31004e6
+++ b/grub-core/tests/checksums.c
31004e6
@@ -1,30 +1,90 @@
31004e6
+  { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa14ad466, 0x69520db1, 0xa14ad466, 0xe82e990f, 0x59c36f00, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xa3faf149, 0xb4654ad0, 0xa3faf149, 0xff6942c6, 0xaa4593fe, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xd5e4100a, 0x39522e26, 0xd5e4100a, 0x2e0276, 0xc9cbf769, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xa14ad466, 0x69520db1, 0xa14ad466, 0xe82e990f, 0x59c36f00, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xa3faf149, 0xb4654ad0, 0xa3faf149, 0xff6942c6, 0xaa4593fe, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xd5e4100a, 0x39522e26, 0xd5e4100a, 0x2e0276, 0xc9cbf769, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x9093f849, 0xc02929e3, 0x9093f849, 0xe2f077d4, 0x5387d57f, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xbbe054f6, 0xbef13bfe, 0xbbe054f6, 0xa23fcfe0, 0xf83ee7aa, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x8cea8db2, 0x9688dd3b, 0x8cea8db2, 0x6fe82515, 0x724366e5, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x25e346a1, 0xbd5eb38b, 0x25e346a1, 0x9d469431, 0x5387d57f, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x6f33e7a0, 0x5716dafe, 0x6f33e7a0, 0xbfa18d18, 0xf83ee7aa, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xffb24323, 0x6e8fa0be, 0xffb24323, 0xad5c8fa5, 0x724366e5, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x5a925b39, 0x36226b, 0x5a925b39, 0xafa322b7, 0x1c955882, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xfb4aecf8, 0x17b91739, 0xfb4aecf8, 0xf7e3d211, 0x4d266f7a, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x4015c90f, 0x430ae98c, 0x4015c90f, 0xeb61f90d, 0x1ed9d731, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4df27666, 0xb8015ce1, 0x4df27666, 0x8bef2cac, 0x9813a416, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x6d1d5058, 0xb2d8ed2c, 0x6d1d5058, 0xe8936168, 0x5fcf013d, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeec86af1, 0x13493ea, 0xeec86af1, 0xee83739a, 0xdd28f52b, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x9093f849, 0xc02929e3, 0x9093f849, 0xe2f077d4, 0x5387d57f, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xbbe054f6, 0xbef13bfe, 0xbbe054f6, 0xa23fcfe0, 0xf83ee7aa, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x8cea8db2, 0x9688dd3b, 0x8cea8db2, 0x6fe82515, 0x724366e5, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x25e346a1, 0xbd5eb38b, 0x25e346a1, 0x9d469431, 0x5387d57f, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x6f33e7a0, 0x5716dafe, 0x6f33e7a0, 0xbfa18d18, 0xf83ee7aa, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xffb24323, 0x6e8fa0be, 0xffb24323, 0xad5c8fa5, 0x724366e5, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x5a925b39, 0x36226b, 0x5a925b39, 0xafa322b7, 0x1c955882, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xfb4aecf8, 0x17b91739, 0xfb4aecf8, 0xf7e3d211, 0x4d266f7a, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x4015c90f, 0x430ae98c, 0x4015c90f, 0xeb61f90d, 0x1ed9d731, }, 6 },
31004e6
+  { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x4df27666, 0xb8015ce1, 0x4df27666, 0x8bef2cac, 0x9813a416, }, 6 },
31004e6
+  { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x6d1d5058, 0xb2d8ed2c, 0x6d1d5058, 0xe8936168, 0x5fcf013d, }, 6 },
31004e6
+  { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeec86af1, 0x13493ea, 0xeec86af1, 0xee83739a, 0xdd28f52b, }, 6 },
31004e6
+  { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7a3f695f, 0xac449d41, 0x7a3f695f, 0x28a073b1, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2ee70aea, 0x8f5328d2, 0x2ee70aea, 0x19fb9508, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xef842e14, 0x9b7cdc00, 0xef842e14, 0x750c3145, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xcfa0e627, 0x8b7088da, 0xcfa0e627, 0xcd807142, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x64807934, 0x85d684c9, 0x64807934, 0x61726a79, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x9792b643, 0x1d769dd8, 0x9386dd8c, 0x9792b643, 0x3d74bd2f, }, 6 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xbdb8f583, 0x1e27b76, 0xbdb8f583, 0x91be6e17, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xbe72e1cb, 0x4943add3, 0xbe72e1cb, 0xa207f983, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xbc064047, 0x9e12d9ac, 0xbc064047, 0xf9bdce43, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x6181ad43, 0xe570d91, 0x6181ad43, 0x567fb1cc, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x1e5b6982, 0x789f961c, 0x1e5b6982, 0xc1ad694a, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x73f85cef, 0x9469d68d, 0x73f85cef, 0x24779078, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xa6ddcb95, 0xa3934314, 0xa6ddcb95, 0x16ab9b6c, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x18e25ecc, 0xe52f7def, 0x18e25ecc, 0x5bd10081, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xa845bba2, 0xb67fe791, 0xa845bba2, 0x80452493, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xf162dfa3, 0xe0f86fe6, 0xf162dfa3, 0x51f56384, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x644b801, 0x8a201b04, 0x644b801, 0xa4508ec0, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x1e1a41fe, 0x237e53c4, 0x1e1a41fe, 0xd5890062, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xa35a45c5, 0xacbc8410, 0xa35a45c5, 0xed2e11bd, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8a6fa170, 0x7605140e, 0x8a6fa170, 0xc030feb1, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x49ddd3e4, 0xbfaeedf9, 0x49ddd3e4, 0xcde1d4b5, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x98a8e7a8, 0xd9cab55f, 0x98a8e7a8, 0xf2b7dd05, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa000334f, 0xa1b11a86, 0xa000334f, 0x8ac1b99f, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xc662fb1, 0x673baf90, 0xc662fb1, 0xfb88406, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x33d4530e, 0x11ff262b, 0x33d4530e, 0xbb511beb, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x8b2e9364, 0x1d99d298, 0x8b2e9364, 0x958d5e8d, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x6e78baae, 0xaedcda00, 0x6e78baae, 0x9399bef9, }, 5 },
31004e6
+  { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x42860f9a, 0x57da9ef, 0x42860f9a, 0x221db42c, }, 5 },
31004e6
+  { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x2ade7eff, 0xc91e0e0c, 0x2ade7eff, 0x8ad4bad6, }, 5 },
31004e6
+  { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xef4a3312, 0x4c493c2d, 0x487c542b, 0x4c493c2d, 0xfec68cd6, }, 5 },
31004e6
   { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, }, 5 },
31004e6
   { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xff1957f0, 0xff1957f0, 0xff1957f0, 0xff1957f0, 0xff1957f0, }, 5 },
31004e6
   { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, }, 5 },
31004e6
   { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, }, 5 },
31004e6
   { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0x327d1082, 0x327d1082, 0x327d1082, 0x327d1082, 0x327d1082, }, 5 },
31004e6
   { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xadd0f186, 0xadd0f186, 0xadd0f186, 0xadd0f186, 0xadd0f186, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgb555 */, (grub_uint32_t []) { 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgb555 */, (grub_uint32_t []) { 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgb555 */, (grub_uint32_t []) { 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgb565 */, (grub_uint32_t []) { 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgb565 */, (grub_uint32_t []) { 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgb565 */, (grub_uint32_t []) { 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgb888 */, (grub_uint32_t []) { 0x61db45b7, 0x1d867efe, 0x99613325, 0xe53c086c, 0x9543de62, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgb888 */, (grub_uint32_t []) { 0xa46eb37f, 0xd2a59656, 0x49f8f92d, 0x3f33dc04, 0x7aae512a, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgb888 */, (grub_uint32_t []) { 0xb864a496, 0x6c22313b, 0x1505f93d, 0xc1436c90, 0xe74a6931, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgb888 */, (grub_uint32_t []) { 0x2b154617, 0x692e98df, 0xaf62fb87, 0xed59254f, 0x26164bc6, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgb888 */, (grub_uint32_t []) { 0x3b0fbc56, 0xd9d57c0e, 0xfb564a17, 0x198c8a4f, 0xbe502625, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgb888 */, (grub_uint32_t []) { 0x6e6c9b36, 0x4ae9f137, 0x27664f34, 0x3e32535, 0xfc793332, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgr555 */, (grub_uint32_t []) { 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgr555 */, (grub_uint32_t []) { 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgr555 */, (grub_uint32_t []) { 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgr565 */, (grub_uint32_t []) { 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgr565 */, (grub_uint32_t []) { 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgr565 */, (grub_uint32_t []) { 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgr888 */, (grub_uint32_t []) { 0x4af6b480, 0x923db79c, 0xfe8cc449, 0x2647c755, 0x27ee23e3, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgr888 */, (grub_uint32_t []) { 0x121d5e29, 0xf66c0aed, 0xdf138150, 0x3b62d594, 0x8dec962a, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgr888 */, (grub_uint32_t []) { 0xae86a12c, 0x4dabbe89, 0x6d30e897, 0x8e1df732, 0x2c0644ab, }, 5 },
31004e6
-  { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgr888 */, (grub_uint32_t []) { 0x2605d280, 0xc06e3172, 0xef3e6395, 0x9558067, 0xb19ec65b, }, 5 },
31004e6
-  { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgr888 */, (grub_uint32_t []) { 0x9404ef3b, 0xa4fdf18, 0xad7ef98c, 0x3335c9af, 0xe6f0c255, }, 5 },
31004e6
-  { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgr888 */, (grub_uint32_t []) { 0xa008b770, 0xb98eb0d8, 0x9304b820, 0x8a82bf88, 0xc610a9d0, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x61db45b7, 0x1d867efe, 0x99613325, 0xe53c086c, 0x9543de62, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xa46eb37f, 0xd2a59656, 0x49f8f92d, 0x3f33dc04, 0x7aae512a, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xb864a496, 0x6c22313b, 0x1505f93d, 0xc1436c90, 0xe74a6931, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x2b154617, 0x692e98df, 0xaf62fb87, 0xed59254f, 0x26164bc6, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x3b0fbc56, 0xd9d57c0e, 0xfb564a17, 0x198c8a4f, 0xbe502625, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0x6e6c9b36, 0x4ae9f137, 0x27664f34, 0x3e32535, 0xfc793332, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x4af6b480, 0x923db79c, 0xfe8cc449, 0x2647c755, 0x27ee23e3, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x121d5e29, 0xf66c0aed, 0xdf138150, 0x3b62d594, 0x8dec962a, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0xae86a12c, 0x4dabbe89, 0x6d30e897, 0x8e1df732, 0x2c0644ab, }, 5 },
31004e6
+  { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x2605d280, 0xc06e3172, 0xef3e6395, 0x9558067, 0xb19ec65b, }, 5 },
31004e6
+  { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x9404ef3b, 0xa4fdf18, 0xad7ef98c, 0x3335c9af, 0xe6f0c255, }, 5 },
31004e6
+  { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xa008b770, 0xb98eb0d8, 0x9304b820, 0x8a82bf88, 0xc610a9d0, }, 5 },
31004e6
diff --git a/grub-core/tests/fake_input.c b/grub-core/tests/fake_input.c
31004e6
index b514c2a..3c24e0f 100644
31004e6
--- a/grub-core/tests/fake_input.c
31004e6
+++ b/grub-core/tests/fake_input.c
31004e6
@@ -55,6 +55,7 @@ grub_terminal_input_fake_sequence (int *seq_in, int nseq_in)
31004e6
       grub_memcpy (seq, seq_in, nseq_in * sizeof (seq[0]));
31004e6
     }
31004e6
   nseq = nseq_in;
31004e6
+  seqptr = 0;
31004e6
 }
31004e6
 
31004e6
 void
31004e6
@@ -64,4 +65,5 @@ grub_terminal_input_fake_sequence_end (void)
31004e6
   grub_free (seq);
31004e6
   seq = 0;
31004e6
   nseq = 0;
31004e6
+  seqptr = 0;
31004e6
 }
31004e6
diff --git a/grub-core/tests/gfxterm_menu.c b/grub-core/tests/gfxterm_menu.c
31004e6
new file mode 100644
31004e6
index 0000000..e4aae12
31004e6
--- /dev/null
31004e6
+++ b/grub-core/tests/gfxterm_menu.c
31004e6
@@ -0,0 +1,113 @@
31004e6
+/*
31004e6
+ *  GRUB  --  GRand Unified Bootloader
31004e6
+ *  Copyright (C) 2013 Free Software Foundation, Inc.
31004e6
+ *
31004e6
+ *  GRUB is free software: you can redistribute it and/or modify
31004e6
+ *  it under the terms of the GNU General Public License as published by
31004e6
+ *  the Free Software Foundation, either version 3 of the License, or
31004e6
+ *  (at your option) any later version.
31004e6
+ *
31004e6
+ *  GRUB is distributed in the hope that it will be useful,
31004e6
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
31004e6
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31004e6
+ *  GNU General Public License for more details.
31004e6
+ *
31004e6
+ *  You should have received a copy of the GNU General Public License
31004e6
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
31004e6
+ */
31004e6
+
31004e6
+/* All tests need to include test.h for GRUB testing framework.  */
31004e6
+#include <grub/test.h>
31004e6
+#include <grub/dl.h>
31004e6
+#include <grub/video.h>
31004e6
+#include <grub/video_fb.h>
31004e6
+#include <grub/command.h>
31004e6
+#include <grub/font.h>
31004e6
+#include <grub/procfs.h>
31004e6
+#include <grub/env.h>
31004e6
+#include <grub/normal.h>
31004e6
+
31004e6
+GRUB_MOD_LICENSE ("GPLv3+");
31004e6
+
31004e6
+
31004e6
+static const char testfile[] =
31004e6
+  "terminal_output gfxterm\n"
31004e6
+  "menuentry \"test\" {\n"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  "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"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  "menuentry \" הַרמלל(טוֹבָ) לֶךְ\" --class opensuse --class linux --class os {\n"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  "menuentry \"الرملل جِداً لِكَ\" --class gentoo --class linux --class os {\n"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  "menuentry \"ὑπόγυͅον\" --class kubuntu --class linux --class os {\n"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  "menuentry \"سَّ نِّ نَّ نٌّ نّْ\" --class linuxmint --class linux --class os {\n"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  /* Chinese & UTF-8 test from Carbon Jiao. */
31004e6
+  "menuentry \"从硬盘的第一主分区启动\" --class \"windows xp\" --class windows --class os {\n"
31004e6
+  "\ttrue\n"
31004e6
+  "}\n"
31004e6
+  "timeout=3\n";
31004e6
+
31004e6
+static char *
31004e6
+get_test_cfg (void)
31004e6
+{
31004e6
+  return grub_strdup (testfile);
31004e6
+}
31004e6
+
31004e6
+struct grub_procfs_entry test_cfg = 
31004e6
+{
31004e6
+  .name = "test.cfg",
31004e6
+  .get_contents = get_test_cfg
31004e6
+};
31004e6
+
31004e6
+
31004e6
+/* Functional test main method.  */
31004e6
+static void
31004e6
+gfxterm_menu (void)
31004e6
+{
31004e6
+  unsigned i, j;
31004e6
+  if (grub_font_load ("unicode") == 0)
31004e6
+    {
31004e6
+      grub_test_assert (0, "unicode font not found: %s", grub_errmsg);
31004e6
+      return;
31004e6
+    }
31004e6
+
31004e6
+  grub_procfs_register ("test.cfg", &test_cfg);
31004e6
+  
31004e6
+  for (j = 0; j < 2; j++)
31004e6
+    for (i = 0; i < ARRAY_SIZE (grub_test_video_modes); i++)
31004e6
+      {
31004e6
+	grub_video_capture_start (&grub_test_video_modes[i],
31004e6
+				  grub_video_fbstd_colors,
31004e6
+				  grub_test_video_modes[i].number_of_colors);
31004e6
+	grub_terminal_input_fake_sequence ((int []) { -1, -1, -1, GRUB_TERM_KEY_DOWN, -1, '\e' }, 6);
31004e6
+
31004e6
+	grub_video_checksum (j ? "gfxmenu" : "gfxterm_menu");
31004e6
+
31004e6
+	grub_env_context_open ();
31004e6
+	if (j)
31004e6
+	  grub_env_set ("theme", "starfield/theme.txt");
31004e6
+	grub_normal_execute ("(proc)/test.cfg", 1, 0);
31004e6
+	grub_env_context_close ();
31004e6
+
31004e6
+	char *args[] = { (char *) "console", 0 };
31004e6
+	grub_command_execute ("terminal_output", 1, args);
31004e6
+
31004e6
+	grub_terminal_input_fake_sequence_end ();
31004e6
+	grub_video_checksum_end ();
31004e6
+	grub_video_capture_end ();
31004e6
+      }
31004e6
+
31004e6
+  grub_procfs_unregister (&test_cfg);
31004e6
+}
31004e6
+
31004e6
+/* Register example_test method as a functional test.  */
31004e6
+GRUB_FUNCTIONAL_TEST (gfxterm_menu, gfxterm_menu);
31004e6
diff --git a/grub-core/tests/lib/functional_test.c b/grub-core/tests/lib/functional_test.c
31004e6
index da4d5f8..c70e1ad 100644
31004e6
--- a/grub-core/tests/lib/functional_test.c
31004e6
+++ b/grub-core/tests/lib/functional_test.c
31004e6
@@ -51,9 +51,10 @@ grub_functional_all_tests (grub_extcmd_context_t ctxt __attribute__ ((unused)),
31004e6
 
31004e6
   grub_dl_load ("exfctest");
31004e6
   grub_dl_load ("videotest_checksum");
31004e6
+  grub_dl_load ("gfxterm_menu");
31004e6
 
31004e6
   FOR_LIST_ELEMENTS (test, grub_test_list)
31004e6
-    ok = ok && !grub_test_run (test);
31004e6
+    ok = !grub_test_run (test) && ok;
31004e6
   if (ok)
31004e6
     grub_printf ("ALL TESTS PASSED\n");
31004e6
   else
31004e6
diff --git a/grub-core/tests/video_checksum.c b/grub-core/tests/video_checksum.c
31004e6
index cf47fa2..c678059 100644
31004e6
--- a/grub-core/tests/video_checksum.c
31004e6
+++ b/grub-core/tests/video_checksum.c
31004e6
@@ -31,6 +31,208 @@ static char *basename;
31004e6
 static const grub_uint32_t *checksums;
31004e6
 static struct grub_video_mode_info capt_mode_info;
31004e6
 
31004e6
+struct grub_video_mode_info grub_test_video_modes[30] = {
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 640,
31004e6
+    .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
+    .bpp = 8,
31004e6
+    .bytes_per_pixel = 1,
31004e6
+    .number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 800,
31004e6
+    .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
+    .bpp = 8,
31004e6
+    .bytes_per_pixel = 1,
31004e6
+    .number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 1024,
31004e6
+    .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
+    .bpp = 8,
31004e6
+    .bytes_per_pixel = 1,
31004e6
+    .number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 640,
31004e6
+    .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
+    .bpp = 8,
31004e6
+    .bytes_per_pixel = 1,
31004e6
+    .number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 800,
31004e6
+    .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
+    .bpp = 8,
31004e6
+    .bytes_per_pixel = 1,
31004e6
+    .number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 1024,
31004e6
+    .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
+    .bpp = 8,
31004e6
+    .bytes_per_pixel = 1,
31004e6
+    .number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 1280,
31004e6
+    GRUB_VIDEO_MI_RGB555 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 1600,
31004e6
+    GRUB_VIDEO_MI_RGB555 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 2048,
31004e6
+    GRUB_VIDEO_MI_RGB555 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 1280,
31004e6
+    GRUB_VIDEO_MI_RGB565 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 1600,
31004e6
+    GRUB_VIDEO_MI_RGB565 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 2048,
31004e6
+    GRUB_VIDEO_MI_RGB565 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 640 * 3,
31004e6
+    GRUB_VIDEO_MI_RGB888 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 800 * 3,
31004e6
+    GRUB_VIDEO_MI_RGB888 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 1024 * 3,
31004e6
+    GRUB_VIDEO_MI_RGB888 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 640 * 4,
31004e6
+    GRUB_VIDEO_MI_RGBA8888()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 800 * 4,
31004e6
+    GRUB_VIDEO_MI_RGBA8888()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 1024 * 4,
31004e6
+    GRUB_VIDEO_MI_RGBA8888()
31004e6
+  },
31004e6
+
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 1280,
31004e6
+    GRUB_VIDEO_MI_BGR555 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 1600,
31004e6
+    GRUB_VIDEO_MI_BGR555 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 2048,
31004e6
+    GRUB_VIDEO_MI_BGR555 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 1280,
31004e6
+    GRUB_VIDEO_MI_BGR565 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 1600,
31004e6
+    GRUB_VIDEO_MI_BGR565 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 2048,
31004e6
+    GRUB_VIDEO_MI_BGR565 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 640 * 3,
31004e6
+    GRUB_VIDEO_MI_BGR888 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 800 * 3,
31004e6
+    GRUB_VIDEO_MI_BGR888 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 1024 * 3,
31004e6
+    GRUB_VIDEO_MI_BGR888 ()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 640,
31004e6
+    .height = 480,
31004e6
+    .pitch = 640 * 4,
31004e6
+    GRUB_VIDEO_MI_BGRA8888()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 800,
31004e6
+    .height = 600,
31004e6
+    .pitch = 800 * 4,
31004e6
+    GRUB_VIDEO_MI_BGRA8888()
31004e6
+  },
31004e6
+  {
31004e6
+    .width = 1024,
31004e6
+    .height = 768,
31004e6
+    .pitch = 1024 * 4,
31004e6
+    GRUB_VIDEO_MI_BGRA8888()
31004e6
+  },
31004e6
+};
31004e6
+
31004e6
 #ifdef GRUB_MACHINE_EMU
31004e6
 #include <grub/emu/misc.h>
31004e6
 #include <sys/types.h>
31004e6
@@ -262,7 +464,7 @@ get_modename (void)
31004e6
   return buf;
31004e6
 }
31004e6
 
31004e6
-//#define GENERATE_MODE 1
31004e6
+#define GENERATE_MODE 1
31004e6
 
31004e6
 #if defined (GENERATE_MODE) && defined (GRUB_MACHINE_EMU)
31004e6
 int genfd = -1;
31004e6
diff --git a/grub-core/tests/videotest_checksum.c b/grub-core/tests/videotest_checksum.c
31004e6
index 7833d04..ee7058f 100644
31004e6
--- a/grub-core/tests/videotest_checksum.c
31004e6
+++ b/grub-core/tests/videotest_checksum.c
31004e6
@@ -26,292 +26,23 @@
31004e6
 
31004e6
 GRUB_MOD_LICENSE ("GPLv3+");
31004e6
 
31004e6
-struct
31004e6
-{
31004e6
-  struct grub_video_mode_info mode_info;
31004e6
-} tests[] = {
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 640,
31004e6
-	.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
-	.bpp = 8,
31004e6
-	.bytes_per_pixel = 1,
31004e6
-	.number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 800,
31004e6
-	.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
-	.bpp = 8,
31004e6
-	.bytes_per_pixel = 1,
31004e6
-	.number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 1024,
31004e6
-	.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
-	.bpp = 8,
31004e6
-	.bytes_per_pixel = 1,
31004e6
-	.number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS
31004e6
-      },
31004e6
-    },
31004e6
-
31004e6
-
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 640,
31004e6
-	.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
-	.bpp = 8,
31004e6
-	.bytes_per_pixel = 1,
31004e6
-	.number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 800,
31004e6
-	.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
-	.bpp = 8,
31004e6
-	.bytes_per_pixel = 1,
31004e6
-	.number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 1024,
31004e6
-	.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR,
31004e6
-	.bpp = 8,
31004e6
-	.bytes_per_pixel = 1,
31004e6
-	.number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS
31004e6
-      },
31004e6
-    },
31004e6
-
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 1280,
31004e6
-	GRUB_VIDEO_MI_RGB555 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 1600,
31004e6
-	GRUB_VIDEO_MI_RGB555 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 2048,
31004e6
-	GRUB_VIDEO_MI_RGB555 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 1280,
31004e6
-	GRUB_VIDEO_MI_RGB565 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 1600,
31004e6
-	GRUB_VIDEO_MI_RGB565 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 2048,
31004e6
-	GRUB_VIDEO_MI_RGB565 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 640 * 3,
31004e6
-	GRUB_VIDEO_MI_RGB888 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 800 * 3,
31004e6
-	GRUB_VIDEO_MI_RGB888 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 1024 * 3,
31004e6
-	GRUB_VIDEO_MI_RGB888 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 640 * 4,
31004e6
-	GRUB_VIDEO_MI_RGBA8888()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 800 * 4,
31004e6
-	GRUB_VIDEO_MI_RGBA8888()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 1024 * 4,
31004e6
-	GRUB_VIDEO_MI_RGBA8888()
31004e6
-      },
31004e6
-    },
31004e6
-
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 1280,
31004e6
-	GRUB_VIDEO_MI_BGR555 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 1600,
31004e6
-	GRUB_VIDEO_MI_BGR555 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 2048,
31004e6
-	GRUB_VIDEO_MI_BGR555 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 1280,
31004e6
-	GRUB_VIDEO_MI_BGR565 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 1600,
31004e6
-	GRUB_VIDEO_MI_BGR565 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 2048,
31004e6
-	GRUB_VIDEO_MI_BGR565 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 640 * 3,
31004e6
-	GRUB_VIDEO_MI_BGR888 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 800 * 3,
31004e6
-	GRUB_VIDEO_MI_BGR888 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 1024 * 3,
31004e6
-	GRUB_VIDEO_MI_BGR888 ()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 640,
31004e6
-	.height = 480,
31004e6
-	.pitch = 640 * 4,
31004e6
-	GRUB_VIDEO_MI_BGRA8888()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 800,
31004e6
-	.height = 600,
31004e6
-	.pitch = 800 * 4,
31004e6
-	GRUB_VIDEO_MI_BGRA8888()
31004e6
-      },
31004e6
-    },
31004e6
-    {
31004e6
-      .mode_info = {
31004e6
-	.width = 1024,
31004e6
-	.height = 768,
31004e6
-	.pitch = 1024 * 4,
31004e6
-	GRUB_VIDEO_MI_BGRA8888()
31004e6
-      },
31004e6
-    },
31004e6
-
31004e6
-  };
31004e6
-      
31004e6
-
31004e6
 /* Functional test main method.  */
31004e6
 static void
31004e6
 videotest_checksum (void)
31004e6
 {
31004e6
   unsigned i;
31004e6
+
31004e6
   if (grub_font_load ("unicode") == 0)
31004e6
     {
31004e6
       grub_test_assert (0, "unicode font not found: %s", grub_errmsg);
31004e6
       return;
31004e6
     }
31004e6
-  
31004e6
-  for (i = 0; i < ARRAY_SIZE (tests); i++)
31004e6
+
31004e6
+  for (i = 0; i < ARRAY_SIZE (grub_test_video_modes); i++)
31004e6
     {
31004e6
-      grub_video_capture_start (&tests[i].mode_info,
31004e6
+      grub_video_capture_start (&grub_test_video_modes[i],
31004e6
 				grub_video_fbstd_colors,
31004e6
-				tests[i].mode_info.number_of_colors);
31004e6
+				grub_test_video_modes[i].number_of_colors);
31004e6
       grub_terminal_input_fake_sequence ((int []) { '\n' }, 1);
31004e6
 
31004e6
       grub_video_checksum ("videotest");
31004e6
diff --git a/include/grub/test.h b/include/grub/test.h
31004e6
index 6aa4069..946a81b 100644
31004e6
--- a/include/grub/test.h
31004e6
+++ b/include/grub/test.h
31004e6
@@ -25,6 +25,9 @@
31004e6
 #include <grub/types.h>
31004e6
 #include <grub/symbol.h>
31004e6
 
31004e6
+#include <grub/video.h>
31004e6
+#include <grub/video_fb.h>
31004e6
+
31004e6
 struct grub_test
31004e6
 {
31004e6
   /* The next test.  */
31004e6
@@ -99,4 +102,6 @@ grub_terminal_input_fake_sequence (int *seq_in, int nseq_in);
31004e6
 void
31004e6
 grub_terminal_input_fake_sequence_end (void);
31004e6
 
31004e6
+extern struct grub_video_mode_info grub_test_video_modes[30];
31004e6
+
31004e6
 #endif /* ! GRUB_TEST_HEADER */
31004e6
diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
31004e6
index dfde836..dee3962 100644
31004e6
--- a/tests/util/grub-shell.in
31004e6
+++ b/tests/util/grub-shell.in
31004e6
@@ -22,6 +22,7 @@ prefix="@prefix@"
31004e6
 exec_prefix="@exec_prefix@"
31004e6
 datarootdir="@datarootdir@"
31004e6
 builddir="@builddir@"
31004e6
+srcdir="@srcdir@"
31004e6
 PACKAGE_NAME=@PACKAGE_NAME@
31004e6
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
31004e6
 PACKAGE_VERSION=@PACKAGE_VERSION@
31004e6
@@ -409,7 +410,9 @@ if [ x$boot = xnet ]; then
31004e6
 elif [ x$boot = xemu ]; then
31004e6
     grubdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")"
31004e6
     mkdir -p "$grubdir/fonts"
31004e6
+    mkdir -p "$grubdir/themes"
31004e6
     cp "@builddir@/"unicode.pf2 "$grubdir/fonts/unicode.pf2"
31004e6
+    cp -R "@srcdir@/themes/starfield" "$grubdir/themes/starfield"
31004e6
     cp "${cfgfile}" "$grubdir/grub.cfg"
31004e6
     cp "${source}" "$grubdir/testcase.cfg"
31004e6
     @builddir@/grub-core/grub-emu -m "$device_map" -d "$grubdir" | tr -d "\r" | do_trim
31004e6
-- 
31004e6
1.8.2.1
31004e6