testsuite: use relative paths, set PATH to absolute path

This approach works better with autotools, which supports the build
directory being complete outside the source tree.
This commit is contained in:
Michael Stapelberg
2016-10-10 21:14:59 +02:00
parent 4a52a7e9fb
commit 84e70a19a8
10 changed files with 41 additions and 62 deletions

View File

@ -29,7 +29,7 @@ sub migrate_config {
print $fh $config;
close($fh);
my $cmd = "sh -c 'exec " . abs_path("../i3-migrate-config-to-v4") . " --v3 <$tmpfile'";
my $cmd = "sh -c 'exec i3-migrate-config-to-v4 --v3 <$tmpfile'";
return [ split /\n/, qx($cmd) ];
}

View File

@ -25,7 +25,7 @@ sub parser_calls {
# TODO: use a timeout, so that we can error out if it doesnt terminate
# TODO: better way of passing arguments
my $stdout = qx(../test.commands_parser '$command' 2>&1 >&-);
my $stdout = qx(test.commands_parser '$command' 2>&1 >&-);
# Filter out all debugging output.
my @lines = split("\n", $stdout);

View File

@ -28,7 +28,7 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
workspace 2 output DVI-I_1/digital
EOT
my $output = qx(../i3 -C -c $filename);
my $output = qx(i3 -C -c $filename);
unlike($output, qr/ERROR/, 'no errors in i3 -C');
close($fh);

View File

@ -25,7 +25,7 @@ sub parser_calls {
my ($command) = @_;
my $stdout;
run [ '../test.config_parser', $command ],
run [ 'test.config_parser', $command ],
'>/dev/null',
'2>', \$stdout;
# TODO: use a timeout, so that we can error out if it doesnt terminate

View File

@ -33,7 +33,7 @@ my $pid = launch_with_config($config);
my $stdout;
my $stderr;
run [ '../i3-dump-log/i3-dump-log' ],
run [ 'i3-dump-log' ],
'>', \$stdout,
'2>', \$stderr;
@ -49,7 +49,7 @@ cmd 'shmlog on';
my $random_nop = mktemp('nop.XXXXXX');
cmd "nop $random_nop";
run [ '../i3-dump-log/i3-dump-log' ],
run [ 'i3-dump-log' ],
'>', \$stdout,
'2>', \$stderr;
@ -62,7 +62,7 @@ like($stderr, qr#^$#, 'stderr empty');
cmd 'shmlog ' . (23 * 1024 * 1024);
run [ '../i3-dump-log/i3-dump-log' ],
run [ 'i3-dump-log' ],
'>', \$stdout,
'2>', \$stderr;
@ -75,7 +75,7 @@ like($stderr, qr#^$#, 'stderr empty');
cmd 'shmlog off';
run [ '../i3-dump-log/i3-dump-log' ],
run [ 'i3-dump-log' ],
'>', \$stdout,
'2>', \$stderr;

View File

@ -26,7 +26,7 @@ sub check_config {
my ($config) = @_;
my ($fh, $tmpfile) = tempfile(UNLINK => 1);
print $fh $config;
my $output = qx(DISPLAY= ../i3 -C -c $tmpfile 2>&1);
my $output = qx(DISPLAY= i3 -C -c $tmpfile 2>&1);
my $retval = $?;
$fh->flush;
close($fh);