2
# Copyright (C) 2010-2011, Parrot Foundation.
3
# 063-git_describe_to_cache.t
9
if (-e 'DEVELOPING' and ! -e 'Makefile') {
14
q{Relevant only when working in a development repo and prior to configuration};
20
use File::Temp qw| tempdir |;
25
my $tdir = tempdir( CLEANUP => 1 );
26
ok( chdir $tdir, "Changed to temporary directory for testing" );
27
my $libdir = qq{$tdir/lib};
28
ok( (File::Path::mkpath( [ $libdir ], 0, 0777 )), "Able to make libdir");
30
# Cannot get it to work with this. Why do we need it?
33
unshift @INC, $libdir;
34
ok( (File::Path::mkpath( [ qq{$libdir/Parrot/Git} ], 0, 0777 )), "Able to make Parrot dir");
37
require Parrot::Git::Describe;
41
ok( (copy qq{$cwd/lib/Parrot/Git/Describe.pm},
42
qq{$libdir/Parrot/Git}), "Able to copy Parrot::Git::Describe");
44
like($Parrot::Git::Describe::current,
45
qr/^(RELEASE_|REL_)\d+\_\d+\_\d+(\-\d+\-g[a-z0-9]+)?$/i,
46
"Got a describe string",
50
my $cache = q{.parrot_current_git_describe};
52
cmp_ok( $size , '>', 0, "Cache for sha1 number was created and nonempty : $size bytes");
55
unlink qq{$libdir/Parrot/Git/Describe.pm}
56
or croak "Unable to delete file after testing";
57
ok( chdir $cwd, "Able to change back to starting directory");
60
pass("Completed all tests in $0");
64
063-git_describe_to_cache.t - test caching in Parrot::Git::Describe
68
% prove t/configure/063-git_describe_to_cache.t
72
The files in this directory test functionality used by F<Configure.pl>.
74
The tests in this file test Parrot::Git::Describe (F<lib/Parrot/Git::Describe.pm>).
82
Parrot::Configure, F<Configure.pl>.
88
# cperl-indent-level: 4
91
# vim: expandtab shiftwidth=4: