/[cons]/cons/test/Test/Cmd.pm
ViewVC logotype

Diff of /cons/test/Test/Cmd.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by knight, Fri May 26 15:03:41 2000 UTC revision 1.5 by rv, Tue Apr 17 20:10:46 2001 UTC
# Line 211  BEGIN { Line 211  BEGIN {
211          $iswin32 = $^O eq "MSWin32";          $iswin32 = $^O eq "MSWin32";
212      }      }
213    
214        my @tmps = ();
215      if ($iswin32) {      if ($iswin32) {
216          eval("use Win32;");          eval("use Win32;");
217          $Test::Cmd::_WIN32 = 1;          $Test::Cmd::_WIN32 = 1;
218          $Test::Cmd::Temp_Prefix = "~testcmd$$-";          $Test::Cmd::Temp_Prefix = "~testcmd$$-";
219          $Test::Cmd::Cwd_Ref = \&Win32::GetCwd;          # Test for WIN32 temporary directories.
220          if (! $Test::Cmd::TMPDIR) {          # The following is lifted from the 5.005056
221              # Test for WIN32 temporary directories.          # version of File::Spec::Win32::tmpdir.
222              # The following is lifted from the 5.005056          push @tmps, @ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)
             # version of File::Spec::Win32::tmpdir.  
             foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) {  
                 next unless defined && -d;  
                 $Test::Cmd::TMPDIR = $_;  
                 last;  
             }  
         }  
223      } else {      } else {
224          $Test::Cmd::Temp_Prefix = "testcmd$$.";          $Test::Cmd::Temp_Prefix = "testcmd$$.";
225          $Test::Cmd::Cwd_Ref = \&Cwd::cwd;          # Test for UNIX temporary directories.
226          if (! $Test::Cmd::TMPDIR) {          # The following is lifted from the 5.005056
227              # Test for UNIX temporary directories.          # version of File::Spec::Unix::tmpdir.
228              # The following is lifted from the 5.005056          push @tmps, $ENV{TMPDIR}, "/tmp";
229              # version of File::Spec::Unix::tmpdir.      }
230              foreach ($ENV{TMPDIR}, "/tmp") {  
231                  next unless defined && -d && -w _;      $Test::Cmd::Cwd_Ref = \&Cwd::cwd;
232                  $Test::Cmd::TMPDIR = $_;      if (! $Test::Cmd::TMPDIR) {
233                  last;          foreach (@tmps) {
234              }              next unless defined && -d && -w _;
235                $Test::Cmd::TMPDIR = $_;
236                last;
237          }          }
238      }      }
239    
# Line 991  sub match { Line 987  sub match {
987          #       print STDERR "Expect:  $re\n";          #       print STDERR "Expect:  $re\n";
988          #       print STDERR "Got:     $l\n";          #       print STDERR "Got:     $l\n";
989          #}          #}
990            next if  $l eq $re;     # For exact text matches.
991          return undef if $l !~ m/^$re$/;          return undef if $l !~ m/^$re$/;
992      }      }
993      return 1;      return 1;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26