Skip to content

Commit 412d78c

Browse files
author
Daniel Kroening
authored
Merge pull request #445 from smowton/test_script_special_chars
Allow test script to operate on directories containing special chars
2 parents 3de6faa + eb1533a commit 412d78c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

regression/test.pl

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
sub run($$$$$) {
2121
my ($name, $input, $cmd, $options, $output) = @_;
22-
my $cmdline = "$cmd $options $input >$output 2>&1";
22+
my $cmdline = "$cmd $options '$input' >'$output' 2>&1";
2323

2424
print LOG "Running $cmdline\n";
25-
system("bash", "-c", "cd $name ; $cmdline");
25+
system("bash", "-c", "cd '$name' ; $cmdline");
2626
my $exit_value = $? >> 8;
2727
my $signal_num = $? & 127;
2828
my $dumped_core = $? & 128;
@@ -40,8 +40,8 @@ ($$$$$)
4040
}
4141
}
4242

43-
system "echo EXIT=$exit_value >>$name/$output";
44-
system "echo SIGNAL=$signal_num >>$name/$output";
43+
system "echo EXIT=$exit_value >>'$name/$output'";
44+
system "echo SIGNAL=$signal_num >>'$name/$output'";
4545

4646
return $failed;
4747
}
@@ -119,7 +119,7 @@ ($$$$$)
119119
my $r;
120120
$result =~ s/\\/\\\\/g;
121121
$result =~ s/([^\\])\$/$1\\r\\\\?\$/;
122-
system("bash", "-c", "grep $grep_options \$'$result' \"$name/$output\" >/dev/null");
122+
system("bash", "-c", "grep $grep_options \$'$result' '$name/$output' >/dev/null");
123123
$r = ($included ? $? != 0 : $? == 0);
124124
if($r) {
125125
print LOG "$result [FAILED]\n";
@@ -304,4 +304,3 @@ ($)
304304
close LOG;
305305

306306
exit $failures;
307-

0 commit comments

Comments
 (0)