1 use inc::Module::Install 0.67;
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.20;
10 requires 'SQL::Abstract::Limit' => 0.101;
11 requires 'Class::C3' => 0.13;
12 requires 'Class::C3::Componentised' => 0;
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.05002;
19 requires 'JSON::Any' => 1.17;
20 requires 'Scope::Guard' => 0.03;
22 # Perl 5.8.0 doesn't have utf8::is_utf8()
23 requires 'Encode' => 0 if ($] <= 5.008000);
25 test_requires 'DBD::SQLite' => 1.14;
26 test_requires 'Test::Builder' => 0.33;
28 install_script 'script/dbicadmin';
30 tests "t/*.t t/*/*.t";
32 # re-build README and require CDBI modules for testing if we're in a checkout
33 if( -e 'inc/.author' ) {
34 build_requires 'DBIx::ContextualFetch';
35 build_requires 'Class::Trigger';
36 system('pod2text lib/DBIx/Class.pm > README');
42 # Have all prerequisites, check DBD::SQLite sanity
43 if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
46 if (not defined $pid) {
47 die "Unable to fork(): $!";
51 # Win32 does not have real fork()s so a segfault will bring
52 # everything down. Warn about it.
53 if ($^O eq 'MSWin32') {
56 ######################################################################
58 # A short stress-testing of DBD::SQLite will follow. If you have a #
59 # buggy library this might very well be the last text you will see #
60 # before the installation silently terminates. If this happens it #
61 # would mean that you are running a buggy version of DBD::SQLite #
62 # known to randomly segfault on errors. Even if you have the latest #
63 # CPAN module version, the system sqlite3 dynamic library might have #
64 # been compiled against an older buggy sqlite3 dev library (oddly #
65 # DBD::SQLite will prefer the system library against the one bundled #
66 # with it). You are strongly advised to resolve this issue before #
69 # If this happens to you (this text is the last thing you see), and #
70 # you just want to install this module without worrying about the #
71 # tests (which will almost certainly fail) - set the environment #
72 # variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
74 ######################################################################
82 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
87 or die "Unable to connect to database: $@";
88 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
89 $dbh->do ('COMMIT'); # followed by commit
101 ############################### WARNING #################################
103 # You are running a buggy version of DBD::SQLite known to randomly #
104 # segfault on errors. Even if you have the latest CPAN module version, #
105 # the sqlite3 dynamic library on this system might have been compiled #
106 # against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
107 # prefer the system library against the one bundled with it). You are #
108 # strongly advised to resolve this issue before proceeding. #
110 #########################################################################
114 "The test suite of this module is almost certain to fail.\n"
115 . 'Do you really want to continue?',
118 exit 0 unless ($ans =~ /^y(es)?$/i);