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

Last change on this file since 1109 was 1109, checked in by Bruno Cornec, 13 years ago

r4041@localhost: bruno | 2010-11-17 11:40:41 +0100

  • Adds new configuration parameters (oschkcmd, oschkopt) to externalize package checking command
  • Adds new configuration parameters (pbinstalltype, pbpkg) to start allowing installation of pb in VM/VE with packages or files (this last is only needed by upstream)
  • Remove dependency on Mail::Sendmail to where it's really needed (part of Log, not used yet, and annouce). In particular this removes one non std dep for VE/VM build.
File size: 1.3 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};
13
14# Test::More not found so no test will be performed here
15if ($@) {
16 require Test;
17 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.