Skip to content

Commit 0e01277

Browse files
palichoroba
authored andcommitted
In test t/12embedded.t use new Makefile.PL option --testemboptions
This replaces the old undocumented DBD_MARIADB_TESTLANGDIR env variable.
1 parent 70f63de commit 0e01277

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

t/12embedded.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use DBI;
66
use DBD::MariaDB;
77
use File::Temp;
88

9-
use vars qw($test_dsn $test_user $test_password);
9+
use vars qw($test_dsn $test_user $test_password $test_emboptions);
1010
use lib 't', '.';
1111
require 'lib.pl';
1212

@@ -31,9 +31,9 @@ sub fatal_connection_error {
3131

3232
sub connect_to_embedded_server {
3333
my ($tmpdir, $database) = @_;
34-
my $lang_arg = $ENV{DBD_MARIADB_TESTLANGDIR} ? ",--language=$ENV{DBD_MARIADB_TESTLANGDIR}" : '';
35-
my $emb_dsn = "DBI:MariaDB:host=embedded;mariadb_embedded_options=--datadir=$tmpdir$lang_arg;";
36-
$emb_dsn .= "database=$database" if defined $database;
34+
my $emb_dsn = "DBI:MariaDB:host=embedded;mariadb_embedded_options=--datadir=$tmpdir";
35+
$emb_dsn .= ",$test_emboptions" if length $test_emboptions;
36+
$emb_dsn .= ";database=$database" if defined $database;
3737
return eval { DBI->connect($emb_dsn, undef, undef, { RaiseError => 1, PrintError => 0 }) };
3838
}
3939

@@ -60,7 +60,7 @@ my $dbh2 = connect_to_embedded_server($tmpdir1, 'dbd_mariadb_embedded');
6060
ok(defined $dbh2, "Second connection to embedded server with datadir in $tmpdir1") or fatal_connection_error('embedded');
6161

6262
my $dbh3 = connect_to_embedded_server($tmpdir1, 'dbd_mariadb_embedded');
63-
ok(defined $dbh3, "Third conection to embedded server with datadir in $tmpdir1") or fatal_connection_error('embedded');
63+
ok(defined $dbh3, "Third connection to embedded server with datadir in $tmpdir1") or fatal_connection_error('embedded');
6464

6565
ok($dbh1->do('CREATE TABLE dbd_mariadb_embedded(id INT)'), 'Created table with first connection');
6666
ok($dbh2->do('INSERT INTO dbd_mariadb_embedded(id) VALUES(10)'), 'Inserted values into table with second connection');

t/lib.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use Test::More;
55
use FindBin qw($Bin);
6-
use vars qw($test_dsn $test_user $test_password $test_db);
6+
use vars qw($test_dsn $test_user $test_password $test_db $test_emboptions);
77

88
use DBD::MariaDB;
99

0 commit comments

Comments
 (0)