public void NupkgPlatform(Platform platform) { var files = Observable.ToObservable(platform.Packages) .SelectMany(NuGetHelpers.GetNupkgAssembliesAsync) .Do(lib => TestHelpers.SaveAs(lib.Item2(), tempDirectory, lib.Item1)) .Select(lib => Path.GetFileName(lib.Item1)) .ToList() .Do(list => RepackPlatform(platform, list)) .First(); var errors = PeverifyHelper.Peverify(tempDirectory, "test.dll").Do(Console.WriteLine).ToErrorCodes().ToEnumerable(); Assert.IsFalse(errors.Contains(PeverifyHelper.VER_E_STACK_OVERFLOW)); }
void VerifyTest(IEnumerable <string> mergedLibraries) { if (XPlat.IsMono) { return; } var errors = PeverifyHelper.Peverify(tempDirectory, "test.dll").Do(Console.WriteLine).ToEnumerable(); if (errors.Any()) { var origErrors = mergedLibraries.SelectMany(it => PeverifyHelper.Peverify(tempDirectory, it).ToEnumerable()); if (errors.Count() != origErrors.Count()) { Assert.Fail($"{errors.Count()} errors in peverify, check logs for details"); } } }
void VerifyTest(string assemblyName) { if (XPlat.IsMono) { return; } var errors = PeverifyHelper.Peverify(tempDirectory, "test.dll").Do(Console.WriteLine).ToEnumerable(); if (errors.Any()) { var origErrors = PeverifyHelper.Peverify(tempDirectory, "foo.dll").ToEnumerable(); if (errors.Count() != origErrors.Count()) { Assert.Fail($"{errors.Count()} errors in peverify, check logs for details"); } } }
public void VerifiesMergedSignedAssemblyHasNoUnsignedFriend() { var platform = Platform.From( Package.From("reactiveui-core", "6.5.0") .WithArtifact(@"lib\net45\ReactiveUI.dll"), Package.From("Splat", "1.6.2") .WithArtifact(@"lib\net45\Splat.dll")) .WithExtraArgs("/keyfile:../../../ILRepack/ILRepack.snk"); platform.Packages.ToObservable() .SelectMany(NuGetHelpers.GetNupkgAssembliesAsync) .Do(lib => TestHelpers.SaveAs(lib.Item2(), tempDirectory, lib.Item1)) .Select(lib => Path.GetFileName(lib.Item1)) .ToList() .Do(list => RepackPlatform(platform, list)) .Wait(); var errors = PeverifyHelper.Peverify(tempDirectory, "test.dll").Do(Console.WriteLine).ToErrorCodes().ToEnumerable(); Assert.IsFalse(errors.Contains(PeverifyHelper.META_E_CA_FRIENDS_SN_REQUIRED)); }
public void VerifiesMergesBclFine() { var platform = Platform.From( Package.From("Microsoft.Bcl", "1.1.10") .WithArtifact(@"lib\net40\System.Runtime.dll"), Package.From("Microsoft.Bcl", "1.1.10") .WithArtifact(@"lib\net40\System.Threading.Tasks.dll"), Package.From("Microsoft.Bcl.Async", "1.0.168") .WithArtifact(@"lib\net40\Microsoft.Threading.Tasks.dll")) .WithExtraArgs(@"/targetplatform:v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"); platform.Packages.ToObservable() .SelectMany(NuGetHelpers.GetNupkgAssembliesAsync) .Do(lib => TestHelpers.SaveAs(lib.Item2(), tempDirectory, lib.Item1)) .Select(lib => Path.GetFileName(lib.Item1)) .ToList() .Do(list => RepackPlatform(platform, list)) .First(); var errors = PeverifyHelper.Peverify(tempDirectory, "test.dll").Do(Console.WriteLine).ToErrorCodes().ToEnumerable(); Assert.IsFalse(errors.Contains(PeverifyHelper.VER_E_TOKEN_RESOLVE)); Assert.IsFalse(errors.Contains(PeverifyHelper.VER_E_TYPELOAD)); }