check.mak: add some more targets, like help, but also more intensive tests
authorThomas Vander Stichele <thomas@apestaart.org>
Thu, 29 Sep 2005 18:23:13 +0000 (18:23 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Thu, 29 Sep 2005 18:23:13 +0000 (18:23 +0000)
Original commit message from CVS:
2005-09-29  Thomas Vander Stichele  <thomas at apestaart dot org>

* check.mak:
add some more targets, like help, but also more intensive tests

ChangeLog
check.mak

index ca3c38e..aa1d629 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-29  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * check.mak:
+         add some more targets, like "help", but also more intensive tests
+
 2005-09-23  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * gtk-doc.mak:
index eb94195..e4f290e 100644 (file)
--- a/check.mak
+++ b/check.mak
@@ -12,12 +12,28 @@ check-valgrind:
        @true
 endif
 
+LOOPS = 10
+
 # run any given test by running make test.check
 %.check: %
        @$(TESTS_ENVIRONMENT)                                   \
        CK_DEFAULT_TIMEOUT=20                                   \
        $*
 
+# run any given test in a loop
+%.torture: %
+       @for i in `seq 1 $(LOOPS)`; do                          \
+       $(TESTS_ENVIRONMENT)                                    \
+       CK_DEFAULT_TIMEOUT=20                                   \
+       $*; done
+
+# run any given test in an infinite loop
+%.forever: %
+       @while true; do                                         \
+       $(TESTS_ENVIRONMENT)                                    \
+       CK_DEFAULT_TIMEOUT=20                                   \
+       $*; done
+
 # valgrind any given test by running make test.valgrind
 %.valgrind: %
        $(TESTS_ENVIRONMENT)                                    \
@@ -39,6 +55,15 @@ endif
        libtool --mode=execute                                  \
        gdb $*
 
+# torture tests
+torture: $(TESTS)
+       @echo "Torturing tests ..."
+       for i in `seq 1 $(LOOPS)`; do                           \
+               make check ||                                   \
+               (echo "Failure after $$i runs"; exit 1) ||      \
+               exit 1;                                         \
+       done
+
 
 # valgrind all tests
 valgrind: $(TESTS)
@@ -57,3 +82,15 @@ valgrind: $(TESTS)
                echo "$$whicht";                                        \
                false;                                                  \
        fi
+
+help:
+       @echo "make check                 -- run all checks"
+       @echo "make torture               -- run all checks repeatedly"
+       @echo "make (dir)/(test).check    -- run the given check once"
+       @echo "make (dir)/(test).forever  -- run the given check forever"
+       @echo "make (dir)/(test).torture  -- run the given check forever"
+       @echo
+       @echo "make (dir)/(test).gdb      -- start up gdb for the given test"
+       @echo
+       @echo "make valgrind              -- valgrind all tests"
+       @echo "make (dir)/(test).valgrind -- valgrind the given test"