80rcs_parser.t #6

  • //
  • guest/
  • perforce_software/
  • revml/
  • t/
  • 80rcs_parser.t
  • View
  • Commits
  • Open Download .zip Download (2 KB)
#!/usr/local/bin/perl -w

=head1 NAME

80rcs_parser.t - test VCP::Source::cvs's RCS file parser

=cut

use strict ;

use Carp ;
use Test ;
use VCP::Source::cvs;
use VCP::Dest::null;

sub check {
   goto &die if $ENV{FATALTEST} && ! $_[0];
}


my $s;

my @tests = (
(
   map {
      my $size = $_;
      (
         sub {
            $s = VCP::Source::cvs->new( "cvs:t:...", [] );
            $s->init;

            $s->{CVS_READ_SIZE} = $size;
            check ok
               eval { $s->parse_rcs_file( "rcs_file" ); 1 } || $@,
               1,
               "READ_SIZE = $size";
         },
         sub {
            check ok $s->sent_rev_count, 4;
         },
      );
   } ( 1_000_000, 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 )
),

sub {
   my $s = VCP::Source::cvs->new( "cvs:t:rcs_file", [] );
   my $d = VCP::Dest::null->new;
   $s->dest( $d );
   $d->{NULL_GET_REVS} = 0;  ## Don't try to actually copy the revs,
                             ## t/ is not a real repository.  We just want
                             ## to make sure that all the metadata can be
                             ## extracted to test parsing of vendor branch
                             ## rev numbers (at least).  It's a regression
                             ## thing.
   $s->init;
   $s->copy_revs;
   ok 1;
},

sub {
   my $s = VCP::Source::cvs->new( "cvs:t:buildpss.ksh", [] );
   my $d = VCP::Dest::null->new;
   $s->dest( $d );
   $d->{NULL_GET_REVS} = 0;  ## Don't try to actually copy the revs,
                             ## t/ is not a real repository.  We just want
                             ## to make sure that all the metadata can be
                             ## extracted to test parsing of vendor branch
                             ## rev numbers (at least).  It's a regression
                             ## thing.
   $s->init;
   $s->copy_revs;
   ok 1;
},

) ;

plan tests => scalar( @tests ) ;

$_->() for @tests ;
# Change User Description Committed
#8 5082 Barrie Slaymaker - VCP::Source tells VCP::Rev to uncache the source to allow
  the source instance to be DESTROYed and thus clean up its
  working files.
#7 3970 Barrie Slaymaker - VCP::Source handles rev queing, uses disk to reduce RAM
- Lots of other fixes
#6 3930 Barrie Slaymaker - VCP::Source::cvs and VCP::Dest::p4 handle cloning deletes
- "placeholder" actions and is_placeholder_rev() deprecated in
  favor of is_branch_rev() and is_clone_rev().
- Misc cleanups and minor bugfixes
#5 3808 Barrie Slaymaker - t/80rcs_parser.t passes again
#4 3746 Barrie Slaymaker - VCP::Source::cvs parses vendor tags when no revisions are present
  on the vendor branch (as per Marc Tooley's patch)
    - add test for said parsing
#3 3276 John Fetkovich fixed test suite that called VCP::Source::cvs->new()
       to also call new init function.
#2 3155 Barrie Slaymaker Convert to logging using VCP::Logger to reduce stdout/err spew.
       Simplify & speed up debugging quite a bit.
       Provide more verbose information in logs.
       Print to STDERR progress reports to keep users from wondering
       what's going on.
       Breaks test; halfway through upgrading run3() to an inline
       function for speed and for VCP specific features.
#1 2334 Barrie Slaymaker Test RCS file parsing.