]> git.sur5r.net Git - i3/i3/blobdiff - testcases/lib/TestWorker.pm
Merge branch 'master' into next
[i3/i3] / testcases / lib / TestWorker.pm
index dcb39ebcee362d246995e4d22c4ee0ab8da9f1fb..a224b718a90f245c954bba1cfa20a05e94d0a479 100644 (file)
@@ -13,13 +13,17 @@ our @EXPORT = qw(worker worker_next);
 
 use File::Basename qw(basename);
 my @x;
+my $options;
 
 sub worker {
-    my ($display, $x, $outdir) = @_;
+    my ($display, $x, $outdir, $optref) = @_;
 
     # make sure $x hangs around
     push @x, $x;
 
+    # store the options hashref
+    $options = $optref;
+
     socketpair(my $ipc_child, my $ipc, AF_UNIX, SOCK_DGRAM, PF_UNSPEC)
         or die "socketpair: $!";
 
@@ -101,8 +105,15 @@ sub worker_wait {
             $test->failure_output(\*STDERR);
             $test->todo_output(\*STDOUT);
 
-            @ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE COVERAGE RESTART)}
-                = ($self->{display}, basename($file), $outdir, 0, 0, 0, 0);
+            @ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE XTRACE COVERAGE RESTART)}
+                = ($self->{display},
+                   basename($file),
+                   $outdir,
+                   $options->{valgrind},
+                   $options->{strace},
+                   $options->{xtrace},
+                   $options->{coverage},
+                   $options->{restart});
 
             package main;
             local $@;