2 # Copyright (C) 2007, Parrot Foundation.
4 # 018-revision_to_cache.t
10 if (-e 'DEVELOPING' and ! -e 'Makefile') {
15 q{Relevant only when working in checkout from repository and prior to configuration};
21 use File::Temp qw| tempdir |;
26 my $tdir = tempdir( CLEANUP => 1 );
27 ok( chdir $tdir, "Changed to temporary directory for testing" );
28 my $libdir = qq{$tdir/lib};
29 ok( (File::Path::mkpath( [ $libdir ], 0, 0777 )), "Able to make libdir");
31 unshift @INC, $libdir;
32 ok( (File::Path::mkpath( [ qq{$libdir/Parrot} ], 0, 0777 )), "Able to make Parrot dir");
33 ok( (copy qq{$cwd/lib/Parrot/Revision.pm},
34 qq{$libdir/Parrot}), "Able to copy Parrot::Revision");
35 require Parrot::Revision;
37 like($Parrot::Revision::current, qr/^\d+$/,
38 "Got numeric value for revision number");
40 my $cache = q{.parrot_current_rev};
41 ok( ( -e $cache ), "Cache for revision number was created");
42 unlink qq{$libdir/Parrot/Revision.pm}
43 or croak "Unable to delete file after testing";
44 ok( chdir $cwd, "Able to change back to starting directory");
47 pass("Completed all tests in $0");
49 ################### DOCUMENTATION ###################
53 018-revision_to_cache.t - test Parrot::Revision
57 % prove t/configure/018-revision_to_cache.t
61 The files in this directory test functionality used by F<Configure.pl>.
63 The tests in this file test Parrot::Revision (F<lib/Parrot/Revision.pm>).
71 Parrot::Configure, F<Configure.pl>.
77 # cperl-indent-level: 4
80 # vim: expandtab shiftwidth=4: