X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fprofiler%2Fptestrunner.pl;h=2113c25135f27c8e49cc8fc81588968c34d601f4;hb=bb60f239b79517b207e3e572e6db4c32e48b4fb7;hp=96f2e0137c7ba6e62b127586eee6151643575d84;hpb=6352c16dd5306ccb8bedc742bf99505688695dc6;p=mono.git diff --git a/mono/profiler/ptestrunner.pl b/mono/profiler/ptestrunner.pl index 96f2e0137c7..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"; @@ -58,20 +59,20 @@ report_errors (); $report = run_test_sgen ("test-heapshot.exe", "report,heapshot"); if ($report ne "missing binary") { check_report_basics ($report); - check_report_heapshot ($report, 1, {"T" => 5000}); - check_report_heapshot ($report, 2, {"T" => 5023}); + check_report_heapshot ($report, 0, {"T" => 5000}); + check_report_heapshot ($report, 1, {"T" => 5023}); report_errors (); } # test heapshot traces $report = run_test_sgen ("test-heapshot.exe", "heapshot,output=-traces.mlpd", "--traces traces.mlpd"); if ($report ne "missing binary") { check_report_basics ($report); - check_report_heapshot ($report, 1, {"T" => 5000}); - check_report_heapshot ($report, 2, {"T" => 5023}); - check_heapshot_traces ($report, 1, + check_report_heapshot ($report, 0, {"T" => 5000}); + check_report_heapshot ($report, 1, {"T" => 5023}); + check_heapshot_traces ($report, 0, T => [4999, "T"] ); - check_heapshot_traces ($report, 2, + check_heapshot_traces ($report, 1, T => [5022, "T"] ); report_errors (); @@ -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;