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

Last change on this file since 1153 was 1153, checked in by Bruno Cornec, 13 years ago
  • Avoid File::MimeInfo hard requirement. Only abort if not found when needed.
  • Improve report when a perl module is missing
  • Kill an existing crashed VM using an SSH port needed for another VM (should avoid crashed VM to stay when building for all VMs)
  • Use a new parameter vmbuildtm as a timeout before killing the VM (shoudl correspond to build + transfer time)
  • use twice the number of VMs for ports in the range for SSH communication to allow for VMs to finish in an unordered way.
  • Fix a bug in test modules when using Test simple only
  • Mail::Sendmail is now optional for Log module as well, even if not used yet
  • Update pb.conf doc with info for vmbuildtm and vmmem
  • Ready for 0.10.1
File size: 1.5 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 Test->import();
22 plan(tests => 1);
23 print "# Faking tests as test::More is not available in an appropriate version\n";
24 ok(1,1);
25 exit (0);
26}
27
28is("tmp", "tmp", "temp test");
29done_testing(1);
30exit(0);
31
32use ProjectBuilder::Log;
33
34my $nt = 0;
35# Acquires test data
36my $logf = "combined.log";
37if (!open(FILE, "< $logf")) {
38 die("Could not open file $logf\n");
39}
40my @lines = <FILE>;
41close(FILE);
42
43my $log = new ProjectBuilder::Log;
44$log->setCompleteLog(join("\n", @lines));
45my $test = {
46 # Full URI
47 "svn+ssh://account\@machine.sdom.tld:8080/path/to/file" => ["svn+ssh","account","machine.sdom.tld","8080","/path/to/file"],
48 # Partial URI
49 "http://machine2/path1/to/anotherfile" => ["http","","machine2","","/path1/to/anotherfile"],
50 };
51
52my ($scheme, $account, $host, $port, $path);
53foreach my $lines (split(/\n/,$log->summary)) {
54 #($scheme, $account, $host, $port, $path) = pb_get_uri($uri);
55
56 #is($scheme, $test->{$uri}[0], "pb_get_uri Test protocol $uri");
57 #$nt++;
58
59}
60
61#$ENV{'TMPDIR'} = "/tmp";
62#pb_temp_init();
63#like($ENV{'PBTMP'}, qr|/tmp/pb\.[0-9A-z]+|, "pb_temp_init Test");
64#$nt++;
65
66done_testing($nt);
Note: See TracBrowser for help on using the repository browser.