grub2/0078-grub-core-tests-lib-test.c-grub_test_run-Return-non-.patch
Peter Jones f74b50e380 Rebase to upstream, fix a pile of bugs. The usual.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-06-12 15:37:08 -04:00

56 lines
1.6 KiB
Diff

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