[Http-webtest-commits] CVS: HTTP-WebTest Makefile.PL,1.7,1.8
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <m_...@us...> - 2002-06-15 21:43:36
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv18707 Modified Files: Makefile.PL Log Message: Remove dependancy on Algorithm::Diff. Added new test target test_config which runs test_config.PL. Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Makefile.PL,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.PL 6 Jun 2002 18:27:17 -0000 1.7 --- Makefile.PL 15 Jun 2002 21:43:33 -0000 1.8 *************** *** 6,16 **** use ExtUtils::MakeMaker; - use Data::Dumper; use File::Spec; - my %CONFIG = (); - - # what do we need to delete on realclean? - my $REALCLEAN = '.config'; # list of authors my $AUTHOR = 'Richard Anderson <ri...@ri...>, ' . --- 6,11 ---- *************** *** 18,26 **** WriteMakefile( NAME => 'HTTP::WebTest', ! VERSION_FROM => 'lib/HTTP/WebTest.pm', ! PREREQ_PM => { 'Algorithm::Diff' => 0, ! 'CGI::Cookie' => 0, 'File::Temp' => 0, - 'HTTP::Daemon' => 0, 'LWP' => 5.60, 'MIME::Base64' => 0, --- 13,19 ---- WriteMakefile( NAME => 'HTTP::WebTest', ! VERSION_FROM => 'lib/HTTP/WebTest.pm.in', ! PREREQ_PM => { 'CGI::Cookie' => 0, 'File::Temp' => 0, 'LWP' => 5.60, 'MIME::Base64' => 0, *************** *** 31,40 **** 'Time::HiRes' => 0, 'URI' => 0 }, ! realclean => { FILES => $REALCLEAN }, EXE_FILES => [ File::Spec->catfile(qw(bin wt)) ], AUTHOR => $AUTHOR, ABSTRACT => 'Run tests on remote URLs or local web files'); ! sub MY::libscan { my $self = shift; my $path = shift; --- 24,35 ---- 'Time::HiRes' => 0, 'URI' => 0 }, ! realclean => { FILES => '.config' }, EXE_FILES => [ File::Spec->catfile(qw(bin wt)) ], AUTHOR => $AUTHOR, ABSTRACT => 'Run tests on remote URLs or local web files'); ! package MY; ! ! sub libscan { my $self = shift; my $path = shift; *************** *** 43,53 **** return undef if $path =~ /~/; ! return $self->MY::SUPER::libscan($path); } ! sub MY::dist_core { my $self = shift; ! my $make = $self->MY::SUPER::dist_core(); # add our hook for dist target --- 38,59 ---- return undef if $path =~ /~/; ! return $self->SUPER::libscan($path); } ! sub test { my $self = shift; ! my $make = $self->SUPER::test(@_); ! ! # add dependencies for test targets ! $make =~ s/(test(?:db)? :: )(.*)/$1test_config $2/g; ! ! return $make; ! } ! ! sub dist_core { ! my $self = shift; ! ! my $make = $self->SUPER::dist_core(); # add our hook for dist target *************** *** 57,61 **** } ! sub MY::postamble { my $make = ''; --- 63,67 ---- } ! sub postamble { my $make = ''; *************** *** 63,73 **** if(-t STDIN and -t STDOUT) { $make .= apache_dir_setup(); - $CONFIG{APACHE_EXEC} = apache_exec_setup(); print STDOUT "\n"; } - write_config(); - # add pod merge target my $webtest_pm = File::Spec->catfile(qw(lib HTTP WebTest.pm)); --- 69,76 ---- *************** *** 92,99 **** distprepare :: README ! \t\$(NOOP) distprepare :: $webtest_pm ! \t\$(NOOP) MAKE --- 95,110 ---- distprepare :: README ! \t\@\$(NOOP) distprepare :: $webtest_pm ! \t\@\$(NOOP) ! MAKE ! ! # add test_config target (test and testdb targets depend on it) ! my $test_config_pl = File::Spec->catfile(qw(scripts test_config.PL)); ! $make .= <<MAKE; ! ! test_config: ! \t\$(PERL) $test_config_pl .config MAKE *************** *** 154,223 **** return $make; - } - - # finds where apache binary is located - sub apache_exec_setup { - my $apache_exec = undef; - - # verify that we don't run on Win32 system. Local web files - # test mode is not supported on that platform - if($^O ne 'MSWin32') { - while(1) { - print_prompt(<<TEXT); - - HTTP-WebTest automated test suite contains tests for local web files - test mode. Running these tests requires Apache web server. If you do - not have Apache you can skip these tests. - - Run local web files test mode tests during 'make test'? [Y/n]: - TEXT - - my $response = <STDIN>; - chomp($response); - if($response =~ /^(?:y(?:es)?|)$/i) { - # user asked to run tests - $apache_exec = $ENV{'APACHE'} || which('apache') || - which('httpd') || '/usr/lib/httpd/httpd'; - - print_prompt(<<TEXT); - - Please enter filename of Apache executable file. - - Filename? [$apache_exec]: - TEXT - - my $response = <STDIN>; - chomp($response); - $apache_exec = $response if $response; - last if -x $apache_exec; - print STDOUT <<TEXT; - - ERROR: $apache_exec is not a valid executable file - TEXT - } else { - last; - } - } - } - - return $apache_exec; - } - - # finds executable in PATH (code is stolen from Apache::test) - sub which { - foreach (map { "$_/$_[0]" } split /:/, $ENV{PATH}) { - next unless m,^/,; - return $_ if -x; - } - } - - # dumps config params hash - sub write_config { - local *FILE; - open FILE, '> .config' or die "Can't write to file '.config': $!"; - - print FILE Data::Dumper->Dump([\%CONFIG], [qw(*CONFIG)]); - - close FILE; } --- 165,168 ---- |