X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fprofiler%2Fptestrunner.pl;h=2113c25135f27c8e49cc8fc81588968c34d601f4;hb=bb60f239b79517b207e3e572e6db4c32e48b4fb7;hp=e3c62b5d4adda093f111c08ccd243dac3e4fd109;hpb=b9afa882093e6c112faa386ab205f90a056866db;p=mono.git diff --git a/mono/profiler/ptestrunner.pl b/mono/profiler/ptestrunner.pl index e3c62b5d4ad..2113c25135f 100755 --- a/mono/profiler/ptestrunner.pl +++ b/mono/profiler/ptestrunner.pl @@ -6,7 +6,8 @@ use strict; my $builddir = shift || die "Usage: ptestrunner.pl mono_build_dir\n"; my @errors = (); -my $total_errors = 0; +my $total_errors = 0; # this is reset before each test +my $global_errors = 0; my $report; my $profbuilddir = $builddir . "/mono/profiler"; @@ -104,7 +105,9 @@ check_alloc_traces ($report, ); report_errors (); -exit ($total_errors? 1: 0); +emit_nunit_report(); + +exit ($global_errors ? 1 : 0); # utility functions sub append_path { @@ -154,11 +157,67 @@ sub report_errors foreach my $e (@errors) { print "Error: $e\n"; $total_errors++; + $global_errors++; } print "Total errors: $total_errors\n" if $total_errors; #print $report; } +sub emit_nunit_report +{ + use Cwd; + use POSIX qw(strftime uname locale_h); + use Net::Domain qw(hostname hostfqdn); + use locale; + + my $failed = $global_errors ? 1 : 0; + my $successbool; + my $total = 1; + my $mylocale = setlocale (LC_CTYPE); + $mylocale = substr($mylocale, 0, index($mylocale, '.')); + $mylocale =~ s/_/-/; + + if ($failed > 0) { + $successbool = "False"; + } else { + $successbool = "True"; + } + open (my $nunitxml, '>', 'TestResult-profiler.xml') or die "Could not write to 'TestResult-profiler.xml' $!"; + print $nunitxml "\n"; + print $nunitxml "\n"; + print $nunitxml "\n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " 0) { + print $nunitxml ">\n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + } else { + print $nunitxml " />\n"; + } + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml " \n"; + print $nunitxml "\n"; + close $nunitxml; +} + sub get_delim_data { my $report = shift;