[1090] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # Tests ProjectBuilder::Log functions
|
---|
| 4 |
|
---|
| 5 | use strict;
|
---|
| 6 | use ProjectBuilder::Base;
|
---|
| 7 |
|
---|
[1106] | 8 | eval
|
---|
| 9 | {
|
---|
[1147] | 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 | }
|
---|
[1106] | 16 | };
|
---|
| 17 |
|
---|
| 18 | # Test::More not found so no test will be performed here
|
---|
| 19 | if ($@) {
|
---|
[1109] | 20 | require Test;
|
---|
[1153] | 21 | Test->import();
|
---|
[1109] | 22 | plan(tests => 1);
|
---|
[1147] | 23 | print "# Faking tests as test::More is not available in an appropriate version\n";
|
---|
[1106] | 24 | ok(1,1);
|
---|
| 25 | exit (0);
|
---|
| 26 | }
|
---|
| 27 |
|
---|
[1090] | 28 | is("tmp", "tmp", "temp test");
|
---|
| 29 | done_testing(1);
|
---|
| 30 | exit(0);
|
---|
| 31 |
|
---|
| 32 | use ProjectBuilder::Log;
|
---|
| 33 |
|
---|
| 34 | my $nt = 0;
|
---|
| 35 | # Acquires test data
|
---|
| 36 | my $logf = "combined.log";
|
---|
| 37 | if (!open(FILE, "< $logf")) {
|
---|
| 38 | die("Could not open file $logf\n");
|
---|
| 39 | }
|
---|
| 40 | my @lines = <FILE>;
|
---|
| 41 | close(FILE);
|
---|
| 42 |
|
---|
| 43 | my $log = new ProjectBuilder::Log;
|
---|
| 44 | $log->setCompleteLog(join("\n", @lines));
|
---|
| 45 | my $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 |
|
---|
| 52 | my ($scheme, $account, $host, $port, $path);
|
---|
| 53 | foreach 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 |
|
---|
| 66 | done_testing($nt);
|
---|