From 12baa6e69678ad8303e22b43b4af01dc9d10d271 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 12 Feb 2015 14:24:51 +0000 Subject: [PATCH] Generate NUnit interpretation of whether "mono --regressions" passed --- mono/mini/Makefile.am.in | 5 +-- mono/mini/emitnunit.pl | 76 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100755 mono/mini/emitnunit.pl diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in index 47c79f80ae2..38c6c3ec530 100755 --- a/mono/mini/Makefile.am.in +++ b/mono/mini/Makefile.am.in @@ -660,7 +660,8 @@ rcheck: mono $(regtests) if NACL_CODEGEN for i in $(regtests); do echo "running test $$i"; $(RUNTIME) $$i --exclude 'NaClDisable' || exit 1; done else - $(RUNTIME) --regression $(regtests) + -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | ./emitnunit.pl + exit $$(cat regressionexitcode.out) endif check-seq-points: mono $(regtests) @@ -727,7 +728,7 @@ docu: mini.sgm check-local: rcheck check-seq-points clean-local: - rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe + rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out pkgconfigdir = $(libdir)/pkgconfig diff --git a/mono/mini/emitnunit.pl b/mono/mini/emitnunit.pl new file mode 100755 index 00000000000..b511e7d8c9d --- /dev/null +++ b/mono/mini/emitnunit.pl @@ -0,0 +1,76 @@ +#!/usr/bin/perl +use strict; +use warnings; +use Cwd; +use POSIX qw(strftime uname locale_h); +use Net::Domain qw(hostname hostfqdn); +use locale; + +my $line; +foreach $line () { + chomp ($line); + print "$line\n"; + if ($line =~ /^Overall results:/) { + # do magic nunit emission here + # failures look like: + # Overall results: tests: 19992, failed: 48, opt combinations: 24 (pass: 99.76%) + # passes look like: + # Overall results: tests: 20928, 100% pass, opt combinations: 24 + my @words = split (/ /, $line); + my $failed; + my $successbool; + my $total = $words[3]; + my $mylocale = setlocale (LC_CTYPE); + $mylocale = substr($mylocale, 0, index($mylocale, '.')); + $mylocale =~ s/_/-/; + if ($line =~ /failed:/) { + $failed = $words[5]; + } else { + $failed = "0,"; + } + chop ($failed); + chop ($total); + if ($failed > 0) { + $successbool = "False"; + } else { + $successbool = "True"; + } + open (my $nunitxml, '>', 'TestResults_regression.xml') or die "Could not write to 'TestResults_regression.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 " ) { + chomp ($line); + print "$line\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; + } +} -- 2.25.1