The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

VCP::TestUtils - support routines for VCP testing

General utility functions

mk_tmp_dir

Creates one or more temporary directories, which will be removed upon exit in an END block

assert_eq
   assert_eq $test_name, $in, $out ;

dies with a useful diff in $@ is $in ne $out. Returns nothing.

Requires a diff that knows about the -d and -U options.

slurp
   $guts = slurp $filename ;
perl_cmd
   @perl = perl_cmd

Returns a list containing the Perl executable and some options to reproduce the current Perl options , like -I.

vcp_cmd
   @vcp = vcp_cmd

Returns a list containing the Perl executable and some options to reproduce the current Perl options , like -I.

XML "cleanup" functions

These are used to get rid of content or elements that are known to differ when comparing the revml fed in to a repository with the revml that comes out.

s_content
   s_content
      $elt_type1, $elt_type2, ..., \$string1, \$string2, ..., $new_content ;

Changes the contents of the elements, since some things, like suer id or mod_time can't be the same after going through a repository.

If $new_val is not supplied, a constant string is used.

rm_elts
   rm_elts $elt_type1, $elt_type2, ..., \$string1, \$string2
   rm_elts $elt_type1, $elt_type2, ..., qr/$content_re/, \$string1, \$string2

Removes the specified elements from the strings, including leading whitespace and trailing line separators. If the optional $content_re regular expression is provided, then only elements containing that pattern will be removed.

p4 repository mgmt functions

p4_options
   $p4_options = p4_options $prefix ;

Returns a hash of options. $prefix should be unique to the calling program.

p4_borken

Returns true if the p4 is missing or too old (< 99.2).

launch_p4d
   launch_p4d $p4_options ;

Creates an empty repository and launches a p4d for it. The p4d will be killed and it's repository deleted on exit.

CVS mgmt functions

cvs_options
   $cvs_options = cvs_options $prefix ;

returns the options needed to build and access a cvs repository.

init_cvs
   init_cvs $cvs_options, $module_name ;

Creates a CVS repository containing an empty module. Also sets $ENV{LOGNAME} if it notices that we're running as root, so CVS won't give a "cannot commit files as 'root'" error. Tries "nobody", then "guest".

COPYRIGHT

Copyright 2000, Perforce Software, Inc. All Rights Reserved.

This module and the VCP package are licensed according to the terms given in the file LICENSE accompanying this distribution, a copy of which is included in vcp.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 215:

You forgot a '=back' before '=head1'

Around line 424:

You forgot a '=back' before '=head1'