~ubuntu-branches/ubuntu/raring/parrot/raring-proposed

« back to all changes in this revision

Viewing changes to t/configure/063-git_describe_to_cache.t

  • Committer: Bazaar Package Importer
  • Author(s): Allison Randal
  • Date: 2011-07-30 18:45:03 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110730184503-34d4mprtfx6pt5h3
Tags: 3.6.0-1
* New upstream release
* debian/watch:
  - Modified regular expression to capture numbered directory name
    (patch from Dominique Dumont).
* debian/rules:
  - Split build-arch and build-indep, resolving lintian warning.
  - Update path to pbc_disassemble for manpage generation (patch
    from Dominique Dumont).
* debian/patches:
  - Added patch 02_fix_perl_interpreter_path.patch, resolving
    lintian warnings.
* debian/control:
  - Added DM-Upload-Allowed field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! perl
2
 
# Copyright (C) 2010-2011, Parrot Foundation.
3
 
# 063-git_describe_to_cache.t
4
 
 
5
 
use strict;
6
 
use warnings;
7
 
 
8
 
use Test::More;
9
 
if (-e 'DEVELOPING' and ! -e 'Makefile') {
10
 
    plan tests =>  8;
11
 
}
12
 
else {
13
 
    plan skip_all =>
14
 
        q{Relevant only when working in a development repo and prior to configuration};
15
 
}
16
 
use Carp;
17
 
use Cwd;
18
 
use File::Copy;
19
 
use File::Path ();
20
 
use File::Temp qw| tempdir |;
21
 
use lib qw( lib );
22
 
 
23
 
my $cwd = cwd();
24
 
{
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");
29
 
 
30
 
    # Cannot get it to work with this. Why do we need it?
31
 
    #local @INC;
32
 
 
33
 
    unshift @INC, $libdir;
34
 
    ok( (File::Path::mkpath( [ qq{$libdir/Parrot/Git} ], 0, 0777 )), "Able to make Parrot dir");
35
 
    chdir $cwd;
36
 
 
37
 
    require Parrot::Git::Describe;
38
 
    {
39
 
        no warnings 'once';
40
 
        TODO: {
41
 
        ok( (copy qq{$cwd/lib/Parrot/Git/Describe.pm},
42
 
                qq{$libdir/Parrot/Git}), "Able to copy Parrot::Git::Describe");
43
 
 
44
 
            like($Parrot::Git::Describe::current,
45
 
                qr/^(RELEASE_|REL_)\d+\_\d+\_\d+(\-\d+\-g[a-z0-9]+)?$/i,
46
 
                "Got a describe string",
47
 
            );
48
 
        };
49
 
    }
50
 
    my $cache = q{.parrot_current_git_describe};
51
 
    my $size = -s $cache;
52
 
    cmp_ok( $size , '>', 0, "Cache for sha1 number was created and nonempty : $size bytes");
53
 
 
54
 
    chdir $tdir;
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");
58
 
}
59
 
 
60
 
pass("Completed all tests in $0");
61
 
 
62
 
=head1 NAME
63
 
 
64
 
063-git_describe_to_cache.t - test caching in Parrot::Git::Describe
65
 
 
66
 
=head1 SYNOPSIS
67
 
 
68
 
    % prove t/configure/063-git_describe_to_cache.t
69
 
 
70
 
=head1 DESCRIPTION
71
 
 
72
 
The files in this directory test functionality used by F<Configure.pl>.
73
 
 
74
 
The tests in this file test Parrot::Git::Describe (F<lib/Parrot/Git::Describe.pm>).
75
 
 
76
 
=head1 AUTHOR
77
 
 
78
 
Jonathan "Duke" Leto
79
 
 
80
 
=head1 SEE ALSO
81
 
 
82
 
Parrot::Configure, F<Configure.pl>.
83
 
 
84
 
=cut
85
 
 
86
 
# Local Variables:
87
 
#   mode: cperl
88
 
#   cperl-indent-level: 4
89
 
#   fill-column: 100
90
 
# End:
91
 
# vim: expandtab shiftwidth=4: