s3:winbind: Convert WINBINDD_GETUSERSIDS to the new API
[Samba/aatanasov.git] / selftest / BuildFarm.pm
blob80a91ac154041c4c213402fb1c562c3413c58b33
1 #!/usr/bin/perl
2 # Convenience functions for writing output expected by the buildfarm
3 # Copyright (C) 2009 Jelmer Vernooij <jelmer@samba.org>
4 # Published under the GNU GPL, v3 or later
6 package BuildFarm;
8 use Exporter;
9 @ISA = qw(Exporter);
10 @EXPORT_OK = qw(start_testsuite end_testsuite skip_testsuite summary);
12 use strict;
14 sub start_testsuite($$)
16 my ($name, $duration) = @_;
17 my $out = "";
19 $out .= "--==--==--==--==--==--==--==--==--==--==--\n";
20 $out .= "Running test $name (level 0 stdout)\n";
21 $out .= "--==--==--==--==--==--==--==--==--==--==--\n";
22 $out .= scalar(localtime())."\n";
23 $out .= "SELFTEST RUNTIME: " . $duration . "s\n";
24 $out .= "NAME: $name\n";
26 print $out;
29 sub end_testsuite($$$$$)
31 my ($name, $duration, $ok, $output, $reason) = @_;
32 my $out = "";
34 $out .= "TEST RUNTIME: " . $duration . "s\n";
35 if ($ok) {
36 $out .= "ALL OK\n";
37 } else {
38 $out .= "ERROR: $reason\n";
40 $out .= "==========================================\n";
41 if ($ok) {
42 $out .= "TEST PASSED: $name\n";
43 } else {
44 $out .= "TEST FAILED: $name (status $reason)\n";
46 $out .= "==========================================\n";
48 print $out;
51 sub skip_testsuite($)
53 my ($name) = @_;
55 print "SKIPPED: $name\n";
58 sub summary($)
60 my ($duration) = @_;
62 print "DURATION: " . $duration . " seconds\n";