line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
37582
|
use 5.008; # utf8 |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
81
|
|
2
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
1961
|
use utf8; |
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
12
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package CHI::Driver::LMDB::t::CHIDriverTests; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.001000'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Test suite for LMDB driver |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
2521
|
use CHI::Test; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Carp qw( carp ); |
16
|
|
|
|
|
|
|
use Path::Tiny; |
17
|
|
|
|
|
|
|
use parent qw( CHI::t::Driver ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub testing_driver_class { return 'CHI::Driver::LMDB' } |
20
|
|
|
|
|
|
|
sub supports_get_namespaces { return 0 } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use LMDB_File qw( MDB_NOSYNC MDB_NOMETASYNC ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $tempdir = Path::Tiny->tempdir; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
if ( $ENV{CHI_KEEP_TEMP_DIR} ) { |
27
|
|
|
|
|
|
|
$tempdir->[Path::Tiny::TEMP]->unlink_on_destroy(0); |
28
|
|
|
|
|
|
|
carp "Tempdir kept at $tempdir"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
my $extra_options = { |
31
|
|
|
|
|
|
|
mapsize => 15 * 1024 * 1024, |
32
|
|
|
|
|
|
|
## no critic (Bangs::ProhibitBitwiseOperators) |
33
|
|
|
|
|
|
|
flags => MDB_NOSYNC | MDB_NOMETASYNC, |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new_cache_options { |
37
|
|
|
|
|
|
|
my $self = shift; |
38
|
|
|
|
|
|
|
return ( |
39
|
|
|
|
|
|
|
root_dir => $tempdir, |
40
|
|
|
|
|
|
|
%{$extra_options}, |
41
|
|
|
|
|
|
|
$self->SUPER::new_cache_options(), |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |