diff --git a/Makefile.in b/Makefile.in index f0873e25ff..a80823be98 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,7 +85,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/config.h.in mkinstalldirs \ $(srcdir)/mono-core.spec.in $(srcdir)/mono-uninstalled.pc.in \ AUTHORS COPYING.LIB ChangeLog NEWS compile config.guess \ - config.rpath config.sub install-sh missing ltmain.sh + config.rpath config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ diff --git a/mcs/class/System/System.IO/KeventWatcher.cs b/mcs/class/System/System.IO/KeventWatcher.cs index 7ead35f82e..8cc7e394c9 100644 --- a/mcs/class/System/System.IO/KeventWatcher.cs +++ b/mcs/class/System/System.IO/KeventWatcher.cs @@ -274,7 +274,6 @@ namespace System.IO { started = false; inDispatch = false; fsw.EnableRaisingEvents = false; - throw exc; } if (exc != null) fsw.DispatchErrorEvents (new ErrorEventArgs (exc)); @@ -382,6 +381,10 @@ namespace System.IO { } if ((kevt.fflags & FilterFlags.VNodeDelete) == FilterFlags.VNodeDelete || (kevt.fflags & FilterFlags.VNodeRevoke) == FilterFlags.VNodeRevoke) { + if (pathData.Path == fullPathNoLastSlash) + //The root path is deleted; exit silently + return; + removeQueue.Add (pathData); continue; } diff --git a/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id index 8a2a6698b3..879a217a8d 100644 --- a/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id @@ -1 +1 @@ -b4bd1fc94e2f39c65a9cc3f1224e45a1e8fb3e37 \ No newline at end of file +2cb9b879f6aba233292087d703c0ca56add6db17 \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id index ad508ec283..6bc82d3ae5 100644 --- a/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id @@ -1 +1 @@ -7bfd852fe1e8dfccebc97bc42d66f587b73fc941 \ No newline at end of file +9504cf171139c47f31f12dfde2eb65a18e4e699d \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.dll.REMOVED.git-id index a3b1d285df..f2fc434bbc 100644 --- a/mcs/class/lib/monolite/System.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.dll.REMOVED.git-id @@ -1 +1 @@ -e1a7446b92066e58218a67fdb7c41ceeaac06ba1 \ No newline at end of file +d19fae1ffb537f031ff1756bb9275552cbf66ff3 \ No newline at end of file diff --git a/mcs/class/lib/monolite/basic.exe.REMOVED.git-id b/mcs/class/lib/monolite/basic.exe.REMOVED.git-id index 036f052e71..7b7dd9a0f4 100644 --- a/mcs/class/lib/monolite/basic.exe.REMOVED.git-id +++ b/mcs/class/lib/monolite/basic.exe.REMOVED.git-id @@ -1 +1 @@ -d1e78ca363e0bc43ca096886c4e79ff83563cc31 \ No newline at end of file +67edc999c07a3cf2122b9feb803a81ed15a182fc \ No newline at end of file diff --git a/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id index 28a285b245..0b792df9ba 100644 --- a/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id @@ -1 +1 @@ -af5a7726c9961fd49e771b276c914cee6dd7ca85 \ No newline at end of file +45697c8527dbebf164126f53cd5691ea40a03eab \ No newline at end of file diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am index 3325cbc70f..7b95d0856f 100644 --- a/mono/mini/Makefile.am +++ b/mono/mini/Makefile.am @@ -661,15 +661,15 @@ 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); echo $$? > regressionexitcode.out) | ./emitnunit.pl + -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | $(srcdir)/emitnunit.pl exit $$(cat regressionexitcode.out) endif check-seq-points: mono $(regtests) rm -f TestResults_op_il_seq_point.xml - for i in $(regtests); do ./test_op_il_seq_point.sh $$i || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done - for i in $(regtests); do ./test_op_il_seq_point.sh $$i --aot || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done - ./test_op_il_seq_point_headerfooter.sh + for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done + for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done + $(srcdir)/test_op_il_seq_point_headerfooter.sh gctest: mono gc-test.exe MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(RUNTIME) --regression gc-test.exe @@ -740,6 +740,7 @@ BUILT_SOURCES = version.h $(arch_built) CLEANFILES= $(BUILT_SOURCES) *.exe *.dll EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \ genmdesc.pl \ + emitnunit.pl \ $(test_sources) \ $(x86_sources) cpu-x86.md \ $(amd64_sources) cpu-amd64.md \ @@ -758,7 +759,7 @@ EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \ Makefile.am.in version.h: Makefile - echo "#define FULL_VERSION \"Stable 4.0.3.13/429313d\"" > version.h + echo "#define FULL_VERSION \"Stable 4.0.3.19/e4f44c1\"" > version.h # Utility target for patching libtool to speed up linking patch-libtool: diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in index 3325cbc70f..7b95d0856f 100755 --- a/mono/mini/Makefile.am.in +++ b/mono/mini/Makefile.am.in @@ -661,15 +661,15 @@ 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); echo $$? > regressionexitcode.out) | ./emitnunit.pl + -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | $(srcdir)/emitnunit.pl exit $$(cat regressionexitcode.out) endif check-seq-points: mono $(regtests) rm -f TestResults_op_il_seq_point.xml - for i in $(regtests); do ./test_op_il_seq_point.sh $$i || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done - for i in $(regtests); do ./test_op_il_seq_point.sh $$i --aot || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done - ./test_op_il_seq_point_headerfooter.sh + for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done + for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done + $(srcdir)/test_op_il_seq_point_headerfooter.sh gctest: mono gc-test.exe MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(RUNTIME) --regression gc-test.exe @@ -740,6 +740,7 @@ BUILT_SOURCES = version.h $(arch_built) CLEANFILES= $(BUILT_SOURCES) *.exe *.dll EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \ genmdesc.pl \ + emitnunit.pl \ $(test_sources) \ $(x86_sources) cpu-x86.md \ $(amd64_sources) cpu-amd64.md \ @@ -758,7 +759,7 @@ EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \ Makefile.am.in version.h: Makefile - echo "#define FULL_VERSION \"Stable 4.0.3.13/429313d\"" > version.h + echo "#define FULL_VERSION \"Stable 4.0.3.19/e4f44c1\"" > version.h # Utility target for patching libtool to speed up linking patch-libtool: diff --git a/mono/mini/Makefile.in.REMOVED.git-id b/mono/mini/Makefile.in.REMOVED.git-id index 295296a21b..eb2c71f40f 100644 --- a/mono/mini/Makefile.in.REMOVED.git-id +++ b/mono/mini/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -69eae9968f7637f83f0e9f91850e8f2a9d4c4ad8 \ No newline at end of file +58f40d74960bb5ae7a567efca193f178d82bf3ac \ No newline at end of file diff --git a/mono/mini/cpu-arm.md b/mono/mini/cpu-arm.md index 9501ea5786..8b6ea262dd 100644 --- a/mono/mini/cpu-arm.md +++ b/mono/mini/cpu-arm.md @@ -357,7 +357,7 @@ long_conv_to_ovf_i4_2: dest:i src1:i src2:i len:36 vcall2: len:20 clob:c vcall2_reg: src1:i len:8 clob:c vcall2_membase: src1:b len:12 clob:c -dyn_call: src1:i src2:i len:120 clob:c +dyn_call: src1:i src2:i len:136 clob:c # This is different from the original JIT opcodes float_beq: len:32 diff --git a/mono/mini/emitnunit.pl b/mono/mini/emitnunit.pl new file mode 100755 index 0000000000..b511e7d8c9 --- /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; + } +} diff --git a/mono/mini/mini-arm.h b/mono/mini/mini-arm.h index 13a812af21..f4406ed92b 100644 --- a/mono/mini/mini-arm.h +++ b/mono/mini/mini-arm.h @@ -179,7 +179,7 @@ typedef struct { #define PARAM_REGS 4 -#define DYN_CALL_STACK_ARGS 6 +#define DYN_CALL_STACK_ARGS 10 typedef struct { mgreg_t regs [PARAM_REGS + DYN_CALL_STACK_ARGS]; @@ -268,7 +268,7 @@ typedef struct MonoCompileArch { #define MONO_ARCH_GSHARED_SUPPORTED 1 #define MONO_ARCH_DYN_CALL_SUPPORTED 1 -#define MONO_ARCH_DYN_CALL_PARAM_AREA 24 +#define MONO_ARCH_DYN_CALL_PARAM_AREA (DYN_CALL_STACK_ARGS * sizeof (mgreg_t)) #ifndef MONO_CROSS_COMPILE #define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1 diff --git a/mono/mini/version.h b/mono/mini/version.h index a3186f3869..3565093caf 100644 --- a/mono/mini/version.h +++ b/mono/mini/version.h @@ -1 +1 @@ -#define FULL_VERSION "Stable 4.0.3.13/429313d" +#define FULL_VERSION "Stable 4.0.3.19/e4f44c1" diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 8b0ab538b6..13ecbfb54f 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -667,7 +667,7 @@ TESTSI_IL=$(TEST_IL_SRC:.il=.exe) TESTBS=$(BENCHSRC:.cs=.exe) STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe) -EXTRA_DIST=test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \ +EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \ $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC) %.exe: %.il diff --git a/mono/tests/Makefile.in b/mono/tests/Makefile.in index 2be68b3663..20bef68c66 100644 --- a/mono/tests/Makefile.in +++ b/mono/tests/Makefile.in @@ -1041,11 +1041,12 @@ TESTBS = $(BENCHSRC:.cs=.exe) STRESS_TESTS = $(STRESS_TESTS_SRC:.cs=.exe) # Generated tests for runtime invoke -EXTRA_DIST = test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \ - $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl \ - $(PREREQ_IL_SRC) $(PREREQ_CS_SRC) load-missing.il t-missing.cs \ - load-exceptions.cs custom-attr-errors.cs \ - custom-attr-errors-lib.cs reflection-load-with-context-lib.cs \ +EXTRA_DIST = test-driver test-runner.cs $(TEST_CS_SRC_DIST) \ + $(TEST_IL_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) \ + stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC) \ + load-missing.il t-missing.cs load-exceptions.cs \ + custom-attr-errors.cs custom-attr-errors-lib.cs \ + reflection-load-with-context-lib.cs \ reflection-load-with-context-second-lib.cs \ reflection-load-with-context.cs debug-casts.cs sgen-bridge.cs \ sgen-descriptors.cs sgen-gshared-vtype.cs \ diff --git a/mono/tests/test-runner.cs b/mono/tests/test-runner.cs new file mode 100644 index 0000000000..6dc6745d53 --- /dev/null +++ b/mono/tests/test-runner.cs @@ -0,0 +1,469 @@ +// +// test-runner.cs +// +// Author: +// Zoltan Varga (vargaz@gmail.com) +// +// Copyright (C) 2008 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +using System; +using System.IO; +using System.Threading; +using System.Diagnostics; +using System.Collections.Generic; +using System.Globalization; +using System.Xml; + +// +// This is a simple test runner with support for parallel execution +// + +public class TestRunner +{ + class ProcessData { + public string test; + public StreamWriter stdout, stderr; + public string stdoutFile, stderrFile; + + public void CloseStreams () { + if (stdout != null) { + stdout.Close (); + stdout = null; + } + if (stderr != null) { + stderr.Close (); + stderr = null; + } + } + } + + class TestInfo { + public string test, opt_set; + } + + public static int Main (String[] args) { + // Defaults + int concurrency = 1; + int timeout = 2 * 60; // in seconds + + DateTime test_start_time = DateTime.UtcNow; + + // FIXME: Add support for runtime arguments + env variables + + string disabled_tests = null; + string runtime = "mono"; + var opt_sets = new List (); + + // Process options + int i = 0; + while (i < args.Length) { + if (args [i].StartsWith ("-")) { + if (args [i] == "-j") { + if (i + i >= args.Length) { + Console.WriteLine ("Missing argument to -j command line option."); + return 1; + } + if (args [i + 1] == "a") + concurrency = Environment.ProcessorCount; + else + concurrency = Int32.Parse (args [i + 1]); + i += 2; + } else if (args [i] == "--timeout") { + if (i + i >= args.Length) { + Console.WriteLine ("Missing argument to --timeout command line option."); + return 1; + } + timeout = Int32.Parse (args [i + 1]); + i += 2; + } else if (args [i] == "--disabled") { + if (i + i >= args.Length) { + Console.WriteLine ("Missing argument to --disabled command line option."); + return 1; + } + disabled_tests = args [i + 1]; + i += 2; + } else if (args [i] == "--runtime") { + if (i + i >= args.Length) { + Console.WriteLine ("Missing argument to --runtime command line option."); + return 1; + } + runtime = args [i + 1]; + i += 2; + } else if (args [i] == "--opt-sets") { + if (i + i >= args.Length) { + Console.WriteLine ("Missing argument to --opt-sets command line option."); + return 1; + } + foreach (var s in args [i + 1].Split ()) + opt_sets.Add (s); + i += 2; + } else { + Console.WriteLine ("Unknown command line option: '" + args [i] + "'."); + return 1; + } + } else { + break; + } + } + + var disabled = new Dictionary (); + + if (disabled_tests != null) { + foreach (string test in disabled_tests.Split ()) + disabled [test] = test; + } + + // The remaining arguments are the tests + var tests = new List (); + for (int j = i; j < args.Length; ++j) + if (!disabled.ContainsKey (args [j])) + tests.Add (args [j]); + + int npassed = 0; + int nfailed = 0; + + var processes = new List (); + var passed = new List (); + var failed = new List (); + var process_data = new Dictionary (); + + object monitor = new object (); + + var terminated = new List (); + + if (concurrency != 1) + Console.WriteLine ("Running tests: "); + + var test_info = new List (); + if (opt_sets.Count == 0) { + foreach (string s in tests) + test_info.Add (new TestInfo { test = s }); + } else { + foreach (string opt in opt_sets) { + foreach (string s in tests) + test_info.Add (new TestInfo { test = s, opt_set = opt }); + } + } + + foreach (TestInfo ti in test_info) { + lock (monitor) { + while (processes.Count == concurrency) { + /* Wait for one process to terminate */ + Monitor.Wait (monitor); + } + + /* Cleaup terminated processes */ + foreach (Process dead in terminated) { + if (process_data [dead].stdout != null) + process_data [dead].stdout.Close (); + if (process_data [dead].stderr != null) + process_data [dead].stderr.Close (); + // This is needed to avoid CreateProcess failed errors :( + dead.Close (); + } + terminated.Clear (); + } + + string test = ti.test; + string opt_set = ti.opt_set; + + if (concurrency == 1) + Console.Write ("Testing " + test + "... "); + + /* Spawn a new process */ + string process_args; + if (opt_set == null) + process_args = test; + else + process_args = "-O=" + opt_set + " " + test; + ProcessStartInfo info = new ProcessStartInfo (runtime, process_args); + info.UseShellExecute = false; + info.RedirectStandardOutput = true; + info.RedirectStandardError = true; + Process p = new Process (); + p.StartInfo = info; + p.EnableRaisingEvents = true; + + ProcessData data = new ProcessData (); + data.test = test; + + p.Exited += delegate (object sender, EventArgs e) { + // Anon methods share some of their state, so we can't use + // variables which change during the loop (test, p) + Process dead = (Process)sender; + + lock (monitor) { + if (dead.ExitCode == 0) { + if (concurrency == 1) + Console.WriteLine ("passed."); + else + Console.Write ("."); + passed.Add(process_data [dead]); + npassed ++; + } else { + if (concurrency == 1) + Console.WriteLine ("failed."); + else + Console.Write ("F"); + failed.Add (process_data [dead]); + nfailed ++; + } + processes.Remove (dead); + terminated.Add (dead); + Monitor.Pulse (monitor); + } + }; + + string log_prefix = ""; + if (opt_set != null) + log_prefix = "." + opt_set.Replace ("-", "no").Replace (",", "_"); + + data.stdoutFile = test + log_prefix + ".stdout"; + data.stdout = new StreamWriter (new FileStream (data.stdoutFile, FileMode.Create)); + + data.stderrFile = test + log_prefix + ".stderr"; + data.stderr = new StreamWriter (new FileStream (data.stderrFile, FileMode.Create)); + + p.OutputDataReceived += delegate (object sender, DataReceivedEventArgs e) { + Process p2 = (Process)sender; + + StreamWriter fs; + + lock (monitor) { + fs = process_data [p2].stdout; + + if (String.IsNullOrEmpty (e.Data)) + process_data [p2].stdout = null; + } + + if (String.IsNullOrEmpty (e.Data)) { + fs.Close (); + } else { + fs.WriteLine (e.Data); + fs.Flush (); + } + }; + + p.ErrorDataReceived += delegate (object sender, DataReceivedEventArgs e) { + Process p2 = (Process)sender; + + StreamWriter fs; + + lock (monitor) { + fs = process_data [p2].stderr; + + if (String.IsNullOrEmpty (e.Data)) + process_data [p2].stderr = null; + + } + + if (String.IsNullOrEmpty (e.Data)) { + fs.Close (); + + lock (monitor) { + process_data [p2].stderr = null; + } + } else { + fs.WriteLine (e.Data); + fs.Flush (); + } + }; + + lock (monitor) { + processes.Add (p); + process_data [p] = data; + } + p.Start (); + + p.BeginOutputReadLine (); + p.BeginErrorReadLine (); + } + + bool timed_out = false; + + /* Wait for all processes to terminate */ + while (true) { + lock (monitor) { + int nprocesses = processes.Count; + + if (nprocesses == 0) + break; + + bool res = Monitor.Wait (monitor, 1000 * timeout); + if (!res) { + timed_out = true; + break; + } + } + } + + TimeSpan test_time = DateTime.UtcNow - test_start_time; + XmlWriterSettings xmlWriterSettings = new XmlWriterSettings (); + xmlWriterSettings.NewLineOnAttributes = true; + xmlWriterSettings.Indent = true; + using (XmlWriter writer = XmlWriter.Create ("TestResults_runtime.xml", xmlWriterSettings)) { + // + writer.WriteStartDocument (); + // + writer.WriteComment ("This file represents the results of running a test suite"); + // + writer.WriteStartElement ("test-results"); + writer.WriteAttributeString ("name", "runtime-tests.dummy"); + writer.WriteAttributeString ("total", (npassed + nfailed).ToString()); + writer.WriteAttributeString ("failures", nfailed.ToString()); + writer.WriteAttributeString ("not-run", "0"); + writer.WriteAttributeString ("date", DateTime.Now.ToString ("yyyy-MM-dd")); + writer.WriteAttributeString ("time", DateTime.Now.ToString ("HH:mm:ss")); + // + writer.WriteStartElement ("environment"); + writer.WriteAttributeString ("nunit-version", "2.4.8.0" ); + writer.WriteAttributeString ("clr-version", Environment.Version.ToString() ); + writer.WriteAttributeString ("os-version", Environment.OSVersion.ToString() ); + writer.WriteAttributeString ("platform", Environment.OSVersion.Platform.ToString() ); + writer.WriteAttributeString ("cwd", Environment.CurrentDirectory ); + writer.WriteAttributeString ("machine-name", Environment.MachineName ); + writer.WriteAttributeString ("user", Environment.UserName ); + writer.WriteAttributeString ("user-domain", Environment.UserDomainName ); + writer.WriteEndElement (); + // + writer.WriteStartElement ("culture-info"); + writer.WriteAttributeString ("current-culture", CultureInfo.CurrentCulture.Name ); + writer.WriteAttributeString ("current-uiculture", CultureInfo.CurrentUICulture.Name ); + writer.WriteEndElement (); + // + writer.WriteStartElement ("test-suite"); + writer.WriteAttributeString ("name","runtime-tests.dummy"); + writer.WriteAttributeString ("success", (nfailed == 0).ToString()); + writer.WriteAttributeString ("time", test_time.Seconds.ToString()); + writer.WriteAttributeString ("asserts", nfailed.ToString()); + // + writer.WriteStartElement ("results"); + // + writer.WriteStartElement ("test-suite"); + writer.WriteAttributeString ("name","MonoTests"); + writer.WriteAttributeString ("success", (nfailed == 0).ToString()); + writer.WriteAttributeString ("time", test_time.Seconds.ToString()); + writer.WriteAttributeString ("asserts", nfailed.ToString()); + // + writer.WriteStartElement ("results"); + // + writer.WriteStartElement ("test-suite"); + writer.WriteAttributeString ("name","runtime"); + writer.WriteAttributeString ("success", (nfailed == 0).ToString()); + writer.WriteAttributeString ("time", test_time.Seconds.ToString()); + writer.WriteAttributeString ("asserts", nfailed.ToString()); + // + writer.WriteStartElement ("results"); + // Dump all passing tests first + foreach (ProcessData pd in passed) { + // + writer.WriteStartElement ("test-case"); + writer.WriteAttributeString ("name", "MonoTests.runtime." + pd.test); + writer.WriteAttributeString ("executed", "True"); + writer.WriteAttributeString ("success", "True"); + writer.WriteAttributeString ("time", "0"); + writer.WriteAttributeString ("asserts", "0"); + writer.WriteEndElement (); + } + // Now dump all failing tests + foreach (ProcessData pd in failed) { + // + writer.WriteStartElement ("test-case"); + writer.WriteAttributeString ("name", "MonoTests.runtime." + pd.test); + writer.WriteAttributeString ("executed", "True"); + writer.WriteAttributeString ("success", "False"); + writer.WriteAttributeString ("time", "0"); + writer.WriteAttributeString ("asserts", "1"); + writer.WriteStartElement ("failure"); + writer.WriteStartElement ("message"); + writer.WriteCData (DumpPseudoTrace (pd.stdoutFile)); + writer.WriteEndElement (); + writer.WriteStartElement ("stack-trace"); + writer.WriteCData (DumpPseudoTrace (pd.stderrFile)); + writer.WriteEndElement (); + writer.WriteEndElement (); + writer.WriteEndElement (); + } + // + writer.WriteEndElement (); + // + writer.WriteEndElement (); + // + writer.WriteEndElement (); + // + writer.WriteEndElement (); + // + writer.WriteEndElement (); + // + writer.WriteEndElement (); + // + writer.WriteEndElement (); + writer.WriteEndDocument (); + } + + Console.WriteLine (); + + if (timed_out) { + Console.WriteLine ("\nrunning tests timed out:\n"); + Console.WriteLine (npassed + nfailed); + lock (monitor) { + foreach (Process p in processes) { + ProcessData pd = process_data [p]; + pd.CloseStreams (); + Console.WriteLine (pd.test); + p.Kill (); + DumpFile (pd.stdoutFile); + DumpFile (pd.stderrFile); + } + } + return 1; + } + + Console.WriteLine ("" + npassed + " test(s) passed. " + nfailed + " test(s) did not pass."); + if (nfailed > 0) { + Console.WriteLine ("\nFailed tests:\n"); + foreach (ProcessData pd in failed) { + Console.WriteLine (pd.test); + DumpFile (pd.stdoutFile); + DumpFile (pd.stderrFile); + } + return 1; + } else { + return 0; + } + } + + static void DumpFile (string filename) { + if (File.Exists (filename)) { + Console.WriteLine ("=============== {0} ===============", filename); + Console.WriteLine (File.ReadAllText (filename)); + Console.WriteLine ("=============== EOF ==============="); + } + } + + static string DumpPseudoTrace (string filename) { + if (File.Exists (filename)) + return File.ReadAllText (filename); + else + return string.Empty; + } +} diff --git a/mono/utils/mach-support-amd64.c b/mono/utils/mach-support-amd64.c index 19040885da..47bced4802 100644 --- a/mono/utils/mach-support-amd64.c +++ b/mono/utils/mach-support-amd64.c @@ -23,6 +23,13 @@ /* All OSX versions up to 10.8 */ #define TLS_VECTOR_OFFSET_CATS 0x60 #define TLS_VECTOR_OFFSET_10_9 0xe0 +#define TLS_VECTOR_OFFSET_10_11 0x100 + +/* This is 2 slots less than the known low */ +#define TLS_PROBE_LOW_WATERMARK 0x50 +/* This is 28 slots above the know high, which is more than the known high-low*/ +#define TLS_PROBE_HIGH_WATERMARK 0x200 + static int tls_vector_offset; @@ -113,6 +120,7 @@ mono_mach_arch_get_tls_value_from_thread (pthread_t thread, guint32 key) void mono_mach_init (pthread_key_t key) { + int i; void *old_value = pthread_getspecific (key); void *canary = (void*)0xDEADBEEFu; @@ -130,6 +138,19 @@ mono_mach_init (pthread_key_t key) if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) goto ok; + tls_vector_offset = TLS_VECTOR_OFFSET_10_11; + if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) + goto ok; + + /*Fallback to scanning a large range of offsets*/ + for (i = TLS_PROBE_LOW_WATERMARK; i <= TLS_PROBE_HIGH_WATERMARK; i += 4) { + tls_vector_offset = i; + if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) { + g_warning ("Found new TLS offset at %d", i); + goto ok; + } + } + g_error ("could not discover the mach TLS offset"); ok: pthread_setspecific (key, old_value); diff --git a/mono/utils/mach-support-x86.c b/mono/utils/mach-support-x86.c index 76d2b06bee..813b193ec9 100644 --- a/mono/utils/mach-support-x86.c +++ b/mono/utils/mach-support-x86.c @@ -21,6 +21,14 @@ /* All OSX versions up to 10.8 */ #define TLS_VECTOR_OFFSET_CATS 0x48 #define TLS_VECTOR_OFFSET_10_9 0xb0 +#define TLS_VECTOR_OFFSET_10_11 0x100 + + +/* This is 2 slots less than the known low */ +#define TLS_PROBE_LOW_WATERMARK 0x40 +/* This is 28 slots above the know high, which is more than the known high-low*/ +#define TLS_PROBE_HIGH_WATERMARK 0x120 + static int tls_vector_offset; @@ -111,6 +119,7 @@ mono_mach_arch_get_tls_value_from_thread (pthread_t thread, guint32 key) void mono_mach_init (pthread_key_t key) { + int i; void *old_value = pthread_getspecific (key); void *canary = (void*)0xDEADBEEFu; @@ -128,6 +137,19 @@ mono_mach_init (pthread_key_t key) if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) goto ok; + tls_vector_offset = TLS_VECTOR_OFFSET_10_11; + if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) + goto ok; + + /*Fallback to scanning a large range of offsets*/ + for (i = TLS_PROBE_LOW_WATERMARK; i <= TLS_PROBE_HIGH_WATERMARK; i += 4) { + tls_vector_offset = i; + if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) { + g_warning ("Found new TLS offset at %d", i); + goto ok; + } + } + g_error ("could not discover the mach TLS offset"); ok: pthread_setspecific (key, old_value); diff --git a/po/mcs/de.gmo b/po/mcs/de.gmo index 9231bf8066..0be99948d2 100644 Binary files a/po/mcs/de.gmo and b/po/mcs/de.gmo differ diff --git a/po/mcs/de.po.REMOVED.git-id b/po/mcs/de.po.REMOVED.git-id index 63eb26b2ea..7056fb932d 100644 --- a/po/mcs/de.po.REMOVED.git-id +++ b/po/mcs/de.po.REMOVED.git-id @@ -1 +1 @@ -4d58095efc006b4475f0937656021d3e741a9afb \ No newline at end of file +6ccf8d1f9a19be2afc58ffc9436dc42a07cd44b8 \ No newline at end of file diff --git a/po/mcs/es.gmo b/po/mcs/es.gmo index 046e494178..b69a180c34 100644 Binary files a/po/mcs/es.gmo and b/po/mcs/es.gmo differ diff --git a/po/mcs/es.po.REMOVED.git-id b/po/mcs/es.po.REMOVED.git-id index 648fc550fd..1b2ec9e910 100644 --- a/po/mcs/es.po.REMOVED.git-id +++ b/po/mcs/es.po.REMOVED.git-id @@ -1 +1 @@ -5a230520eaa0256c490e4344ed75646ed7f5b40e \ No newline at end of file +0cdf74e477610da5b3c21f77151b80d9858a3dfb \ No newline at end of file diff --git a/po/mcs/ja.gmo b/po/mcs/ja.gmo index 8132c95967..d19e9fe16c 100644 Binary files a/po/mcs/ja.gmo and b/po/mcs/ja.gmo differ diff --git a/po/mcs/ja.po.REMOVED.git-id b/po/mcs/ja.po.REMOVED.git-id index 2c94f50fd0..9da367da86 100644 --- a/po/mcs/ja.po.REMOVED.git-id +++ b/po/mcs/ja.po.REMOVED.git-id @@ -1 +1 @@ -bd76d39f7b22ce7c74a5d0d77fea4d17a72d4829 \ No newline at end of file +3a17dd70506ad227b3c0b2c2df176cd6a6c1daca \ No newline at end of file diff --git a/po/mcs/mcs.pot b/po/mcs/mcs.pot index f7e10b4526..b0c20625ac 100644 --- a/po/mcs/mcs.pot +++ b/po/mcs/mcs.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mono 4.0.3\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" -"POT-Creation-Date: 2015-07-20 03:19-0400\n" +"POT-Creation-Date: 2015-07-24 03:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/mcs/pt_BR.gmo b/po/mcs/pt_BR.gmo index f0860fde84..824a2ad440 100644 Binary files a/po/mcs/pt_BR.gmo and b/po/mcs/pt_BR.gmo differ diff --git a/po/mcs/pt_BR.po.REMOVED.git-id b/po/mcs/pt_BR.po.REMOVED.git-id index 07bcd220e8..ff4a361732 100644 --- a/po/mcs/pt_BR.po.REMOVED.git-id +++ b/po/mcs/pt_BR.po.REMOVED.git-id @@ -1 +1 @@ -ad63cc2659816a6cd943ec3d41eeaa9d2e987c8d \ No newline at end of file +05a005af7e1898d2f171ffc1f340b302e24f9063 \ No newline at end of file