Skip to content

Commit 75db305

Browse files
authored
[introspection] Tweak which assemblies ApiPInvokeTest tests. (#24252)
* Don't test the platform assembly in the simulator. * Only test the platform assembly on the latest OS version. Otherwise test everything. This makes it so that System.Private.CoreLib.dll is tested on all OS versions.
1 parent 95b6591 commit 75db305

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/introspection/iOSApiPInvokeTest.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ protected override bool Skip (string symbolName)
6868

6969
protected override bool SkipAssembly (Assembly a)
7070
{
71-
// we only want to check this on a version of iOS that
72-
// 1. is the current SDK target (or a newer one)
73-
var sdk = new Version (Constants.SdkVersion);
74-
#if __IOS__ || __TVOS__
75-
if (!UIDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor))
76-
return true;
77-
#else
78-
#error unknown target
79-
#endif
80-
// 2. on the real target for Xamarin.iOS.dll/monotouch.dll
81-
// as the simulator miss some libraries and symbols
82-
// but the rest of the BCL is fine to test
83-
return (a == typeof (NSObject).Assembly && TestRuntime.IsSimulatorOrDesktop);
71+
if (a == typeof (NSObject).Assembly) {
72+
// Don't test our product assembly in the simulator, because the
73+
// simulator might lack some libraries and symbols.
74+
if (TestRuntime.IsSimulator)
75+
return true;
76+
77+
// Also we only want to check this on the OS version we're actually built for.
78+
var sdk = new Version (Constants.SdkVersion);
79+
if (!UIDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor))
80+
return true;
81+
}
82+
83+
return false;
8484
}
8585

8686
[Test]

0 commit comments

Comments
 (0)