$ENV{LISTEN_PID} = $$;
$ENV{LISTEN_FDS} = 1;
delete $ENV{DESKTOP_STARTUP_ID};
+ delete $ENV{I3SOCK};
+ # $SHELL could be set to fish, which will horribly break running shell
+ # commands via i3’s exec feature. This happened e.g. when having
+ # “set-option -g default-shell "/usr/bin/fish"” in ~/.tmux.conf
+ delete $ENV{SHELL};
+ unless ($args{dont_create_temp_dir}) {
+ $ENV{XDG_RUNTIME_DIR} = '/tmp/i3-testsuite/';
+ mkdir $ENV{XDG_RUNTIME_DIR};
+ }
$ENV{DISPLAY} = $args{display};
$ENV{PATH} = join(':',
'../i3-nagbar',
if ($args{valgrind}) {
$i3cmd =
qq|valgrind -v --log-file="$outdir/valgrind-for-$test.log" | .
+ qq|--suppressions="./valgrind.supp" | .
qq|--leak-check=full --track-origins=yes --num-callers=20 | .
qq|--tool=memcheck -- $i3cmd|;
}
'sh -c "export LISTEN_PID=\$\$; ' . $cmd . '"';
}
+ if ($args{xtrace}) {
+ my $out = "$outdir/xtrace-for-$test.log";
+
+ # See comment in $args{strace} branch.
+ $cmd = qq|xtrace -n -o "$out" -- | .
+ 'sh -c "export LISTEN_PID=\$\$; ' . $cmd . '"';
+ }
+
# We need to use the shell due to using output redirections.
exec '/bin/sh', '-c', $cmd;