Changeset 431 for wiki-toolkit/trunk/Makefile.PL
- Timestamp:
- 05/11/08 17:04:41 (4 years ago)
- Files:
-
- 1 modified
-
wiki-toolkit/trunk/Makefile.PL (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit/trunk/Makefile.PL
r430 r431 15 15 if ($Wiki::Toolkit::TestConfig::configured 16 16 and not (@ARGV and $ARGV[0] eq '-s') 17 and not $ENV{WIKI_TOOLKIT_RERUN_CONFIG} 18 ) { 17 and not $ENV{WIKI_TOOLKIT_RERUN_CONFIG}) { 19 18 print "\nFor the test suite, we use the database and user info\n" 20 19 . "specified during the previous run. If you want to change\n" … … 32 31 . "preferably relevant to the backend(s) you intend to use live.\n" 33 32 . "Running the tests under every possible backend combination is\n" 34 . "recommended. To enter an undefined value, accept the empty\n"33 . "recommended. To enter an undefined value, accept the empty\n" 35 34 . "string or explicitly enter 'undef'.\n\n" 36 35 . "**** THESE TESTS ARE DESTRUCTIVE. ****\n" … … 53 52 foreach my $store (qw(MySQL Pg)) { 54 53 my $dbname = $ENV{"WIKI_TOOLKIT_".uc($store)."_DBNAME"}; 55 if ($dbname and $dbname ne "undef") {56 $config{$store}{dbname} = $dbname;54 if ($dbname and $dbname ne "undef") { 55 $config{$store}{dbname} = $dbname; 57 56 foreach my $var (qw(dbuser dbpass dbhost)) { 58 57 my $value = $ENV{"WIKI_TOOLKIT_".uc($store)."_".uc($var)}; 59 if ($value and $value ne "undef") { $config{$store}{$var} = $value; 60 } elsif ($value eq "undef") { 61 $config{$store}{$var} = undef; 62 } 63 } 64 } elsif ($dbname eq "undef") { 65 $config{$store}{dbname} = undef; 66 } 58 if ($value and $value ne "undef") { 59 $config{$store}{$var} = $value; 60 } elsif ($value eq "undef") { 61 $config{$store}{$var} = undef; 62 } 63 } 64 } elsif ($dbname eq "undef") { 65 $config{$store}{dbname} = undef; 66 } 67 67 } 68 68 … … 76 76 # Finally ask questions; then check the settings work. 77 77 my %driver = ( MySQL => "DBD::mysql", 78 Pg => "DBD::Pg" );78 Pg => "DBD::Pg" ); 79 79 foreach my $store_type (qw(MySQL Pg)) { 80 80 # See whether we have the driver installed. … … 82 82 if ($@) { 83 83 print "\n$driver{$store_type} not installed... skipping...\n"; 84 $config{$store_type}{dbname} = undef;85 next;86 }84 $config{$store_type}{dbname} = undef; 85 next; 86 } 87 87 88 88 # Prompt for the options. … … 90 90 my $pad = ' ' x (7-length $store_type); 91 91 $dbname = prompt "\n${pad}Database name for $store_type: ", 92 $config{$store_type}{dbname};92 $config{$store_type}{dbname}; 93 93 undef $dbname unless ($dbname and $dbname ne "undef"); 94 94 if ($dbname and $dbname ne "undef") { 95 $dbuser = prompt " Database user: ",96 $config{$store_type}{dbuser};95 $dbuser = prompt " Database user: ", 96 $config{$store_type}{dbuser}; 97 97 undef $dbuser unless ($dbuser and $dbuser ne "undef"); 98 $dbpass = prompt " Database password: ",99 $config{$store_type}{dbpass};98 $dbpass = prompt " Database password: ", 99 $config{$store_type}{dbpass}; 100 100 undef $dbpass unless ($dbpass and $dbpass ne "undef"); 101 $dbhost = prompt "Database host (if needed): ",102 $config{$store_type}{dbhost};101 $dbhost = prompt "Database host (if needed): ", 102 $config{$store_type}{dbhost}; 103 103 undef $dbhost unless ($dbhost and $dbhost ne "undef"); 104 104 … … 107 107 $config{$store_type}{dbpass} = $dbpass; 108 108 $config{$store_type}{dbhost} = $dbhost; 109 } else {109 } else { 110 110 print "\nNo database name supplied... skipping...\n"; 111 $config{$store_type}{dbname} = undef;112 }111 $config{$store_type}{dbname} = undef; 112 } 113 113 } 114 114 … … 121 121 # If we have a MySQL store configured, we can test the DBIx::FullTextSearch 122 122 # search backend. 123 eval { require DBIx::FullTextSearch; 124 require Lingua::Stem; 123 eval { 124 require DBIx::FullTextSearch; 125 require Lingua::Stem; 125 126 }; 126 127 my $fts_inst = $@ ? 0 : 1; … … 172 173 # Write out the config for next run. 173 174 open OUT, ">lib/Wiki/Toolkit/TestConfig.pm" 174 or die "Couldn't open lib/Wiki/Toolkit/TestConfig.pm for writing: $!";175 or die "Couldn't open lib/Wiki/Toolkit/TestConfig.pm for writing: $!"; 175 176 # warning - blind copy and paste follows. FIXME. 176 177 print OUT Data::Dumper->new([ \%Wiki::Toolkit::TestConfig::config ], 177 [ '*Wiki::Toolkit::TestConfig::config' ]178 )->Dump,179 "\$Wiki::Toolkit::TestConfig::configured = 1;\n1;\n";178 [ '*Wiki::Toolkit::TestConfig::config' ] 179 )->Dump, 180 "\$Wiki::Toolkit::TestConfig::configured = 1;\n1;\n"; 180 181 close OUT; 181 182 … … 202 203 # Write the Makefile. 203 204 WriteMakefile( NAME => "Wiki::Toolkit", 204 VERSION_FROM => "lib/Wiki/Toolkit.pm", 205 PREREQ_PM => { 'Text::WikiFormat' => '0.78', #earlier's buggy 206 'HTML::PullParser' => 0, 207 'Digest::MD5' => 0, 208 'Test::More' => 0, 209 'Time::Piece' => 0, 210 %extras }, 205 VERSION_FROM => "lib/Wiki/Toolkit.pm", 206 PREREQ_PM => { 'Text::WikiFormat' => '0.78', #earlier's buggy 207 'HTML::PullParser' => 0, 208 'Digest::MD5' => 0, 209 'Test::More' => 0, 210 'Time::Piece' => 0, 211 %extras 212 }, 211 213 EXE_FILES => [ "bin/wiki-toolkit-setupdb", 212 214 "bin/wiki-toolkit-rename-node", 213 215 "bin/wiki-toolkit-delete-node", 214 "bin/wiki-toolkit-revert-to-date" ], 215 clean => { FILES => "Config lib/Wiki/Toolkit/TestConfig.pm " 216 . "t/sqlite-test.db t/sii-db-file-test.db " 216 "bin/wiki-toolkit-revert-to-date" 217 ], 218 clean => { FILES => "Config lib/Wiki/Toolkit/TestConfig.pm " 219 . "t/sqlite-test.db t/sii-db-file-test.db " 217 220 . "t/node.db t/plucene" 218 221 } 219 );222 );
