# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..8\n"; } END {print "not ok 1\n" unless $loaded;} use P4; $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): my $depotSpec = '//depot'; # needs config my $clientSpec = '//client'; # needs config my $file = 'include/ver.h'; # needs config my $options = '-p localhost:1666'; # needs config my $arguments = ""; my $labelForm = { Label => 'Label_test', Owner => 'Irene', Description => 'Build label', View => "$depotSpec/...", }; # needs config my $editForm = { Change => 'new', Client => lc($NEV{COMPUTERNAME}), User => lc($ENV{USERNAME}), Status => 'new', Description => 'Bump Ver', Files => "$depotSpec/$file", }; #(p4-verb && print "ok x\n") || print "not ok x\n"; # info (Info() && print "ok 2\n") or print "not ok 2\n"; # clean (Get('#none', options => $options, arguments => $arguments) && print "ok 2\n") || print "not ok 2\n"; # get file (Get("$depotSpec/$file", options => $options, arguments => $arguments) && print "ok 4\n") || print "not ok 4\n"; # checkout for bumpver (Checkout("$depotSpec/$file", options => $options, arguments => $arguments,) && print "ok 5\n") || print "not ok 5\n"; # checkin bumped ver (Checkin("$depotSpec/$file", options => $options, arguments => $arguments, form => $editForm) && print "ok 6\n") || print "not ok 6\n"; # get all files (Get("$depotSpec/...", options => $options, arguments => $arguments . ' -f') && print "ok 7\n") || print "not ok 7\n"; # label for build (Label($labelForm->{Label}, options => $options, arguments => $arguments, form => $labelForm) && print "ok 8\n") || print "not ok 8\n"; __END__