~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/mtr_report.pl

  • Committer: Monty Taylor
  • Date: 2008-12-11 02:44:41 UTC
  • mto: This revision was merged to the branch mainline in revision 672.
  • Revision ID: monty@inaugust.com-20081211024441-5dsauvxl7mo7r1hb
Fix for the weird solaris gettext bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    if defined $tinfo->{combination};
57
57
 
58
58
  _mtr_log($tname);
59
 
  if ($::opt_subunit) {
60
 
    printf "test: $tname\n";
61
 
  } else {
62
 
    printf "%-30s ", $tname;
63
 
  }
 
59
  printf "%-30s ", $tname;
64
60
}
65
61
 
66
62
sub mtr_report_test_skipped ($) {
67
63
  my $tinfo= shift;
68
 
  my $tname= $tinfo->{name};
69
 
  my $cause= "";
70
64
 
71
65
  $tinfo->{'result'}= 'MTR_RES_SKIPPED';
72
66
  if ( $tinfo->{'disable'} )
73
67
  {
74
 
    $cause.= "disable";
75
 
  }
76
 
  else
77
 
  {
78
 
    $cause.= "skipped";
79
 
  }
80
 
  if ( $tinfo->{'comment'} )
81
 
  {
82
 
    if ($::opt_subunit) {
83
 
      mtr_report("skip: $tname [\ncause: $cause\n$tinfo->{'comment'}\n]");
84
 
    } else { 
85
 
      mtr_report("[ $cause ]   $tinfo->{'comment'}");
86
 
    }
87
 
  }
88
 
  else
89
 
  {
90
 
    if ($::opt_subunit) {
91
 
      mtr_report("skip: $tname");
92
 
    } else {
93
 
      mtr_report("[ $cause ]");
94
 
    }
 
68
    mtr_report("[ disabled ]  $tinfo->{'comment'}");
 
69
  }
 
70
  elsif ( $tinfo->{'comment'} )
 
71
  {
 
72
    mtr_report("[ skipped ]   $tinfo->{'comment'}");
 
73
  }
 
74
  else
 
75
  {
 
76
    mtr_report("[ skipped ]");
95
77
  }
96
78
}
97
79
 
114
96
 
115
97
sub mtr_report_test_passed ($) {
116
98
  my $tinfo= shift;
117
 
  my $tname= $tinfo->{name};
118
99
 
119
100
  my $timer=  "";
120
101
  if ( $::opt_timer and -f "$::opt_vardir/log/timer" )
122
103
    $timer= mtr_fromfile("$::opt_vardir/log/timer");
123
104
    $tot_real_time += ($timer/1000);
124
105
    $timer= sprintf "%12s", $timer;
125
 
    ### XXX: How to format this as iso6801 datetime?
126
106
  }
127
107
  $tinfo->{'result'}= 'MTR_RES_PASSED';
128
 
  if ($::opt_subunit) {
129
 
    mtr_report("success: $tname");
130
 
  } else {
131
 
    mtr_report("[ pass ]   $timer");
132
 
  }
 
108
  mtr_report("[ pass ]   $timer");
133
109
}
134
110
 
135
111
sub mtr_report_test_failed ($) {
136
112
  my $tinfo= shift;
137
 
  my $tname= $tinfo->{name};
138
 
  my $comment= "";
139
113
 
140
114
  $tinfo->{'result'}= 'MTR_RES_FAILED';
141
115
  if ( defined $tinfo->{'timeout'} )
142
116
  {
143
 
    $comment.= "timeout";
144
 
  }
145
 
  elsif ( $tinfo->{'comment'} )
 
117
    mtr_report("[ fail ]  timeout");
 
118
    return;
 
119
  }
 
120
  else
 
121
  {
 
122
    mtr_report("[ fail ]");
 
123
  }
 
124
 
 
125
  if ( $tinfo->{'comment'} )
146
126
  {
147
127
    # The test failure has been detected by mysql-test-run.pl
148
128
    # when starting the servers or due to other error, the reason for
149
129
    # failing the test is saved in "comment"
150
 
    $comment.= "$tinfo->{'comment'}";
 
130
    mtr_report("\nERROR: $tinfo->{'comment'}");
151
131
  }
152
132
  elsif ( -f $::path_timefile )
153
133
  {
154
134
    # Test failure was detected by test tool and it's report
155
135
    # about what failed has been saved to file. Display the report.
156
 
    $comment.= mtr_fromfile($::path_timefile);
 
136
    print "\n";
 
137
    print mtr_fromfile($::path_timefile); # FIXME print_file() instead
 
138
    print "\n";
157
139
  }
158
140
  else
159
141
  {
160
142
    # Neither this script or the test tool has recorded info
161
143
    # about why the test has failed. Should be debugged.
162
 
    $comment.= "Unexpected termination, probably when starting mysqld";
163
 
  }
164
 
  if ($::opt_subunit) {
165
 
    mtr_report("failure: $tname [\n$comment\n]");
166
 
  } else {
167
 
    mtr_report("[ fail ]   $comment");
 
144
    mtr_report("\nUnexpected termination, probably when starting mysqld");;
168
145
  }
169
146
}
170
147
 
221
198
    print
222
199
      "The log files in var/log may give you some hint\n",
223
200
      "of what went wrong.\n",
224
 
      "If you want to report this error, go to:\n",
225
 
      "\thttp://bugs.launchpad.net/drizzle\n";
 
201
      "If you want to report this error, please read first ",
 
202
      "the documentation at\n",
 
203
      "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n";
226
204
  }
227
205
  if (!$::opt_extern)
228
206
  {