Fix test in t/91debug.t for less ambigious SQL bracketing for 0.08013 release
[dbsrgits/DBIx-Class.git] / Makefile.PL
CommitLineData
e9aa5e5d 1use inc::Module::Install 0.81;
ce4c07df 2
3name 'DBIx-Class';
ce4c07df 4perl_version '5.006001';
8e0f16f1 5all_from 'lib/DBIx/Class.pm';
ce4c07df 6
ce4c07df 7requires 'Data::Page' => 2.00;
8requires 'Scalar::Util' => 0;
e9aa5e5d 9requires 'SQL::Abstract' => 1.51;
a95945c8 10requires 'SQL::Abstract::Limit' => 0.13;
11requires 'Class::C3' => 0.20;
e9aa5e5d 12requires 'Class::C3::Componentised' => 1.0004;
ce4c07df 13requires 'Storable' => 0;
ce4c07df 14requires 'Carp::Clan' => 0;
15requires 'DBI' => 1.40;
16requires 'Module::Find' => 0;
17requires 'Class::Inspector' => 0;
e9aa5e5d 18requires 'Class::Accessor::Grouped' => 0.08003;
4cda44f2 19requires 'JSON::Any' => 1.17;
9c6d6d93 20requires 'Scope::Guard' => 0.03;
5ddc9401 21requires 'List::Util' => 1.19;
ce4c07df 22
23# Perl 5.8.0 doesn't have utf8::is_utf8()
24requires 'Encode' => 0 if ($] <= 5.008000);
25
7ec5622e 26test_requires 'DBD::SQLite' => 1.14;
27test_requires 'Test::Builder' => 0.33;
5ddc9401 28test_requires 'Test::Exception' => 0;
29test_requires 'Test::Deep' => 0;
ce4c07df 30
31install_script 'script/dbicadmin';
32
33tests "t/*.t t/*/*.t";
34
1543db24 35# re-build README and require CDBI modules for testing if we're in a checkout
36if( -e 'inc/.author' ) {
37 build_requires 'DBIx::ContextualFetch';
38 build_requires 'Class::Trigger';
39 system('pod2text lib/DBIx/Class.pm > README');
ff132c6f 40}
41
42auto_provides;
43
3e110410 44auto_install;
7ec5622e 45# Have all prerequisites, check DBD::SQLite sanity
46if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
47
2011fcb0 48 # Win32 does not have real fork()s so a segfault will bring
49 # everything down. Warn about it.
50 if ($^O eq 'MSWin32') {
51 print <<'EOW';
7ec5622e 52
53######################################################################
54# #
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 #
64# proceeding. #
65# #
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. #
70# #
71######################################################################
72
73EOW
2011fcb0 74 }
75
76 my $pid = fork();
77 if (not defined $pid) {
78 die "Unable to fork(): $!";
79 }
80 elsif (! $pid) {
7ec5622e 81
82 require DBI;
83 for (1 .. 100) {
84 my $dbh;
85 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
86 AutoCommit => 1,
87 RaiseError => 0,
88 PrintError => 0,
89 })
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
93 $dbh->disconnect;
94 }
95
96 exit 0;
97 }
98 else {
99 wait();
100 my $sig = $? & 127;
101 if ($sig == 11) {
102 warn (<<EOE);
103
104############################### WARNING #################################
105# #
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. #
112# #
113#########################################################################
114
115EOE
116 my $ans = prompt (
117 "The test suite of this module is almost certain to fail.\n"
118 . 'Do you really want to continue?',
119 'no',
120 );
121 exit 0 unless ($ans =~ /^y(es)?$/i);
122 }
123 }
124}
3e110410 125
ce4c07df 126WriteAll;