From c3fc8394a0a34455e919ac97c499290f168764bc Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 2 Jan 2013 16:42:48 +0000 Subject: [PATCH] * 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 bb263f281..058543705 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-01-02 Colin Watson + + * 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 Fix failing printf test. diff --git a/grub-core/tests/lib/test.c b/grub-core/tests/lib/test.c index aac77e9fc..1d2cb8c6e 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 ? : "")); 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; + } }