1 use Module::Build 0.28; # for prepare_metadata
4 use warnings FATAL => 'all';
6 my $class = Module::Build->subclass(
7 class => "Module::Build::Custom",
8 code => <<'SUBCLASS' );
12 if ( $self->notes('TEST_MYSQL_DSN') ) {
13 $ENV{$_} = $self->notes($_) for qw(
14 TEST_MYSQL_DSN TEST_MYSQL_USER TEST_MYSQL_PASS
17 foreach my $name ( qw( LONG_TESTS TEST_SQLITE ) ) {
18 $ENV{$name} = 1 if $self->notes( $name );
21 $self->SUPER::ACTION_test( @_ );
25 my $build = $class->new(
26 module_name => 'DBM::Deep',
29 'perl' => '5.006_000',
31 'Scalar::Util' => '1.14',
32 'Digest::MD5' => '1.00',
35 'File::Path' => '0.01',
36 'File::Temp' => '0.01',
37 'Pod::Usage' => '1.3',
38 'Test::More' => '0.88',
39 'Test::Deep' => '0.095',
40 'Test::Warn' => '0.08',
41 'Test::Exception' => '0.21',
42 'IO::Scalar' => '0.01',
44 create_makefile_pl => 'traditional',
46 'META.yml', '*.bak', '*.gz', 'Makefile.PL', 'cover_db',
48 test_files => 't/??_*.t',
51 description => 'DBI support via SQLite',
54 'DBD::SQLite' => '1.25',
58 description => 'DBI support via MySQL',
61 'DBD::mysql' => '4.001',
67 if ( $build->y_n( "Run the long-running tests", 'n' ) ) {
68 $build->notes( 'LONG_TESTS' => 1 );
71 if ( $build->features( 'sqlite_engine' ) ) {
72 if ( $build->y_n( "Run the tests against the DBI engine via SQLite?", 'n' ) ) {
73 $build->notes( 'TEST_SQLITE' => 1 );
77 if ( $build->features( 'mysql_engine' ) ) {
78 if ( $build->y_n( "Run the tests against the DBI engine via MySQL?", 'n' ) ) {
79 my ($dsn, $user, $pass) = ('') x 3;
80 $dsn = $build->prompt( "\tWhat is the full DSN (for example 'dbi:mysql:test')" );
82 $user = $build->prompt( "\tWhat is the username?" );
84 $pass = $build->prompt( "\tWhat is the password?" );
88 $build->notes( 'TEST_MYSQL_DSN' => $dsn );
89 $build->notes( 'TEST_MYSQL_USER' => $user );
90 $build->notes( 'TEST_MYSQL_PASS' => $pass );
94 $build->create_build_script;