]> sourceware.org Git - lvm2.git/commitdiff
test: Time out the entire testsuite after an hour.
authorPetr Rockai <prockai@redhat.com>
Mon, 16 Dec 2013 10:47:09 +0000 (11:47 +0100)
committerPetr Rockai <prockai@redhat.com>
Wed, 8 Jan 2014 16:11:32 +0000 (17:11 +0100)
test/lib/harness.c

index 19859a094abf064b2b9a9e631d51b5e71704a2a8..9613543c5c555a0b4ae98b7d8bbd47b8a7e65632 100644 (file)
@@ -59,6 +59,8 @@ static const char *results;
 static unsigned fullbuffer = 0;
 static int unlimited = 0;
 
+static time_t harness_start;
+
 static FILE *outfile = NULL;
 char testdirdebug[PATH_MAX];
 
@@ -544,9 +546,15 @@ int main(int argc, char **argv) {
                default: signal(i, handler);
                }
 
+       harness_start = time(NULL);
        /* run the tests */
-       for (i = 1; !die && i < argc; ++i)
+       for (i = 1; !die && i < argc; ++i) {
                run(i, argv[i]);
+               if ( time(NULL) - harness_start > 3600 ) {
+                       printf("an hour passed, giving up...\n");
+                       break;
+               }
+       }
 
        free(subst[0].value);
        free(subst[1].value);
This page took 0.033752 seconds and 5 git commands to generate.