use Test::More tests => 11;
BEGIN { use_ok('P4'); } ## test 1
# Load test utils
unshift( @INC, "." );
unshift( @INC, "t" );
require_ok("p4test"); ## test 2
my $test = P4::Test->new();
my $p4 = $test->InitClient();
ok( defined($p4) ); ## test 3
ok( $p4->Connect() ); ## test 4
##
## DVCS Init test
##
my %init;
$init{"port"} = $p4->GetPort();
$init{"user"} = $p4->GetUser();
$init{"client"} = $p4->GetClient();
$init{"directory"} = $test->ClientRoot() . "/init";
$init{"casesensitive"} = 1;
$init{"unicode"} = 0;
my $dvcs1 = P4->Init(\%init);
ok( defined($dvcs1) ); ## test 5
ok( $dvcs1->GetPort() =~ "rsh:/bin/sh" ); ## test 6
is( $dvcs1->GetCwd(), $init{"directory"} ); ## test 7
ok( $dvcs1->Connect() ); ## test 8
@depots = $dvcs1->RunDepots();
ok( scalar( @depots ) == 1 ); ## test 9
$dvcs1->Disconnect();
##
## DVCS Clone test
##
$p4->RunConfigure( 'set', 'server.allowfetch=3' );
$p4->RunConfigure( 'set', 'server.allowpush=3' );
## need to disconnect to enable the configure variables (fix 16.2)
$p4->Disconnect();
$p4->Connect();
my %clone;
$clone{"port"} = $p4->GetPort();
$clone{"user"} = $p4->GetUser();
$clone{"directory"} = $test->ClientRoot() . "/clone";
$clone{"file"} = "//depot/test_files/...";
my $dvcs2 = P4->Clone(\%clone);
ok( $dvcs2->Connect() ); ## test 10
@files = $dvcs2->RunFiles('//...');
ok( scalar( @files ) > 1 ); ## test 11
$dvcs2->Disconnect();
# |
Change |
User |
Description |
Committed |
|
#2
|
19592 |
jmash |
Convert uses of indirect object construction syntax to use direct syntax in the test modules. |
|
|
#1
|
19582 |
jmash |
Initial fork of P4Perl. |
|
|
//guest/perforce_software/p4perl/main/t/65-dvcs.t |
#1
|
19372 |
Paul Allen |
Update with P16.1 changes. |
|
|