Changeset 9671


Ignore:
Timestamp:
12/13/09 07:02:10 (2 years ago)
Author:
szabgab
Message:

add another test printing to STDOUT and STDERR

Location:
trunk/Debug-Client/t
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Debug-Client/t/eg/02-sub.pl

    r292 r9671  
    1010 
    1111 
     12 
    1213sub f { 
    1314   my ($q, $w) = @_; 
  • trunk/Debug-Client/t/lib/Debugger.pm

    r9657 r9671  
    1010@ISA = ('Exporter'); 
    1111 
    12 @EXPORT = qw(start_script start_debugger); 
     12@EXPORT = qw(start_script start_debugger slurp); 
    1313 
    1414my $host = 'localhost'; 
     
    1717sub start_script { 
    1818    my ($file) = @_; 
     19    my $dir = tempdir(CLEANUP => 0); 
     20    my $path = $dir; 
     21    if ($^O =~ /Win32/i) { 
     22        require Win32; 
     23        $path = Win32::GetLongPathName($path); 
     24    } 
     25     
    1926    my $pid = fork(); 
    20     my $dir = tempdir(CLEANUP => 1); 
    21  
    2227    die if not defined $pid; 
    2328 
     
    2530        local $ENV{PERLDB_OPTS} = "RemotePort=$host:$port"; 
    2631        sleep 1; 
    27         exec "$^X -d $file > $dir/out 2> $dir/err"; 
     32        #warn "path '$path'"; 
     33        exec qq($^X -d $file > "$path/out" 2> "$path/err"); 
    2834        exit 0; 
    2935    } 
     
    3945} 
    4046 
     47sub slurp { 
     48    my ($file) = @_; 
    4149 
     50    open my $fh, '<', $file or die "Could not open '$file' $!"; 
     51    local $/ = undef; 
     52    return <$fh>; 
     53} 
    42541; 
    4355 
Note: See TracChangeset for help on using the changeset viewer.