Merge tag 'powerpc-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[cascardo/linux.git] / tools / testing / selftests / powerpc / harness.c
index 52f9be7..248a820 100644 (file)
@@ -19,9 +19,9 @@
 #include "subunit.h"
 #include "utils.h"
 
-#define TIMEOUT                120
 #define KILL_TIMEOUT   5
 
+static uint64_t timeout = 120;
 
 int run_test(int (test_function)(void), char *name)
 {
@@ -44,7 +44,7 @@ int run_test(int (test_function)(void), char *name)
        setpgid(pid, pid);
 
        /* Wake us up in timeout seconds */
-       alarm(TIMEOUT);
+       alarm(timeout);
        terminated = false;
 
 wait:
@@ -94,6 +94,11 @@ static struct sigaction alarm_action = {
        .sa_handler = alarm_handler,
 };
 
+void test_harness_set_timeout(uint64_t time)
+{
+       timeout = time;
+}
+
 int test_harness(int (test_function)(void), char *name)
 {
        int rc;