mariadb/mysql-test/lib/My/Tee.pm
Rasmus Johansson 5720db2b43 MDEV-22176 Add JUnit support to MTR to generate XML test result
A new parameter has been added called xml-report, with which the
filename of the XML file is given to which the XML result is
written. There is also xml-package for adding a package value in
the XML output. Example usage:
./mysql-test-run.pl main.events_bugs innodb.count_distinct
main.explain_json innodb.file_format_defaults json.json_no_table
--suite=main,innodb,json --force --xml-report=build123456789.xml
--xml-package=simpletestrun
2020-04-07 09:27:51 +00:00

25 lines
350 B
Perl

package My::Tee;
use IO::Handle;
# see PerlIO::via
our $copyfh;
sub PUSHED
{
open($copyfh, '>', "$::opt_vardir/log/stdout.log")
or die "open(>$::opt_vardir/log/stdout.log): $!"
unless $copyfh;
bless { }, shift;
}
sub WRITE
{
my ($obj, $buf, $fh) = @_;
print $fh $buf;
$fh->flush;
print $copyfh $buf;
return length($buf);
}
1;