mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 03:21:53 +01:00
4ad77748b3
Perl version of mysql-test-run new file mysql-test/lib/init_db.sql: Perl version of mysql-test-run mysql-test/lib/mtr_gcov.pl: Perl version of mysql-test-run mysql-test/lib/mtr_gprof.pl: Perl version of mysql-test-run mysql-test/lib/mtr_io.pl: Perl version of mysql-test-run mysql-test/lib/mtr_match.pl: Perl version of mysql-test-run mysql-test/lib/mtr_misc.pl: Perl version of mysql-test-run mysql-test/lib/mtr_process.pl: Perl version of mysql-test-run mysql-test/lib/mtr_report.pl: Perl version of mysql-test-run mysql-test/mysql-test-run.pl: Perl version of mysql-test-run
71 lines
1.4 KiB
Perl
71 lines
1.4 KiB
Perl
# -*- cperl -*-
|
|
|
|
# This is a library file used by the Perl version of mysql-test-run,
|
|
# and is part of the translation of the Bourne shell script with the
|
|
# same name.
|
|
|
|
use strict;
|
|
|
|
sub mtr_get_pid_from_file ($);
|
|
sub mtr_get_opts_from_file ($);
|
|
sub mtr_tofile ($@);
|
|
sub mtr_tonewfile($@);
|
|
|
|
##############################################################################
|
|
#
|
|
#
|
|
#
|
|
##############################################################################
|
|
|
|
sub mtr_get_pid_from_file ($) {
|
|
my $file= shift;
|
|
|
|
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
|
|
my $pid= <FILE>;
|
|
chomp($pid);
|
|
close FILE;
|
|
return $pid;
|
|
}
|
|
|
|
sub mtr_get_opts_from_file ($) {
|
|
my $file= shift;
|
|
|
|
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
|
|
my @args;
|
|
while ( <FILE> )
|
|
{
|
|
chomp;
|
|
s/\$MYSQL_TEST_DIR/$::glob_mysql_test_dir/g;
|
|
push(@args, split(' ', $_));
|
|
}
|
|
close FILE;
|
|
return \@args;
|
|
}
|
|
|
|
sub mtr_fromfile ($) {
|
|
my $file= shift;
|
|
|
|
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
|
|
my $text= join('', <FILE>);
|
|
close FILE;
|
|
return $text;
|
|
}
|
|
|
|
sub mtr_tofile ($@) {
|
|
my $file= shift;
|
|
|
|
open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!");
|
|
print FILE join("", @_);
|
|
close FILE;
|
|
}
|
|
|
|
sub mtr_tonewfile ($@) {
|
|
my $file= shift;
|
|
|
|
open(FILE,">",$file) or mtr_error("can't open file \"$file\": $!");
|
|
print FILE join("", @_);
|
|
close FILE;
|
|
}
|
|
|
|
|
|
1;
|