]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/tests/lib/test.c (grub_test_run): Return non-zero on
authorColin Watson <cjwatson@ubuntu.com>
Wed, 2 Jan 2013 16:42:48 +0000 (16:42 +0000)
committerColin Watson <cjwatson@ubuntu.com>
Wed, 2 Jan 2013 16:42:48 +0000 (16:42 +0000)
test failures, so that a failing unit test correctly causes 'make
check' to fail.

ChangeLog
grub-core/tests/lib/test.c

index bb263f28118d40ac40b81337ee110f5e2317e9b4..058543705203465c3af840364fda41d88db2d052 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index aac77e9fc01038a07946c3fd12324654b68f756b..1d2cb8c6eb55f92a3bc74e41fda2c87e82c14c57 100644 (file)
@@ -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;
+    }
 }