[tests] Fix several issues that show up in the mtouch and introspection tests on macOS 10.15. (#6929)

* [introspection] Fix several issues that show up on macOS 10.15.

* [tests][mtouch] Fix a few tests according to recent changes.
This commit is contained in:
Rolf Bjarne Kvinge 2019-09-06 17:57:40 -07:00 коммит произвёл Sebastien Pouliot
Родитель f79f1c794c
Коммит 0b4fc12f32
10 изменённых файлов: 56 добавлений и 21 удалений

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

@ -40,14 +40,14 @@ namespace Photos {
#if MONOMAC
public partial class PHAssetCollection {
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11")]
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11.")]
[Unavailable (PlatformName.MacOSX)]
public static PHFetchResult FetchMoments (PHFetchOptions options)
{
return null;
}
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11")]
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11.")]
[Unavailable (PlatformName.MacOSX)]
public static PHFetchResult FetchMoments (PHCollectionList momentList, PHFetchOptions options)
{
@ -57,14 +57,14 @@ namespace Photos {
public partial class PHCollectionList {
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11")]
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11.")]
[Unavailable (PlatformName.MacOSX)]
public static PHFetchResult FetchMomentLists (PHCollectionListSubtype subType, PHFetchOptions options)
{
return null;
}
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11")]
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11.")]
[Unavailable (PlatformName.MacOSX)]
public static PHFetchResult FetchMomentLists (PHCollectionListSubtype subType, PHAssetCollection moment, PHFetchOptions options)
{
@ -74,7 +74,7 @@ namespace Photos {
public partial class PHContentEditingInput {
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11")]
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11.")]
[Unavailable (PlatformName.MacOSX, message: "Use 'AudiovisualAsset' instead.")]
public virtual AVFoundation.AVAsset AvAsset {
get { return AudiovisualAsset; }
@ -85,7 +85,7 @@ namespace Photos {
public partial class PHImageManager {
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11")]
[Obsolete ("Compatibility stub - This was marked as unavailable on macOS with Xcode 11.")]
[Unavailable (PlatformName.MacOSX, message: "Use 'RequestImageDataAndOrientation (PHAsset asset, [NullAllowed] PHImageRequestOptions options, PHImageManagerRequestImageDataHandler resultHandler)' instead.")]
public virtual int RequestImageData (PHAsset asset, PHImageRequestOptions options, PHImageDataHandler handler)
{

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

@ -55,12 +55,12 @@ namespace Security {
Invalid = -1,
WhenUnlocked,
AfterFirstUnlock,
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'AfterFirstUnlock' or a better suited option instead.'")]
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'AfterFirstUnlock' or a better suited option instead.")]
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'AfterFirstUnlock' or a better suited option instead.")]
Always,
WhenUnlockedThisDeviceOnly,
AfterFirstUnlockThisDeviceOnly,
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.'")]
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.")]
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.")]
AlwaysThisDeviceOnly,
WhenPasscodeSetThisDeviceOnly

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

@ -7659,7 +7659,7 @@ namespace AVFoundation {
[TV (13,0), NoWatch, Mac (10,15), iOS (13,0)]
[Field ("AVAssetExportPresetHEVCHighestQualityWithAlpha")]
NSString PresetHevchHighestQualityWithAlpha { get; }
NSString PresetHevcHighestQualityWithAlpha { get; }
// 5.0 APIs
[Export ("asset", ArgumentSemantic.Retain)]
@ -13296,7 +13296,7 @@ namespace AVFoundation {
[NullAllowed, Export ("fileDataRepresentation")]
NSData FileDataRepresentation { get; }
[iOS (11,0)]
[iOS (11,0), NoMac]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'GetFileDataRepresentation' instead.")]
[Export ("fileDataRepresentationWithReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData:")]
[return: NullAllowed]

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

@ -839,7 +839,7 @@ namespace GameKit {
[TV (13,0)][Mac (10,15)][iOS (13,0)][Watch (6,0)]
[Export ("loadChallengableFriendsWithCompletionHandler:")]
[Async]
void LoadChallengableFriends ([NullAllowed] Action<GKPlayer [], NSError> completionHandler);
void LoadChallengeableFriends ([NullAllowed] Action<GKPlayer [], NSError> completionHandler);
[NoWatch]
[TV (13,0)][Mac (10,15)][iOS (13,0)]

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

@ -134,8 +134,7 @@ namespace Xamarin.Tests
break;
case MachO.LoadCommands.MinwatchOS:
version = SdkVersions.MinWatchOSVersion;
if (device)
alternate_version = new Version (5, 1, 0); // arm64_32 has min OS 5.1
alternate_version = new Version (5, 1, 0); // arm64_32 has min OS 5.1
mono_native_compat_version = SdkVersions.MinWatchOSVersion;
mono_native_unified_version = new Version (5, 0, 0);
if (device)

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

@ -88,14 +88,17 @@ namespace Introspection
"Addl",
"Addr",
"Adjustmentfor",
"Aes", // Advanced Encryption Standard
"Aifc",
"Aiff",
"Agc",
"Aio",
"Alg", // short for Algorithm
"Alpn", // Application-Layer Protocol Negotiation RFC7301
"Amete",
"Amr",
"Anglet",
"Apng", // Animated Portable Network Graphics
"Aps",
"Arraycollation",
"Argb",
@ -107,6 +110,7 @@ namespace Introspection
"Attrs", // Attributes (used by Apple for keys)
"Audiofile",
"Automapping",
"Automatch",
"Automounted",
"Autoredirect",
"Autospace",
@ -144,6 +148,7 @@ namespace Introspection
"Characterteristic",
"Chapv",
"Cholesky",
"Chacha",
"Chromaticities",
"Ciexyz",
"Ciff",
@ -200,6 +205,7 @@ namespace Introspection
"Ebu",
"Ecc", // Elliptic Curve Cryptography
"Ecdh", // Elliptic Curve Diffie–Hellman
"Ecdhe", // Elliptic Curve Diffie-Hellman Ephemeral
"Ecdsa", // Elliptic Curve Digital Signature Algorithm
"Ecies", // Elliptic Curve Integrated Encryption Scheme
"Ecn", // Explicit Congestion Notification
@ -250,6 +256,7 @@ namespace Introspection
"Greeking",
"Gtin",
"Hardlink",
"Heics", // High Efficiency Image File Format (Sequence)
"Hdmi",
"Hdr",
"Hectopascals",
@ -386,6 +393,7 @@ namespace Introspection
"Nyquist",
"Oaep", // Optimal asymmetric encryption padding
"Objectfor",
"Objectness",
"Occlussion",
"Ocurrences",
"Ocsp", // Online Certificate Status Protocol
@ -514,7 +522,10 @@ namespace Introspection
"th",
"Threadgroup",
"Threadgroups",
"Thumbnailing",
"Thumbstick",
"Thumbsticks",
"Timecodes",
"Timelapse",
"Timelapses",
"Tls",

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

@ -83,6 +83,8 @@ namespace Introspection {
case "MLPredictionOptions": // Conformance not in headers
case "NSUrlSessionTaskMetrics": // Conformance not in headers
case "NSUrlSessionTaskTransactionMetrics": // Conformance not in headers
case "NSFileProviderDomain": // Conformance not in headers
case "FPUIActionExtensionContext": // Conformance not in headers
return true;
#if !UNIFIED
// existing classic/old binary is not updated
@ -118,6 +120,7 @@ namespace Introspection {
// Xcode 11 (running on macOS 10.15)
case "NSCollectionViewUpdateItem": // Not declared in header file
case "MLPredictionOptions": // Not declared in header file
case "FPUIActionExtensionContext": // Conformance not in headers
return true;
}
break;
@ -176,6 +179,8 @@ namespace Introspection {
case "MLPredictionOptions": // Conformance not in headers
case "NSUrlSessionTaskMetrics": // Conformance not in headers
case "NSUrlSessionTaskTransactionMetrics": // Conformance not in headers
case "NSFileProviderDomain": // Conformance not in headers
case "FPUIActionExtensionContext": // Conformance not in headers
return true;
}
break;

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

@ -675,6 +675,25 @@ namespace Introspection {
break;
}
break;
case "AVFoundation":
switch (type.Name) {
case "AVCapturePhoto":
switch (selectorName) {
case "fileDataRepresentationWithReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData:":
// This method was mistakenly bound in macOS.
return true;
}
break;
case "AVSpeechSynthesisVoice":
switch (selectorName) {
case "gender":
// Selector not there: https://github.com/xamarin/maccore/issues/1949
return true;
}
break;
break;
}
break;
}
return base.Skip (type, selectorName);
}

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

@ -279,7 +279,7 @@ public class B : A {}
mtouch.CreateTemporaryCacheDirectory ();
mtouch.Abi = abi;
mtouch.Debug = debug;
mtouch.TargetVer = "6.0";
mtouch.TargetVer = "7.0";
mtouch.NoStrip = true;
DateTime dt = DateTime.MinValue;
@ -749,19 +749,19 @@ public class B : A {}
mtouch.Abi = "armv7s,arm64";
mtouch.AssertExecuteFailure (MTouchAction.BuildDev, $"build: {mtouch.Abi}");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 6.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 7.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.Abi = "armv7s";
mtouch.AssertExecuteFailure (MTouchAction.BuildDev, $"build: {mtouch.Abi}");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 6.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 7.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.Abi = "arm64";
mtouch.AssertExecuteFailure (MTouchAction.BuildDev, $"build: {mtouch.Abi}");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 6.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 7.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.Abi = "armv7";
mtouch.AssertExecuteFailure (MTouchAction.BuildDev, $"build: {mtouch.Abi}");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 6.0.. Please select a newer deployment target in your project's Info.plist.");
mtouch.AssertErrorPattern (73, "Xamarin.iOS .* does not support a deployment target of 3.1 for iOS .the minimum is 7.0.. Please select a newer deployment target in your project's Info.plist.");
}
}
@ -1270,10 +1270,10 @@ public class B : A {}
app.AppExtensions.Add (extension);
app.CreateTemporaryApp ();
app.CreateTemporaryCacheDirectory ();
app.TargetVer = "6.0";
app.TargetVer = "7.0";
app.WarnAsError = new int [] { 112 };
app.AssertExecuteFailure (MTouchAction.BuildDev, "build app");
app.AssertError (112, "Native code sharing has been disabled because the container app's deployment target is earlier than iOS 8.0 (it's 6.0).");
app.AssertError (112, "Native code sharing has been disabled because the container app's deployment target is earlier than iOS 8.0 (it's 7.0).");
}
}
}

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

@ -306,11 +306,12 @@ namespace Xamarin.Bundler
// and very hard to diagnose otherwise when hidden from the build output. Ref: bug #2430
var linker_errors = new List<Exception> ();
var output = new StringBuilder ();
var code = await Driver.RunCommandAsync (Target.App.CompilerPath, CompilerFlags.ToString (), null, output);
var code = await Driver.RunCommandAsync (Target.App.CompilerPath, CompilerFlags.ToString (), null, output, suppressPrintOnErrors: true);
Application.ProcessNativeLinkerOutput (Target, output.ToString (), CompilerFlags.AllLibraries, linker_errors, code != 0);
if (code != 0) {
Console.WriteLine ($"Process exited with code {code}, command:\n{Target.App.CompilerPath} {CompilerFlags.ToString ()}\n{output} ");
// if the build failed - it could be because of missing frameworks / libraries we identified earlier
foreach (var assembly in Target.Assemblies) {
if (assembly.UnresolvedModuleReferences == null)