File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 227
227
my $mailto ;
228
228
my $mailer ;
229
229
my $mail_path ;
230
+ my $mail_max_size ;
230
231
my $mail_command ;
231
232
my $email_on_error ;
232
233
my $email_when_finished ;
263
264
" MAILTO" => \$mailto ,
264
265
" MAILER" => \$mailer ,
265
266
" MAIL_PATH" => \$mail_path ,
267
+ " MAIL_MAX_SIZE" => \$mail_max_size ,
266
268
" MAIL_COMMAND" => \$mail_command ,
267
269
" EMAIL_ON_ERROR" => \$email_on_error ,
268
270
" EMAIL_WHEN_FINISHED" => \$email_when_finished ,
@@ -1497,10 +1499,18 @@ sub dodie {
1497
1499
my $log_file ;
1498
1500
1499
1501
if (defined ($opt {" LOG_FILE" })) {
1502
+ my $size = 0;
1503
+ if (defined ($mail_max_size )) {
1504
+ my $log_size = tell LOG;
1505
+ $log_size -= $test_log_start ;
1506
+ if ($log_size > $mail_max_size ) {
1507
+ $size = $log_size - $mail_max_size ;
1508
+ }
1509
+ }
1500
1510
$log_file = " $tmpdir /log" ;
1501
1511
open (L, " $opt {LOG_FILE}" ) or die " Can't open $opt {LOG_FILE} to read)" ;
1502
1512
open (O, " > $tmpdir /log" ) or die " Can't open $tmpdir /log\n " ;
1503
- seek (L, $test_log_start , 0);
1513
+ seek (L, $test_log_start + $size , 0);
1504
1514
while (<L>) {
1505
1515
print O;
1506
1516
}
Original file line number Diff line number Diff line change 442
442
# Users can cancel the test by Ctrl^C
443
443
# (default 0)
444
444
#EMAIL_WHEN_CANCELED = 1
445
+ #
446
+ # If a test ends with an error and EMAIL_ON_ERROR is set as well
447
+ # as a LOG_FILE is defined, then the log of the failing test will
448
+ # be included in the email that is sent.
449
+ # It is possible that the log may be very large, in which case,
450
+ # only the last amount of the log should be sent. To limit how
451
+ # much of the log is sent, set MAIL_MAX_SIZE. This will be the
452
+ # size in bytes of the last portion of the log of the failed
453
+ # test file. That is, if this is set to 100000, then only the
454
+ # last 100 thousand bytes of the log file will be included in
455
+ # the email.
456
+ # (default undef)
457
+ #MAIL_MAX_SIZE = 1000000
445
458
446
459
# Start a test setup. If you leave this off, all options
447
460
# will be default and the test will run once.
You can’t perform that action at this time.
0 commit comments