Skip to content

Commit

Permalink
[tests][mtouch] Adjust tests to cope with Xcode 9. Fixes #57601. (xam…
Browse files Browse the repository at this point in the history
…arin#2231)

Fixes:

1. Failed : Xamarin.MTouch.MT0091(tvOS,"tvOS")
    The error 'MT0091: This version of Xamarin.iOS requires the tvOS 11.0 SDK (shipped with Xcode 9.0). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).' was not found in the output:
    Message xamarin#1 did not match:
        actual:   'This version of Xamarin.iOS requires the tvOS 11.0 SDK (shipped with Xcode 9). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).'
        expected: 'This version of Xamarin.iOS requires the tvOS 11.0 SDK (shipped with Xcode 9.0). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).'

2. Failed : Xamarin.MTouch.MT0091(iOS,"iOS")
    The error 'MT0091: This version of Xamarin.iOS requires the iOS 11.0 SDK (shipped with Xcode 9.0). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).' was not found in the output:
    Message xamarin#1 did not match:
        actual:   'This version of Xamarin.iOS requires the iOS 11.0 SDK (shipped with Xcode 9). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).'
        expected: 'This version of Xamarin.iOS requires the iOS 11.0 SDK (shipped with Xcode 9.0). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).'

3. Failed : Xamarin.Registrar.NoWarnings
    no warnings
    Expected: not String matching "warning:"
    But was:  "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.MTouchTool.CreateTemporaryDirectory298/mtouch-test-cache/registrar.m:32468:17: warning: method 'paymentAuthorizationViewController:didAuthorizePayment:handler:' in protocol 'PKPaymentAuthorizationViewControllerDelegate' not implemented [-Wprotocol]"

https://bugzilla.xamarin.com/show_bug.cgi?id=57601
  • Loading branch information
rolfbjarne authored Jun 21, 2017
1 parent 08614af commit c1348da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/mtouch/MTouch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,10 @@ public void MT0091 (Profile profile, string name)
mtouch.Linker = MTouchLinker.DontLink;
mtouch.Sdk = sdk_version;
Assert.AreEqual (1, mtouch.Execute (MTouchAction.BuildSim));
mtouch.AssertError (91, String.Format ("This version of Xamarin.iOS requires the {0} {1} SDK (shipped with Xcode {2}). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).", name, GetSdkVersion (profile), Configuration.XcodeVersion));
var xcodeVersionString = Configuration.XcodeVersion;
if (xcodeVersionString.EndsWith (".0", StringComparison.Ordinal))
xcodeVersionString = xcodeVersionString.Substring (0, xcodeVersionString.Length - 2);
mtouch.AssertError (91, String.Format ("This version of Xamarin.iOS requires the {0} {1} SDK (shipped with Xcode {2}). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only (to try to avoid the new APIs).", name, GetSdkVersion (profile), xcodeVersionString));
}
}

Expand Down
5 changes: 4 additions & 1 deletion tests/mtouch/RegistrarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,11 @@ public void NoWarnings ()
mtouch.Verbosity = 9; // Increase verbosity, otherwise linker warnings aren't shown
mtouch.AssertExecute (MTouchAction.BuildSim, "build");
mtouch.AssertNoWarnings ();
foreach (var line in mtouch.OutputLines)
foreach (var line in mtouch.OutputLines) {
if (line.Contains ("warning: method 'paymentAuthorizationViewController:didAuthorizePayment:handler:' in protocol 'PKPaymentAuthorizationViewControllerDelegate' not implemented [-Wprotocol]"))
continue; // Xcode 9 beta 1: this method changed from optional to required.
Assert.That (line, Does.Not.Match ("warning:"), "no warnings");
}
}
}

Expand Down

0 comments on commit c1348da

Please sign in to comment.