#!/usr/local/bin/perl -w =head1 NAME vcp.t - testing of vcp command =cut use strict ; use Carp ; use Test ; use IPC::Run qw( run ) ; my %seen ; my @perl = ( $^X, map { my $s = $_ ; $s = File::Spec->rel2abs( $_ ) ; "-I$s" ; } grep ! $seen{$_}++, @INC ) ; ## We always run vcp by doing a @perl, vcp, to make sure that vcp runs under ## the same version of perl that we are running under. my $vcp = 'vcp' ; $vcp = "bin/$vcp" if -e "bin/$vcp" ; $vcp = "../bin/$vcp" if -e "../bin/$vcp" ; $vcp = File::Spec->rel2abs( $vcp ) ; my @vcp = ( @perl, $vcp ) ; sub vcp { my $exp_results = shift ; my $out ; my $err ; my $pid = run( [ @vcp, @_ ], \undef, \$out, \$err ) ; confess "$vcp ", join( ' ', @_ ), " returned $?\n$out$err" if defined $exp_results && ! grep $? == $_ << 8, @$exp_results ; return $err . $out ; } my @tests = ( #perldoc now complains when run as root, causing this test to fail #sub { ok( vcp( [ 0 ], 'help' ), qr/OPTIONS/s ) }, sub { ok( vcp( [ 2 ], 'foo:' ), qr/unknown source scheme/s ) }, sub { ok( vcp( [ 2 ], 'p4:', 'foo:' ), qr/unknown destination scheme/s ) }, sub { ok( vcp( [ 1 ], '--foo' ), qr/foo.*Usage/s ) }, ) ; plan tests => scalar( @tests ) ; unless ( -e $vcp ) { print STDERR "# '$vcp' not found\n" ; skip( 1, '' ) for @tests ; exit ; } $_->() for @tests ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 1375 | Sean McCune | Creating my own branch for work on vcp. | ||
//guest/perforce_software/revml/t/10vcp.t | |||||
#4 | 1358 | Barrie Slaymaker | Win32 changes | ||
#3 | 608 | Barrie Slaymaker |
Lots of changes to get vcp to install better, now up to 0.066. Many thanks to Matthew Attaway for testing & suggestions. |
||
#2 | 468 | Barrie Slaymaker |
- VCP::Dest::p4 now does change number aggregation based on the comment field changing or whenever a new revision of a file with unsubmitted changes shows up on the input stream. Since revisions of files are normally sorted in time order, this should work in a number of cases. I'm sure we'll need to generalize it, perhaps with a time thresholding function. - t/90cvs.t now tests cvs->p4 replication. - VCP::Dest::p4 now doesn't try to `p4 submit` when no changes are pending. - VCP::Rev now prevents the same label from being applied twice to a revision. This was occuring because the "r_1"-style label that gets added to a target revision by VCP::Dest::p4 could duplicate a label "r_1" that happened to already be on a revision. - Added t/00rev.t, the beginnings of a test suite for VCP::Rev. - Tweaked bin/gentrevml to comment revisions with their change number instead of using a unique comment for every revision for non-p4 t/test-*-in-0.revml files. This was necessary to test cvs->p4 functionality. |
||
#1 | 467 | Barrie Slaymaker | Version 0.01, initial checkin in perforce public depot. |