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 );
23 my $build = $class->new(
24 module_name => 'DBM::Deep',
27 'perl' => '5.006_000',
29 'Scalar::Util' => '1.14',
30 'Digest::MD5' => '1.00',
33 'File::Path' => '0.01',
34 'File::Temp' => '0.01',
35 'Pod::Usage' => '1.3',
36 'Test::More' => '0.88',
37 'Test::Deep' => '0.095',
38 'Test::Warn' => '0.08',
39 'Test::Exception' => '0.21',
40 'IO::Scalar' => '0.01',
42 create_makefile_pl => 'traditional',
44 'META.yml', '*.bak', '*.gz', 'Makefile.PL', 'cover_db',
46 test_files => 't/??_*.t',
49 description => 'DBI support via SQLite',
52 'DBD::SQLite' => '1.25',
56 description => 'DBI support via MySQL',
59 'DBD::mysql' => '4.001',
65 if ( $build->y_n( "Run the long-running tests", 'n' ) ) {
66 $build->notes( 'LONG_TESTS' => 1 );
69 if ( $build->features( 'sqlite_engine' ) ) {
70 if ( $build->y_n( "Run the tests against the DBI engine via SQLite?", 'n' ) ) {
71 $build->notes( 'TEST_SQLITE' => 1 );
75 if ( $build->features( 'mysql_engine' ) ) {
76 if ( $build->y_n( "Run the tests against the DBI engine via MySQL?", 'n' ) ) {
77 my ($dsn, $user, $pass) = ('') x 3;
78 $dsn = $build->prompt( "\tWhat is the full DSN (for example 'dbi:mysql:test')" );
80 $user = $build->prompt( "\tWhat is the username?" );
82 $pass = $build->prompt( "\tWhat is the password?" );
86 $build->notes( 'TEST_MYSQL_DSN' => $dsn );
87 $build->notes( 'TEST_MYSQL_USER' => $user );
88 $build->notes( 'TEST_MYSQL_PASS' => $pass );
92 $build->create_build_script;