Changeset 2582
- Timestamp:
- Mar 9, 2006, 1:00:44 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/coreutils/tests/Coreutils.pm
r2567 r2582 15 15 my $debug = $ENV{DEBUG}; 16 16 17 my @Types = qw (IN OUT ERR AUX CMP EXIT PRE POST OUT_SUBST ERR_SUBST ENV ENV_DEL); 17 my @Types = qw (IN OUT ERR AUX CMP EXIT PRE POST OUT_SUBST ERR_SUBST ENV ENV_DEL 18 IN_BINMODE OUT_BINMODE ERR_BINMODE); # bird 18 19 my %Types = map {$_ => 1} @Types; 19 20 my %Zero_one_type = map {$_ => 1} 20 qw (OUT ERR EXIT PRE POST OUT_SUBST ERR_SUBST ENV); 21 qw (OUT ERR EXIT PRE POST OUT_SUBST ERR_SUBST ENV 22 OUT_BINMODE ERR_BINMODE); # bird 21 23 my $srcdir = $ENV{srcdir}; 22 24 my $Global_count = 1; … … 86 88 } 87 89 88 sub _create_file ($$$$ )90 sub _create_file ($$$$$) # bird 89 91 { 90 my ($program_name, $test_name, $file_name, $data ) = @_;92 my ($program_name, $test_name, $file_name, $data, $binary) = @_; # bird 91 93 my $file; 92 94 if (defined $file_name) … … 106 108 my $fh = new FileHandle "> $file"; 107 109 die "$program_name: $file: $!\n" if ! $fh; 110 if ($binary) { # bird 111 binmode $fh; # bird 112 } # bird 108 113 print $fh $data; 109 114 $fh->close || die "$program_name: $file: $!\n"; … … 129 134 } 130 135 131 sub _process_file_spec ($$$$$ )136 sub _process_file_spec ($$$$$$) # bird 132 137 { 133 my ($program_name, $test_name, $file_spec, $type, $junk_files ) = @_;138 my ($program_name, $test_name, $file_spec, $type, $junk_files, $is_binmode) = @_; # bird 134 139 135 140 my ($file_name, $contents); … … 160 165 && defined $contents)); 161 166 my $file = _create_file ($program_name, $test_name, 162 $file_name, $contents); 167 $file_name, $contents, 168 $is_binmode); # bird 163 169 164 170 if ($is_junk_file) … … 280 286 die "$program_name: $test_name: invalid key `$type' in test spec\n" 281 287 if ! $Types{$type}; 288 289 # remove _BINMODE # bird 290 my $is_binmode = $type =~ s/_BINMODE$//; # bird 291 $type =~ s/_BINMODE//; # bird 282 292 283 293 # Make sure there's no more than one of OUT, ERR, EXIT, etc. … … 324 334 } 325 335 my $cmp_file = _process_file_spec ($program_name, $test_name, 326 $e, $type, \@junk_files); 336 $e, $type, \@junk_files, 337 $is_binmode); # bird 327 338 push @cmp_files, $cmp_file; 328 339 } … … 362 373 363 374 my $file = _process_file_spec ($program_name, $test_name, $val, 364 $type, \@junk_files); 375 $type, \@junk_files, 376 $is_binmode); # bird 365 377 366 378 if ($type eq 'IN') … … 387 399 { 388 400 $expect->{$eo} = _create_file ($program_name, $test_name, 389 undef, '' );401 undef, '', 0); # bird 390 402 push @junk_files, $expect->{$eo}; 391 403 }
Note:
See TracChangeset
for help on using the changeset viewer.