source: devel/pb-modules/t/Log.t @ 1106

Last change on this file since 1106 was 1106, checked in by Bruno Cornec, 10 years ago
  • Avoids to force a dep on Test::More. Just use Test and a fake test if Test::More is not available.
File size: 1.3 KB
Line 
1#!/usr/bin/perl -w
2#
3# Tests ProjectBuilder::Log functions
4
5use strict;
6use ProjectBuilder::Base;
7use Test;
8
9eval
10{
11  require Test::More;
12  Test::More->import();
13};
14
15# Test::More not found so no test will be performed here
16if ($@) {
17    BEGIN { plan tests => 1 };
18    print "# Faking tests as test::More is not available\n";
19    ok(1,1);
20    exit (0);
21}
22
23is("tmp", "tmp", "temp test");
24done_testing(1);
25exit(0);
26
27use ProjectBuilder::Log;
28
29my $nt = 0;
30# Acquires test data
31my $logf = "combined.log";
32if (!open(FILE, "< $logf")) {
33    die("Could not open file $logf\n");
34}
35my @lines = <FILE>;
36close(FILE);
37
38my $log = new ProjectBuilder::Log;
39$log->setCompleteLog(join("\n", @lines));
40my $test = {
41    # Full URI
42    "svn+ssh://account\@machine.sdom.tld:8080/path/to/file" => ["svn+ssh","account","machine.sdom.tld","8080","/path/to/file"],
43    # Partial URI
44    "http://machine2/path1/to/anotherfile" => ["http","","machine2","","/path1/to/anotherfile"],
45    };
46
47my ($scheme, $account, $host, $port, $path);
48foreach my $lines (split(/\n/,$log->summary)) {
49    #($scheme, $account, $host, $port, $path) = pb_get_uri($uri);
50
51    #is($scheme, $test->{$uri}[0], "pb_get_uri Test protocol $uri");
52    #$nt++;
53
54}
55
56#$ENV{'TMPDIR'} = "/tmp";
57#pb_temp_init();
58#like($ENV{'PBTMP'}, qr|/tmp/pb\.[0-9A-z]+|, "pb_temp_init Test");
59#$nt++;
60
61done_testing($nt);
Note: See TracBrowser for help on using the repository browser.