Merge branch 'cycle8' into xcode8

This commit is contained in:
Sebastien Pouliot 2016-07-13 16:43:00 -04:00
Родитель 76e9b93807 90259562d1
Коммит cf27c2e7a8
58 изменённых файлов: 259 добавлений и 109 удалений

Просмотреть файл

@ -29,7 +29,7 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD)
# on wrench, because wrench technically builds hashes, not branches)
#
#
PACKAGE_HEAD_BRANCH=master
PACKAGE_HEAD_BRANCH=cycle8
ifeq ($(BUILD_REVISION),)
CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
else

2
external/mono поставляемый

@ -1 +1 @@
Subproject commit 765d709d24b3a2014c4f3d4faeeb193f2b7fef0c
Subproject commit d0b2dacbe4ab297d74043071b2db60f3d95ec8fe

2
external/watch-mono поставляемый

@ -1 +1 @@
Subproject commit 4239ddd9f18d778e03cc979c9d15135e47fb0e28
Subproject commit d0b2dacbe4ab297d74043071b2db60f3d95ec8fe

Просмотреть файл

@ -4,4 +4,4 @@
time make world
make -j8 -C tools/apidiff jenkins-api-diff
make -C tests jenkins || true
make -C tests jenkins

Просмотреть файл

@ -1,5 +1,5 @@
ifdef ENABLE_XAMARIN
NEEDED_MACCORE_VERSION := ab2150625edc341a4de4c6b57164a41baa8fb6a4
NEEDED_MACCORE_VERSION := 4b656b2ae80da9ea0c604d12d37195cb70ac1816
NEEDED_MACCORE_BRANCH := xcode8
MACCORE_DIRECTORY := maccore

Просмотреть файл

@ -1623,6 +1623,10 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
</ItemGroup>
<PropertyGroup>
<!-- Calculate IpaPackageDir and IpaPackageName based on IpaPackagePath, if defined. -->
<IpaPackageDir Condition="'$(IpaPackagePath)' != ''">$([System.Path]::GetDirectoryName('$(IpaPackagePath)'))</IpaPackageDir>
<IpaPackageName Condition="'$(IpaPackagePath)' != ''">$([System.Path]::GetFileName('$(IpaPackagePath)'))</IpaPackageName>
<!-- Calculate an IPA package directory path if not already defined by the developer. -->
<!--<IpaPackageDir Condition="'$(IpaPackageDir)' == ''">$([System.Environment]::GetEnvironmentVariable('IPA_PACKAGE_DIR'))</IpaPackageDir>-->
<IpaPackageDir Condition="'$(IpaPackageDir)' == ''">$(DeviceSpecificOutputPath)$(_AppBundleName) $([System.DateTime]::Now.ToString('yyyy-MM-dd HH-mm-ss'))</IpaPackageDir>
@ -1726,8 +1730,8 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
ExtraArgs="$(CodesignExtraArgs)"
/>
<RemoveDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' And '$(EmbedOnDemandResources)' == 'false'" Directories="$(_IpaOutputDir)OnDemandResources\" />
<MakeDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' And '$(EmbedOnDemandResources)' == 'false'" Directories="$(_IpaOutputDir)OnDemandResources\" />
<RemoveDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' And '$(EmbedOnDemandResources)' == 'false'" Directories="$(IpaPackageDir)\OnDemandResources\" />
<MakeDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' And '$(EmbedOnDemandResources)' == 'false'" Directories="$(IpaPackageDir)\OnDemandResources\" />
<CreateAssetPack
SessionId="$(BuildSessionId)"
@ -1735,20 +1739,20 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
ToolExe="$(ZipExe)"
ToolPath="$(ZipPath)"
Source="%(_AssetPack.Identity)"
OutputFile="$(_IpaOutputDir)OnDemandResources\%(_AssetPack.DirectoryName)"
OutputFile="$(IpaPackageDir)OnDemandResources\%(_AssetPack.DirectoryName)"
/>
<Copy
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' And '$(EmbedOnDemandResources)' == 'false'"
SourceFiles="$(_IpaAppBundleDir)AssetPackManifest.plist"
DestinationFolder="$(_IpaOutputDir)OnDemandResources\"
DestinationFolder="$(IpaPackageDir)\OnDemandResources\"
/>
</Target>
<Target Name="_ZipIpa" Condition="'$(BuildIpa)' == 'true'">
<MakeDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Directories="$(_IpaOutputPath)" />
<Delete SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Files="$(_IpaOutputDir)$(IpaPackageName)" />
<MakeDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Directories="$(IpaPackageDir)" />
<Delete SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Files="$(IpaPackagePath)" />
<Zip
SessionId="$(BuildSessionId)"

Просмотреть файл

@ -382,14 +382,10 @@ gboolean send_uninterrupted (int fd, const void *buf, int len)
{
int res;
MONO_ENTER_GC_SAFE;
do {
res = send (fd, buf, len, 0);
} while (res == -1 && errno == EINTR);
MONO_EXIT_GC_SAFE;
return res == len;
}
@ -399,28 +395,44 @@ int recv_uninterrupted (int fd, void *buf, int len)
int total = 0;
int flags = 0;
MONO_ENTER_GC_SAFE;
do {
res = recv (fd, (char *) buf + total, len - total, flags);
if (res > 0)
total += res;
} while ((res > 0 && total < len) || (res == -1 && errno == EINTR));
MONO_EXIT_GC_SAFE;
return total;
}
gboolean sdb_send (void *buf, int len)
{
return send_uninterrupted (sdb_fd, buf, len);
gboolean rv;
if (debugging_configured) {
MONO_ENTER_GC_SAFE;
rv = send_uninterrupted (sdb_fd, buf, len);
MONO_EXIT_GC_SAFE;
} else {
rv = send_uninterrupted (sdb_fd, buf, len);
}
return rv;
}
int sdb_recv (void *buf, int len)
{
return recv_uninterrupted (sdb_fd, buf, len);
int rv;
if (debugging_configured) {
MONO_ENTER_GC_SAFE;
rv = recv_uninterrupted (sdb_fd, buf, len);
MONO_EXIT_GC_SAFE;
} else {
rv = recv_uninterrupted (sdb_fd, buf, len);
}
return rv;
}
int monotouch_connect_wifi (NSMutableArray *ips)
@ -776,11 +788,9 @@ monotouch_load_debugger ()
transport.send = sdb_send;
transport.recv = sdb_recv;
MONO_ENTER_GC_UNSAFE;
mono_debugger_agent_register_transport (&transport);
mono_debugger_agent_parse_options ("transport=custom_transport,address=dummy,embedding=1");
MONO_EXIT_GC_UNSAFE;
LOG (PRODUCT ": Debugger loaded with custom transport (fd: %i)\n", sdb_fd);
} else {
@ -797,9 +807,7 @@ monotouch_load_profiler ()
// TODO: make this generic enough for other profilers to work too
// Main thread only
if (profiler_description != NULL) {
MONO_ENTER_GC_UNSAFE;
mono_profiler_load (profiler_description);
MONO_EXIT_GC_UNSAFE;
LOG (PRODUCT ": Profiler loaded: %s\n", profiler_description);
free (profiler_description);

Просмотреть файл

@ -139,20 +139,12 @@ namespace XamCore.CoreGraphics {
}
}
string GetNullableString (IntPtr handle)
{
if (handle == IntPtr.Zero)
return null;
using (var s = new CFString (handle, true))
return (string) s;
}
[DllImport (Constants.CoreGraphicsLibrary)]
extern static /* CFStringRef __nullable */ IntPtr CGFontCopyPostScriptName (/* CGFontRef __nullable */ IntPtr font);
public string PostScriptName {
get {
return GetNullableString (CGFontCopyPostScriptName (handle));
return CFString.FetchString (CGFontCopyPostScriptName (handle));
}
}
@ -161,7 +153,7 @@ namespace XamCore.CoreGraphics {
public string FullName {
get {
return GetNullableString (CGFontCopyFullName (handle));
return CFString.FetchString (CGFontCopyFullName (handle));
}
}
@ -266,7 +258,7 @@ namespace XamCore.CoreGraphics {
public string GlyphNameForGlyph (ushort glyph)
{
return GetNullableString (CGFontCopyGlyphNameForGlyph (handle, glyph));
return CFString.FetchString (CGFontCopyGlyphNameForGlyph (handle, glyph));
}
//[DllImport (Constants.CoreGraphicsLibrary)]

Просмотреть файл

@ -4072,6 +4072,9 @@ namespace XamCore.Foundation
[Since (5,0)]
[BaseType (typeof (NSObject))]
#if WATCH
[DisableDefaultCtor] // "NSUbiquitousKeyValueStore is unavailable" is printed to the log.
#endif
interface NSUbiquitousKeyValueStore {
[Static]
[Export ("defaultStore")]

Просмотреть файл

@ -14,5 +14,7 @@
<string>10.7</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>10.7</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>public.app-category.developer-tools</string>
<key>CFBundleName</key>
<string>introspection</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -160,6 +160,9 @@ namespace LinkAll {
[Test]
public void TrustUsingOldPolicy ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
// Three similar tests exists in dontlink, linkall and linksdk to test 3 different cases
// untrusted, custom ICertificatePolicy and ServerCertificateValidationCallback without
// having caching issues (in S.Net or the SSL handshake cache)

Просмотреть файл

@ -22,6 +22,9 @@ namespace LinkSdk {
[Test]
public void Bug12221 ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
LoadCategories ().Wait ();
}
}

Просмотреть файл

@ -41,6 +41,9 @@ namespace LinkSdk {
[Test]
public void TrustUsingNewCallback ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
// Three similar tests exists in dontlink, linkall and linksdk to test 3 different cases
// untrusted, custom ICertificatePolicy and ServerCertificateValidationCallback without
// having caching issues (in S.Net or the SSL handshake cache)
@ -67,6 +70,9 @@ namespace LinkSdk {
[Test]
public void SSL_IP_5706 ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
WebClient wc = new WebClient ();
// the certificate contains (several rules) the host name
Assert.NotNull (wc.DownloadString ("https://www.google.com"));
@ -88,6 +94,9 @@ namespace LinkSdk {
[Test]
public void TLS1_ServerNameExtension ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
// without support for the "server_name" TLS extension (RFC3546) we receive the "general"
// certificate of a server, which might not be the right one if a single server instance
// is used for many hosts (without a common name)

Просмотреть файл

@ -650,6 +650,9 @@ namespace LinkSdk {
[Test]
public void WebClient_SSL_Leak ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
WebClient wc = new WebClient ();
// note: needs to be executed under Instrument to verify it does not leak
string s = wc.DownloadString ("https://developers.google.com");
@ -902,7 +905,7 @@ namespace LinkSdk {
path = TestFolder (Environment.SpecialFolder.UserProfile, readOnly: device);
if (Runtime.Arch == Arch.DEVICE) {
#if __WATCHOS__
Assert.True (path.StartsWith ("/private/var/mobile/Containers/Data/Application/", StringComparison.Ordinal), "Containers-ios8");
Assert.That (path, Is.StringStarting ("/private/var/mobile/Containers/Data/PluginKitPlugin/"), "Containers-ios8");
#else
if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0))
Assert.True (path.StartsWith ("/private/var/mobile/Containers/Data/Application/", StringComparison.Ordinal), "Containers-ios8");

Просмотреть файл

@ -29,6 +29,9 @@ namespace LinkSdk {
[Test]
public void System ()
{
#if __WATCHOS__
Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires.");
#endif
const string url = "http://www.google.com";
Uri uri = new Uri (url);

Просмотреть файл

@ -14,5 +14,7 @@
<string>10.7</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -14,5 +14,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -12,5 +12,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -16,5 +16,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -25,15 +25,14 @@ namespace MonoTouchFixtures.Foundation {
[TestFixture]
[Preserve (AllMembers = true)]
public class NSUbiquitousKeyValueStoreTest {
#if !__WATCHOS__
// Looks like NSUbiquitousKeyValueStore doesn't work on watchOS:
// http://stackoverflow.com/questions/37412775/nsubiquitouskeyvaluestore-is-unavailable-watchos-2
// https://forums.developer.apple.com/thread/47564
[Test]
public void Indexer ()
{
#if __WATCHOS__
// Looks like NSUbiquitousKeyValueStore doesn't work on watchOS:
// http://stackoverflow.com/questions/37412775/nsubiquitouskeyvaluestore-is-unavailable-watchos-2
// https://forums.developer.apple.com/thread/47564
Assert.Ignore ("Doesn't work on watchOS");
#endif
using (var store = new NSUbiquitousKeyValueStore ()) {
using (var key = new NSString ("key")) {
@ -48,5 +47,6 @@ namespace MonoTouchFixtures.Foundation {
}
}
}
#endif
}
}

Просмотреть файл

@ -24,5 +24,7 @@
<string>donblas</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -311,7 +311,7 @@ namespace xharness
public async Task<int> RunAsync ()
{
HashSet<string> start_crashes = null;
CrashReportSnapshot crash_reports = new CrashReportSnapshot () { Device = !isSimulator, Harness = Harness, Log = main_log, Logs = Logs, LogDirectory = LogDirectory };
LogStream device_system_log = null;
LogStream listener_log = null;
Log run_log = main_log;
@ -403,7 +403,7 @@ namespace xharness
args.AppendFormat (" \"{0}\" ", launchAppPath);
args.Append (" --device=:v2:udid=").Append (simulator.UDID).Append (" ");
start_crashes = await Harness.CreateCrashReportsSnapshotAsync (main_log, true);
await crash_reports.StartCaptureAsync ();
listener.StartAsync ();
main_log.WriteLine ("Starting test run");
@ -482,7 +482,7 @@ namespace xharness
};
logdev.StartCapture ();
start_crashes = await Harness.CreateCrashReportsSnapshotAsync (main_log, false);
await crash_reports.StartCaptureAsync ();
listener.StartAsync ();
main_log.WriteLine ("Starting test run");
@ -556,62 +556,11 @@ namespace xharness
crashed = true;
}
// Check for crash reports
var crash_report_search_done = false;
var crash_report_search_timeout = 5;
var watch = new Stopwatch ();
watch.Start ();
do {
var end_crashes = await Harness.CreateCrashReportsSnapshotAsync (main_log, isSimulator);
end_crashes.ExceptWith (start_crashes);
if (end_crashes.Count > 0) {
main_log.WriteLine ("Found {0} new crash report(s)", end_crashes.Count);
List<LogFile> crash_reports;
if (isSimulator) {
crash_reports = new List<LogFile> (end_crashes.Count);
foreach (var path in end_crashes) {
var logPath = Path.Combine (LogDirectory, Path.GetFileName (path));
File.Copy (path, logPath, true);
crash_reports.Add (Logs.CreateFile ("Crash report: " + Path.GetFileName (path), logPath));
}
} else {
// Download crash reports from the device. We put them in the project directory so that they're automatically deleted on wrench
// (if we put them in /tmp, they'd never be deleted).
var downloaded_crash_reports = new List<LogFile> ();
foreach (var file in end_crashes) {
var crash_report_target = Logs.CreateFile ("Crash report: " + Path.GetFileName (file), Path.Combine (LogDirectory, Path.GetFileName (file)));
var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, "--download-crash-report=" + file + " --download-crash-report-to=" + crash_report_target.Path + " --sdkroot " + Harness.XcodeRoot, main_log, TimeSpan.FromMinutes (1));
if (result.Succeeded) {
main_log.WriteLine ("Downloaded crash report {0} to {1}", file, crash_report_target.Path);
crash_report_target = await Harness.SymbolicateCrashReportAsync (main_log, crash_report_target);
Logs.Add (crash_report_target);
downloaded_crash_reports.Add (crash_report_target);
} else {
main_log.WriteLine ("Could not download crash report {0}", file);
}
}
crash_reports = downloaded_crash_reports;
}
foreach (var cp in crash_reports) {
Harness.LogWrench ("@MonkeyWrench: AddFile: {0}", cp.Path);
main_log.WriteLine (" {0}", cp.Path);
}
crash_report_search_done = true;
} else if (!crashed && !timed_out) {
crash_report_search_done = true;
} else {
if (watch.Elapsed.TotalSeconds > crash_report_search_timeout) {
crash_report_search_done = true;
} else {
main_log.WriteLine ("No crash reports, waiting a second to see if the crash report service just didn't complete in time ({0})", (int) (crash_report_search_timeout - watch.Elapsed.TotalSeconds));
Thread.Sleep (TimeSpan.FromSeconds (1));
}
}
} while (!crash_report_search_done);
if (!success.HasValue)
success = false;
await crash_reports.EndCaptureAsync (TimeSpan.FromSeconds (success.Value ? 0 : 5));
if (timed_out) {
Result = TestExecutingResult.TimedOut;
} else if (crashed) {

Просмотреть файл

@ -635,11 +635,11 @@ namespace xharness
}
}
public async Task<HashSet<string>> CreateCrashReportsSnapshotAsync (Log log, bool simulator)
public async Task<HashSet<string>> CreateCrashReportsSnapshotAsync (Log log, bool simulatorOrDesktop)
{
var rv = new HashSet<string> ();
if (simulator) {
if (simulatorOrDesktop) {
var dir = Path.Combine (Environment.GetEnvironmentVariable ("HOME"), "Library", "Logs", "DiagnosticReports");
if (Directory.Exists (dir))
rv.UnionWith (Directory.EnumerateFiles (dir));
@ -657,4 +657,76 @@ namespace xharness
return rv;
}
}
public class CrashReportSnapshot
{
public Harness Harness { get; set; }
public Log Log { get; set; }
public Logs Logs { get; set; }
public string LogDirectory { get; set; }
public bool Device { get; set; }
public HashSet<string> InitialSet { get; private set; }
public IEnumerable<string> Reports { get; private set; }
public async Task StartCaptureAsync ()
{
InitialSet = await Harness.CreateCrashReportsSnapshotAsync (Log, !Device);
}
public async Task EndCaptureAsync (TimeSpan timeout)
{
// Check for crash reports
var crash_report_search_done = false;
var crash_report_search_timeout = timeout.TotalSeconds;
var watch = new Stopwatch ();
watch.Start ();
do {
var end_crashes = await Harness.CreateCrashReportsSnapshotAsync (Log, !Device);
end_crashes.ExceptWith (InitialSet);
Reports = end_crashes;
if (end_crashes.Count > 0) {
Log.WriteLine ("Found {0} new crash report(s)", end_crashes.Count);
List<LogFile> crash_reports;
if (!Device) {
crash_reports = new List<LogFile> (end_crashes.Count);
foreach (var path in end_crashes) {
var logPath = Path.Combine (LogDirectory, Path.GetFileName (path));
File.Copy (path, logPath, true);
crash_reports.Add (Logs.CreateFile ("Crash report: " + Path.GetFileName (path), logPath));
}
} else {
// Download crash reports from the device. We put them in the project directory so that they're automatically deleted on wrench
// (if we put them in /tmp, they'd never be deleted).
var downloaded_crash_reports = new List<LogFile> ();
foreach (var file in end_crashes) {
var crash_report_target = Logs.CreateFile ("Crash report: " + Path.GetFileName (file), Path.Combine (LogDirectory, Path.GetFileName (file)));
var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, "--download-crash-report=" + file + " --download-crash-report-to=" + crash_report_target.Path + " --sdkroot " + Harness.XcodeRoot, Log, TimeSpan.FromMinutes (1));
if (result.Succeeded) {
Log.WriteLine ("Downloaded crash report {0} to {1}", file, crash_report_target.Path);
crash_report_target = await Harness.SymbolicateCrashReportAsync (Log, crash_report_target);
Logs.Add (crash_report_target);
downloaded_crash_reports.Add (crash_report_target);
} else {
Log.WriteLine ("Could not download crash report {0}", file);
}
}
crash_reports = downloaded_crash_reports;
}
foreach (var cp in crash_reports) {
Harness.LogWrench ("@MonkeyWrench: AddFile: {0}", cp.Path);
Log.WriteLine (" {0}", cp.Path);
}
crash_report_search_done = true;
} else {
if (watch.Elapsed.TotalSeconds > crash_report_search_timeout) {
crash_report_search_done = true;
} else {
Log.WriteLine ("No crash reports, waiting a second to see if the crash report service just didn't complete in time ({0})", (int) (crash_report_search_timeout - watch.Elapsed.TotalSeconds));
Thread.Sleep (TimeSpan.FromSeconds (1));
}
}
} while (!crash_report_search_done);
}
}
}

Просмотреть файл

@ -89,7 +89,7 @@ namespace xharness
var companion =
Simulators.AvailableDevices.
FirstOrDefault ((SimDevice v) => pair.Companion == v.UDID);
runtasks.Add (new RunSimulatorTask (buildTask, device, companion) { Platform = TestPlatform.watchOS, ExecutionResult = TestExecutingResult.Ignored });
runtasks.Add (new RunSimulatorTask (buildTask, device, companion) { Platform = TestPlatform.watchOS });
} else {
var latestiOSRuntime =
Simulators.SupportedRuntimes.
@ -276,7 +276,7 @@ namespace xharness
tasks.Add (task.RunAsync ());
Task.WaitAll (tasks.ToArray ());
GenerateReport ();
return Tasks.Any ((v) => v.ExecutionResult == TestExecutingResult.Failed || v.ExecutionResult == TestExecutingResult.Crashed) ? 1 : 0;
return Tasks.Any ((v) => v.Failed) ? 1 : 0;
} catch (Exception ex) {
MainLog.WriteLine ("Unexpected exception: {0}", ex);
return 2;
@ -939,8 +939,13 @@ function toggleContainerVisibility (containerName)
log.WriteLine ("{0} {1}", proc.StartInfo.FileName, proc.StartInfo.Arguments);
if (!Harness.DryRun) {
ExecutionResult = TestExecutingResult.Running;
var snapshot = new CrashReportSnapshot () { Device = false, Harness = Harness, Log = log, Logs = Logs, LogDirectory = LogDirectory };
await snapshot.StartCaptureAsync ();
try {
var timeout = TimeSpan.FromMinutes (10);
var result = await proc.RunAsync (log, true, timeout);
if (result.TimedOut) {
log.WriteLine ("Execution timed out after {0} seconds.", timeout.TotalSeconds);
@ -954,6 +959,8 @@ function toggleContainerVisibility (containerName)
log.WriteLine (e.ToString ());
ExecutionResult = TestExecutingResult.HarnessException;
}
await snapshot.EndCaptureAsync (TimeSpan.FromSeconds (Succeeded ? 0 : 5));
}
Jenkins.MainLog.WriteLine ("Executed {0} ({1})", TestName, Mode);
}
@ -1150,7 +1157,11 @@ function toggleContainerVisibility (containerName)
run_timer.Stop ();
}
ExecutionResult = Tasks.Any ((v) => !v.Succeeded) ? TestExecutingResult.Failed : TestExecutingResult.Succeeded;
if (Tasks.All ((v) => v.Ignored)) {
ExecutionResult = TestExecutingResult.Ignored;
} else {
ExecutionResult = Tasks.Any ((v) => v.Failed) ? TestExecutingResult.Failed : TestExecutingResult.Succeeded;
}
}
}

Просмотреть файл

@ -107,7 +107,7 @@ namespace xharness
public override TextWriter GetWriter ()
{
return writer ?? (writer = new StreamWriter (new FileStream (Path, FileMode.Open, FileAccess.Write, FileShare.Read)));
return writer ?? (writer = new StreamWriter (new FileStream (Path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read)));
}
protected override void Dispose (bool disposing)

Просмотреть файл

@ -3234,7 +3234,7 @@ namespace XamCore.Registrar {
body.WriteLine ("if (exception_gchandle != 0) goto exception_handling;");
body.WriteLine ("if (has_nsobject) {");
body.WriteLine ("*call_super = true;");
body.WriteLine ("return self;");
body.WriteLine ("goto exception_handling;");
body.WriteLine ("}");
}

Просмотреть файл

@ -773,9 +773,12 @@
<method name="GetAppDomainTarget" />
</type>
<!-- domain.c: mono_defaults.transparent_proxy_class / removed with DISABLE_REMOTING
<type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" />
-->
<!-- domain.c: mono_defaults.transparent_proxy_class -->
<type fullname="System.Runtime.Remoting.Proxies.TransparentProxy">
<!-- remoting.c: mono_marshal_get_ldfld_wrapper -->
<method name="LoadRemoteFieldNew" />
</type>
<type fullname="System.Runtime.Remoting.RemotingServices">
<method name="SerializeCallData" />

Просмотреть файл

@ -627,9 +627,24 @@ namespace Xamarin.Bundler
sw.WriteLine ("();");
}
}
// Burn in a reference to the profiling symbol so that the native linker doesn't remove it
// On iOS we can pass -u to the native linker, but that doesn't work on tvOS, where
// we're building with bitcode (even when bitcode is disabled, we still build with the
// bitcode marker, which makes the linker reject -u).
if (App.EnableProfiling) {
sw.WriteLine ("extern \"C\" { void mono_profiler_startup_log (); }");
sw.WriteLine ("typedef void (*xamarin_profiler_symbol_def)();");
sw.WriteLine ("extern xamarin_profiler_symbol_def xamarin_profiler_symbol;");
sw.WriteLine ("xamarin_profiler_symbol_def xamarin_profiler_symbol = NULL;");
}
sw.WriteLine ("void xamarin_setup_impl ()");
sw.WriteLine ("{");
if (App.EnableProfiling)
sw.WriteLine ("\txamarin_profiler_symbol = mono_profiler_startup_log;");
if (App.EnableLLVMOnlyBitCode)
sw.WriteLine ("\tmono_jit_set_aot_mode (MONO_AOT_MODE_LLVMONLY);");