Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -13,6 +13,8 @@ using System;
using System.Collections;
using System.Runtime.Serialization;
using System.Reflection;
using NUnit.Framework;
namespace MonoTests.System
@ -400,6 +402,79 @@ namespace MonoTests.System
Assert.IsNull (a.InnerException.Source);
}
#if !MOBILE
// Ensure that we can convert a stacktrace to a
// telemetry message
//
[Test]
[Category("NotOnWindows")]
public void StacktraceToState ()
{
try {
throw new Exception ("#0");
} catch (Exception exc) {
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("ExceptionToState", BindingFlags.NonPublic | BindingFlags.Static);
object [] convert_params = new object[] {exc};
var output = (Tuple<String, ulong, ulong>) convert.Invoke(null, convert_params);
var dump = output.Item1;
var portable_hash = output.Item2;
var unportable_hash = output.Item3;
Assert.IsTrue (portable_hash != 0, "#1");
Assert.IsTrue (unportable_hash != 0, "#2");
Assert.IsTrue (dump.Length > 0, "#3");
// Console.WriteLine (dump);
// dump should look something like:
// {
// "protocol_version" : "0.0.1",
// "configuration" : {
// "version" : "5.19.0 (managed_telemetry_pipeline/d342c73e320 Wed Aug 15 14:40:40 EDT 2018)",
// "tlc" : "normal",
// "sigsgev" : "altstack",
// "notifications" : "kqueue",
// "architecture" : "amd64",
// "disabled_features" : "none",
// "smallconfig" : "disabled",
// "bigarrays" : "disabled",
// "softdebug" : "enabled",
// "interpreter" : "enabled",
// "llvm_support" : "disabled",
// "suspend" : "hybrid"
// },
// "memory" : {
// "Resident Size" : "40693760",
// "Virtual Size" : "4521312256",
// "minor_gc_time" : "216992",
// "major_gc_time" : "0",
// "minor_gc_count" : "6",
// "major_gc_count" : "0",
// "major_gc_time_concurrent" : "0"
// },
// "threads" : [
// {
// "is_managed" : false,
// "managed_thread_ptr" : "0x0",
// "thread_info_addr" : "0x0",
// "native_thread_id" : "0x0",
// "managed_frames" : [
// {
// "is_managed" : "true",
// "guid" : "43A03618-E657-44B0-B9FA-F63314A3C1B2",
// "token" : "0x60008da",
// "native_offset" : "0xb2",
// "il_offset" : "0x00000"
// }
// ]
// }
// ]
// }
}
}
#endif
[Test]
public void StackTrace ()
{