]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-28 Robert Millan <rmh.grub@aybabtu.com>
authorRobert Millan <rmh@aybabtu.com>
Thu, 28 Jan 2010 15:27:41 +0000 (15:27 +0000)
committerRobert Millan <rmh@aybabtu.com>
Thu, 28 Jan 2010 15:27:41 +0000 (15:27 +0000)
* Makefile.in (check): Exit with fail status when one of the tests
fails.
* tests/example_functional_test.c (example_test): Fix reversed assert.
* tests/example_unit_test.c (example_test): Likewise.

ChangeLog
Makefile.in
tests/example_functional_test.c
tests/example_unit_test.c

index 59e46f12455de06753b4ed3dd6ff4af79c182a52..d40f765a7261bd2e5e4c04440c9f5fcfc020417b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-28  Robert Millan  <rmh.grub@aybabtu.com>
+
+       * Makefile.in (check): Exit with fail status when one of the tests
+       fails.
+       * tests/example_functional_test.c (example_test): Fix reversed assert.
+       * tests/example_unit_test.c (example_test): Likewise.
+
 2010-01-28  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/grub.d/10_linux.in: This script does not use any of the
index d0bbe3b25b05bed9da91a2c959e661897230a826..aa03002f493c5022c80981e2efaebdfdc74e9f28 100644 (file)
@@ -473,23 +473,21 @@ distcheck: dist
 
 check: all $(UNIT_TESTS) $(FUNCTIONAL_TESTS) $(SCRIPTED_TESTS)
        @list="$(UNIT_TESTS)"; \
+       set -e; \
        for file in $$list; do \
          $(builddir)/$$file; \
        done
        @list="$(FUNCTIONAL_TESTS)"; \
+       set -e; \
        for file in $$list; do \
          mod=`basename $$file .mod`; \
          echo "insmod functional_test; insmod $$mod; functional_test" \
            | $(builddir)/grub-shell; \
        done
        @list="$(SCRIPTED_TESTS)"; \
+       set -e; \
        for file in $$list; do \
-         echo "$$file:"; \
-         if $(builddir)/$$file; then \
-           echo "$$file: PASS"; \
-         else \
-           echo "$$file: FAIL"; \
-         fi; \
+         $(builddir)/$$file; \
        done
 
 .SUFFIX:
index f43c0f1ce21400b591be1d0e41c625850b46b06d..6802d2d530c968aaa194c16fcc5d2731c636a07f 100644 (file)
@@ -28,7 +28,7 @@ example_test (void)
 
   /* Check if 1st argument is true and report with custom error message.  */
   grub_test_assert (2 == 2, "2 equal 2 expected");
-  grub_test_assert (2 == 3, "2 is not equal to %d", 3);
+  grub_test_assert (2 != 3, "2 matches %d", 3);
 }
 
 /* Register example_test method as a functional test.  */
index 4999f141204217e8754d142452ebdeefb6fb6de9..d721a9d0a1ca1726206316f31fb7971d247995f0 100644 (file)
@@ -31,7 +31,7 @@ example_test (void)
 
   /* Check if 1st argument is true and report with custom error message.  */
   grub_test_assert (2 == 2, "2 equal 2 expected");
-  grub_test_assert (2 == 3, "2 is not equal to %d", 3);
+  grub_test_assert (2 != 3, "2 matches %d", 3);
 }
 
 /* Register example_test method as a unit test.  */