You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by do...@apache.org on 2001/10/20 07:02:05 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestUtil.pm

dougm       01/10/19 22:02:05

  Modified:    perl-framework/Apache-Test/lib/Apache TestUtil.pm
  Log:
  function to write a shell script for unix, bat for win32
  
  Revision  Changes    Path
  1.9       +21 -0     httpd-test/perl-framework/Apache-Test/lib/Apache/TestUtil.pm
  
  Index: TestUtil.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestUtil.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestUtil.pm	2001/10/16 20:30:57	1.8
  +++ TestUtil.pm	2001/10/20 05:02:05	1.9
  @@ -51,6 +51,27 @@
       return $fh;
   }
   
  +sub write_shell_script {
  +    my $file = shift;
  +
  +    my $code = join '', @_;
  +    my($ext, $shebang);
  +
  +    if (Apache::TestConfig::WIN32()) {
  +	$code =~ s/echo$/echo./mg; #required to echo newline
  +	$ext = 'bat';
  +	$shebang = "\@echo off\nREM this is a bat";
  +    }
  +    else {
  +	$ext = 'sh';
  +	$shebang = '#!/bin/sh';
  +    }
  +
  +    $file .= ".$ext";
  +    t_write_file($file, "$shebang\n", $code);
  +    $ext;
  +}
  +
   sub t_mkdir {
       my $dir = shift;
       die "must pass a dirname" unless defined $dir;
  
  
  

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestUtil.pm

Posted by Stas Bekman <st...@stason.org>.
dougm@apache.org wrote:

> dougm       01/10/19 22:02:05
> 
>   Modified:    perl-framework/Apache-Test/lib/Apache TestUtil.pm
>   Log:
>   function to write a shell script for unix, bat for win32
...
>   +sub write_shell_script {


shouldn't this be t_write_shell_script in complience with the naming of other methods in this module? 


Or is it ok, since it's not exported?



_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestUtil.pm

Posted by Stas Bekman <st...@stason.org>.
dougm@apache.org wrote:

> dougm       01/10/19 22:02:05
> 
>   Modified:    perl-framework/Apache-Test/lib/Apache TestUtil.pm
>   Log:
>   function to write a shell script for unix, bat for win32
...
>   +sub write_shell_script {


shouldn't this be t_write_shell_script in complience with the naming of other methods in this module? 


Or is it ok, since it's not exported?



_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/