a5bd9f6
From 1fb2a38cdc4278a0c65e9b0cbca6fdaae3343564 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Colin Watson <cjwatson@ubuntu.com>
a5bd9f6
Date: Wed, 2 Jan 2013 16:42:48 +0000
a5bd9f6
Subject: [PATCH 077/364] * grub-core/tests/lib/test.c (grub_test_run): Return
a5bd9f6
 non-zero on test failures, so that a failing unit test correctly causes 'make
a5bd9f6
 check' to fail.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog                  |  6 ++++++
a5bd9f6
 grub-core/tests/lib/test.c | 14 +++++++++-----
a5bd9f6
 2 files changed, 15 insertions(+), 5 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index bb263f2..0585437 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,11 @@
a5bd9f6
 2013-01-02  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
 
a5bd9f6
+	* grub-core/tests/lib/test.c (grub_test_run): Return non-zero on
a5bd9f6
+	test failures, so that a failing unit test correctly causes 'make
a5bd9f6
+	check' to fail.
a5bd9f6
+
a5bd9f6
+2013-01-02  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
+
a5bd9f6
 	Fix failing printf test.
a5bd9f6
 
a5bd9f6
 	* grub-core/kern/misc.c (grub_vsnprintf_real): Parse '-', '.', and
a5bd9f6
diff --git a/grub-core/tests/lib/test.c b/grub-core/tests/lib/test.c
a5bd9f6
index aac77e9..1d2cb8c 100644
a5bd9f6
--- a/grub-core/tests/lib/test.c
a5bd9f6
+++ b/grub-core/tests/lib/test.c
a5bd9f6
@@ -225,10 +225,14 @@ grub_test_run (grub_test_t test)
a5bd9f6
 		 failure->line, (failure->message ? : "<no message>"));
a5bd9f6
 
a5bd9f6
   if (!failure_list)
a5bd9f6
-    grub_printf ("%s: PASS\n", test->name);
a5bd9f6
+    {
a5bd9f6
+      grub_printf ("%s: PASS\n", test->name);
a5bd9f6
+      return GRUB_ERR_NONE;
a5bd9f6
+    }
a5bd9f6
   else
a5bd9f6
-    grub_printf ("%s: FAIL\n", test->name);
a5bd9f6
-
a5bd9f6
-  free_failures ();
a5bd9f6
-  return GRUB_ERR_NONE;
a5bd9f6
+    {
a5bd9f6
+      grub_printf ("%s: FAIL\n", test->name);
a5bd9f6
+      free_failures ();
a5bd9f6
+      return GRUB_ERR_TEST_FAILURE;
a5bd9f6
+    }
a5bd9f6
 }
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6