httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestUtil.pm
Date Sat, 20 Oct 2001 05:02:05 GMT
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;
  
  
  

Mime
View raw message