Changeset 2582


Ignore:
Timestamp:
Mar 9, 2006, 1:00:44 AM (19 years ago)
Author:
bird
Message:

added _BINMODE variants for OUT, IN and ERR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coreutils/tests/Coreutils.pm

    r2567 r2582  
    1515my $debug = $ENV{DEBUG};
    1616
    17 my @Types = qw (IN OUT ERR AUX CMP EXIT PRE POST OUT_SUBST ERR_SUBST ENV ENV_DEL);
     17my @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
    1819my %Types = map {$_ => 1} @Types;
    1920my %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
    2123my $srcdir = $ENV{srcdir};
    2224my $Global_count = 1;
     
    8688}
    8789
    88 sub _create_file ($$$$)
     90sub _create_file ($$$$$) # bird
    8991{
    90   my ($program_name, $test_name, $file_name, $data) = @_;
     92  my ($program_name, $test_name, $file_name, $data, $binary) = @_; # bird
    9193  my $file;
    9294  if (defined $file_name)
     
    106108  my $fh = new FileHandle "> $file";
    107109  die "$program_name: $file: $!\n" if ! $fh;
     110  if ($binary) {    # bird
     111      binmode $fh;  # bird
     112  }                 # bird
    108113  print $fh $data;
    109114  $fh->close || die "$program_name: $file: $!\n";
     
    129134}
    130135
    131 sub _process_file_spec ($$$$$)
     136sub _process_file_spec ($$$$$$) # bird
    132137{
    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
    134139
    135140  my ($file_name, $contents);
     
    160165                          && defined $contents));
    161166  my $file = _create_file ($program_name, $test_name,
    162                            $file_name, $contents);
     167                           $file_name, $contents,
     168                           $is_binmode); # bird
    163169
    164170  if ($is_junk_file)
     
    280286          die "$program_name: $test_name: invalid key `$type' in test spec\n"
    281287            if ! $Types{$type};
     288
     289          # remove _BINMODE                             # bird
     290          my $is_binmode = $type =~ s/_BINMODE$//;      # bird
     291          $type =~ s/_BINMODE//;                        # bird
    282292
    283293          # Make sure there's no more than one of OUT, ERR, EXIT, etc.
     
    324334                    }
    325335                  my $cmp_file = _process_file_spec ($program_name, $test_name,
    326                                                      $e, $type, \@junk_files);
     336                                                     $e, $type, \@junk_files,
     337                                                     $is_binmode); # bird
    327338                  push @cmp_files, $cmp_file;
    328339                }
     
    362373
    363374          my $file = _process_file_spec ($program_name, $test_name, $val,
    364                                          $type, \@junk_files);
     375                                         $type, \@junk_files,
     376                                         $is_binmode); # bird
    365377
    366378          if ($type eq 'IN')
     
    387399            {
    388400              $expect->{$eo} = _create_file ($program_name, $test_name,
    389                                              undef, '');
     401                                             undef, '', 0); # bird
    390402              push @junk_files, $expect->{$eo};
    391403            }
Note: See TracChangeset for help on using the changeset viewer.