| Last change
 on this file since 622 was             414, checked in by Herwig Bauernfeind, 16 years ago | 
        
          | 
Samba 3.5.0: Initial import
 | 
        
          | File size:
            1.3 KB | 
      
      
| Line |  | 
|---|
| 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 | 
|---|
| 5 |  | 
|---|
| 6 | package BuildFarm; | 
|---|
| 7 |  | 
|---|
| 8 | use Exporter; | 
|---|
| 9 | @ISA = qw(Exporter); | 
|---|
| 10 | @EXPORT_OK = qw(start_testsuite end_testsuite skip_testsuite summary); | 
|---|
| 11 |  | 
|---|
| 12 | use strict; | 
|---|
| 13 |  | 
|---|
| 14 | sub start_testsuite($$) | 
|---|
| 15 | { | 
|---|
| 16 | my ($name, $duration) = @_; | 
|---|
| 17 | my $out = ""; | 
|---|
| 18 |  | 
|---|
| 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"; | 
|---|
| 25 |  | 
|---|
| 26 | print $out; | 
|---|
| 27 | } | 
|---|
| 28 |  | 
|---|
| 29 | sub end_testsuite($$$$$) | 
|---|
| 30 | { | 
|---|
| 31 | my ($name, $duration, $ok, $output, $reason) = @_; | 
|---|
| 32 | my $out = ""; | 
|---|
| 33 |  | 
|---|
| 34 | $out .= "TEST RUNTIME: " . $duration . "s\n"; | 
|---|
| 35 | if ($ok) { | 
|---|
| 36 | $out .= "ALL OK\n"; | 
|---|
| 37 | } else { | 
|---|
| 38 | $out .= "ERROR: $reason\n"; | 
|---|
| 39 | } | 
|---|
| 40 | $out .= "==========================================\n"; | 
|---|
| 41 | if ($ok) { | 
|---|
| 42 | $out .= "TEST PASSED: $name\n"; | 
|---|
| 43 | } else { | 
|---|
| 44 | $out .= "TEST FAILED: $name (status $reason)\n"; | 
|---|
| 45 | } | 
|---|
| 46 | $out .= "==========================================\n"; | 
|---|
| 47 |  | 
|---|
| 48 | print $out; | 
|---|
| 49 | } | 
|---|
| 50 |  | 
|---|
| 51 | sub skip_testsuite($) | 
|---|
| 52 | { | 
|---|
| 53 | my ($name) = @_; | 
|---|
| 54 |  | 
|---|
| 55 | print "SKIPPED: $name\n"; | 
|---|
| 56 | } | 
|---|
| 57 |  | 
|---|
| 58 | sub summary($) | 
|---|
| 59 | { | 
|---|
| 60 | my ($duration) = @_; | 
|---|
| 61 |  | 
|---|
| 62 | print "DURATION: " . $duration . " seconds\n"; | 
|---|
| 63 | } | 
|---|
| 64 |  | 
|---|
| 65 | 1; | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.