1 use inc::Module::Install 0.81;
4 perl_version '5.006001';
5 all_from 'lib/DBIx/Class.pm';
7 requires 'Data::Page' => 2.00;
8 requires 'Scalar::Util' => 0;
9 requires 'SQL::Abstract' => 1.51;
10 requires 'SQL::Abstract::Limit' => 0.13;
11 requires 'Class::C3' => 0.20;
12 requires 'Class::C3::Componentised' => 1.0004;
13 requires 'Storable' => 0;
14 requires 'Carp::Clan' => 0;
15 requires 'DBI' => 1.40;
16 requires 'Module::Find' => 0;
17 requires 'Class::Inspector' => 0;
18 requires 'Class::Accessor::Grouped' => 0.08003;
19 requires 'JSON::Any' => 1.17;
20 requires 'Scope::Guard' => 0.03;
21 requires 'List::Util' => 1.19;
23 # Perl 5.8.0 doesn't have utf8::is_utf8()
24 requires 'Encode' => 0 if ($] <= 5.008000);
26 test_requires 'DBD::SQLite' => 1.14;
27 test_requires 'Test::Builder' => 0.33;
28 test_requires 'Test::Exception' => 0;
29 test_requires 'Test::Deep' => 0;
31 install_script 'script/dbicadmin';
33 tests "t/*.t t/*/*.t";
35 # re-build README and require CDBI modules for testing if we're in a checkout
36 if( -e 'inc/.author' ) {
37 build_requires 'DBIx::ContextualFetch';
38 build_requires 'Class::Trigger';
39 system('pod2text lib/DBIx/Class.pm > README');
45 # Have all prerequisites, check DBD::SQLite sanity
46 if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
48 # Win32 does not have real fork()s so a segfault will bring
49 # everything down. Warn about it.
50 if ($^O eq 'MSWin32') {
53 ######################################################################
55 # A short stress-testing of DBD::SQLite will follow. If you have a #
56 # buggy library this might very well be the last text you will see #
57 # before the installation silently terminates. If this happens it #
58 # would mean that you are running a buggy version of DBD::SQLite #
59 # known to randomly segfault on errors. Even if you have the latest #
60 # CPAN module version, the system sqlite3 dynamic library might have #
61 # been compiled against an older buggy sqlite3 dev library (oddly #
62 # DBD::SQLite will prefer the system library against the one bundled #
63 # with it). You are strongly advised to resolve this issue before #
66 # If this happens to you (this text is the last thing you see), and #
67 # you just want to install this module without worrying about the #
68 # tests (which will almost certainly fail) - set the environment #
69 # variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
71 ######################################################################
77 if (not defined $pid) {
78 die "Unable to fork(): $!";
85 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
90 or die "Unable to connect to database: $@";
91 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
92 $dbh->do ('COMMIT'); # followed by commit
104 ############################### WARNING #################################
106 # You are running a buggy version of DBD::SQLite known to randomly #
107 # segfault on errors. Even if you have the latest CPAN module version, #
108 # the sqlite3 dynamic library on this system might have been compiled #
109 # against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
110 # prefer the system library against the one bundled with it). You are #
111 # strongly advised to resolve this issue before proceeding. #
113 #########################################################################
117 "The test suite of this module is almost certain to fail.\n"
118 . 'Do you really want to continue?',
121 exit 0 unless ($ans =~ /^y(es)?$/i);