source: ProjectBuilder/devel/pb-modules/t/Log.t@ 1147

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