Commit 43dc4233 authored by Monty's avatar Monty Committed by Sergei Petrunia

Fixed 'undefined variable' error in mtr

This could happen if mtr_grab_file() returned empty (happened to me)
parent e4fbec14
...@@ -516,12 +516,15 @@ sub main { ...@@ -516,12 +516,15 @@ sub main {
if ( not @$completed ) { if ( not @$completed ) {
my $test_name= mtr_grab_file($path_testlog); my $test_name= mtr_grab_file($path_testlog);
if (defined($test_name))
{
$test_name =~ s/^CURRENT_TEST:\s//; $test_name =~ s/^CURRENT_TEST:\s//;
chomp($test_name); chomp($test_name);
my $tinfo = My::Test->new(name => $test_name); my $tinfo = My::Test->new(name => $test_name);
$tinfo->{result}= 'MTR_RES_FAILED'; $tinfo->{result}= 'MTR_RES_FAILED';
$tinfo->{comment}=' '; $tinfo->{comment}=' ';
mtr_report_test($tinfo); mtr_report_test($tinfo);
}
mtr_error("Test suite aborted"); mtr_error("Test suite aborted");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment