From: Ingo Bürk Date: Sat, 24 Sep 2016 21:48:33 +0000 (+0200) Subject: Set $HOME for tests. X-Git-Tag: 4.13~30^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=889d0abe8f397da9a39db9566e34cdfbb37d01fb;p=i3%2Fi3 Set $HOME for tests. We add $HOME to the environment variables we define for a test case in order to redirect it from the user's actual home directory. This is necessary because xcb-util-xrm will fall back to $HOME/.Xresources when determining the DPI. If a user has this set to, e.g., 192 on their machine, this would break tests. Since tests shouldn't rely on the system they run in, we redirect the home directory altogether to simulate a clean slate. relates to #2465 --- diff --git a/testcases/lib/TestWorker.pm b/testcases/lib/TestWorker.pm index 140537d4..6371591f 100644 --- a/testcases/lib/TestWorker.pm +++ b/testcases/lib/TestWorker.pm @@ -112,8 +112,9 @@ sub worker_wait { $test->failure_output(\*STDERR); $test->todo_output(\*STDOUT); - @ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE XTRACE COVERAGE RESTART)} - = ($self->{display}, + @ENV{qw(HOME DISPLAY TESTNAME OUTDIR VALGRIND STRACE XTRACE COVERAGE RESTART)} + = ($outdir, + $self->{display}, basename($file), $outdir, $options->{valgrind},