[tests][xtro] Fix NSUrl-based categories (#9029)
We were using the managed name, e.g. `NSUrl`, instead of the native name, e.g. `NSURL`, when dealing with categories. To fix this we must resolve the type and this caused issues as other assemblies (e.g. OpenTK) were not already loaded/cached and some type could not be resolved (and this throw exceptions) The runner now loads all assemblies before starting to visit them. The fix solved a known issue (iOS-NetworkExtension.ignore), some API that were already bound (common-Foundation.ignore) and also caught an additional API where we missed a `[NullAllowed]` on a return value
This commit is contained in:
Родитель
f4d165863a
Коммит
1b09465acf
|
@ -6226,6 +6226,7 @@ namespace Foundation
|
|||
|
||||
[Mac (10,10), iOS (8,0)]
|
||||
[Export ("promisedItemResourceValuesForKeys:error:")]
|
||||
[return: NullAllowed]
|
||||
NSDictionary GetPromisedItemResourceValues (NSString [] keys, out NSError error);
|
||||
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@ namespace Extrospection {
|
|||
// static types, e.g. categories, won't have a [Register] attribute
|
||||
if (type.IsStatic ()) {
|
||||
if (self.HasParameters)
|
||||
tname = self.Parameters [0].ParameterType.Name; // extension method
|
||||
tname = self.Parameters [0].ParameterType.Resolve ().GetName (); // extension method
|
||||
}
|
||||
if (tname == null)
|
||||
return null;
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace Extrospection {
|
|||
Helpers.Platform = Platforms.tvOS;
|
||||
managed_reader.Load (assemblyName);
|
||||
}
|
||||
managed_reader.Process ();
|
||||
|
||||
var reader = new AstReader ();
|
||||
foreach (var v in managed_reader) {
|
||||
|
@ -62,9 +63,21 @@ namespace Extrospection {
|
|||
|
||||
class AssemblyReader : IEnumerable<BaseVisitor> {
|
||||
|
||||
HashSet<AssemblyDefinition> assemblies = new HashSet<AssemblyDefinition> ();
|
||||
DefaultAssemblyResolver resolver = new DefaultAssemblyResolver ();
|
||||
|
||||
public void Load (string filename)
|
||||
{
|
||||
var ad = AssemblyDefinition.ReadAssembly (filename);
|
||||
resolver.AddSearchDirectory (Path.GetDirectoryName (filename));
|
||||
ReaderParameters rp = new ReaderParameters () {
|
||||
AssemblyResolver = resolver
|
||||
};
|
||||
assemblies.Add (AssemblyDefinition.ReadAssembly (filename, rp));
|
||||
}
|
||||
|
||||
public void Process ()
|
||||
{
|
||||
foreach (var ad in assemblies) {
|
||||
foreach (var v in Visitors) {
|
||||
v.VisitManagedAssembly (ad);
|
||||
foreach (var module in ad.Modules) {
|
||||
|
@ -76,6 +89,7 @@ namespace Extrospection {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessType (BaseVisitor v, TypeDefinition type)
|
||||
{
|
||||
|
|
|
@ -809,14 +809,11 @@
|
|||
!missing-selector! NSTimeZone::isDaylightSavingTime not bound
|
||||
!missing-selector! NSTimeZone::isEqualToTimeZone: not bound
|
||||
!missing-selector! NSTimeZone::nextDaylightSavingTimeTransition not bound
|
||||
!missing-selector! NSURL::checkPromisedItemIsReachableAndReturnError: not bound
|
||||
!missing-selector! NSURL::checkResourceIsReachableAndReturnError: not bound
|
||||
!missing-selector! NSURL::getPromisedItemResourceValue:forKey:error: not bound
|
||||
!missing-selector! NSURL::initAbsoluteURLWithDataRepresentation:relativeToURL: not bound
|
||||
!missing-selector! NSURL::initFileURLWithPath: not bound
|
||||
!missing-selector! NSURL::initFileURLWithPath:relativeToURL: not bound
|
||||
!missing-selector! NSURL::initWithDataRepresentation:relativeToURL: not bound
|
||||
!missing-selector! NSURL::promisedItemResourceValuesForKeys:error: not bound
|
||||
!missing-selector! NSURL::setResourceValues:error: not bound
|
||||
!missing-selector! NSURL::URLByAppendingPathComponent: not bound
|
||||
!missing-selector! NSURL::URLByResolvingSymlinksInPath not bound
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
## bound as a category - needs debugging (URL capitalizarion?)
|
||||
!missing-selector! NSMutableURLRequest::bindToHotspotHelperCommand: not bound
|
||||
|
||||
## Native code has NWPathStatus in NetworkExtension and nw_path_status_t in Network (with the same elements).
|
||||
## NetworkExtension.NWPathStatus is the oldest, but NetworkExtension isn't present on all the platforms Network
|
||||
## is, which means we can't use the same managed enum for both cases (the native enums aren't entirely identical
|
||||
|
|
Загрузка…
Ссылка в новой задаче