summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorunknown <msvensson@shellback.(none)>2006-10-13 10:41:40 +0200
committerunknown <msvensson@shellback.(none)>2006-10-13 10:41:40 +0200
commita4c972bcf7259063c47ef7213c9f8012ba63d8b2 (patch)
tree893c69392e60d75bca5f496d38e58f230bc378eb /mysql-test/mysql-test-run.pl
parente3516186d51cef09051c842e5a8e6a4d19efe00e (diff)
downloadmariadb-git-a4c972bcf7259063c47ef7213c9f8012ba63d8b2.tar.gz
Improve function that finds the reason why test was skipped, the old version only looked at the ast line, but there might be some additional debug info there so it's better to scan the whole file.
There should be only one line that says "reason: <reason>"
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl32
1 files changed, 28 insertions, 4 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index dc2212f953b..24cdedce712 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2815,6 +2815,33 @@ sub do_after_run_mysqltest($)
}
+sub find_testcase_skipped_reason($)
+{
+ my ($tinfo)= @_;
+
+ # Open mysqltest.log
+ my $F= IO::File->new($path_timefile) or
+ mtr_error("can't open file \"$path_timefile\": $!");
+ my $reason;
+
+ while ( my $line= <$F> )
+ {
+ # Look for "reason: <reason fo skiping test>"
+ if ( $line =~ /reason: (.*)/ )
+ {
+ $reason= $1;
+ }
+ }
+
+ if ( ! $reason )
+ {
+ mtr_warning("Could not find reason for skipping test in $path_timefile");
+ $reason= "Detected by testcase(reason unknown) ";
+ }
+ $tinfo->{'comment'}= $reason;
+}
+
+
##############################################################################
#
# Run a single test case
@@ -2887,10 +2914,7 @@ sub run_testcase ($) {
# Testcase itself tell us to skip this one
# Try to get reason from mysqltest.log
- my $last_line= mtr_lastlinefromfile($path_timefile) if -f $path_timefile;
- my $reason= mtr_match_prefix($last_line, "reason: ");
- $tinfo->{'comment'}=
- defined $reason ? $reason : "Detected by testcase(reason unknown) ";
+ find_testcase_skipped_reason($tinfo);
mtr_report_test_skipped($tinfo);
}
elsif ( $res == 63 )