public void DoesNotSupportLinkWith(BindingProjectType type) { MMPTests.RunMMPTest(tmpDir => { var projects = BindingProjectTests.GenerateTestProject(type, tmpDir); BindingProjectTests.SetNoEmbedding(projects.Item1); projects.Item1.LinkWithName = "SimpleClassDylib.dylib"; string libBuildLog = BindingProjectTests.SetupAndBuildBindingProject(projects.Item1, false, shouldFail: true); Assert.True(libBuildLog.Contains("Can't create a binding resource package unless there are native references in the binding project."), $"Did not fail as expected: {TI.PrintRedirectIfLong (libBuildLog)}"); }); }
public void ShouldNotMutateWithoutOptInFlag(bool xm45) { MMPTests.RunMMPTest(tmpDir => { TI.UnifiedTestConfig test = new TI.UnifiedTestConfig(tmpDir) { XM45 = xm45 }; var buildOutput = TI.TestUnifiedExecutable(test).BuildOutput; string standardTFI = xm45 ? ".NETFramework" : "Xamarin.Mac"; Assert.True(MatchesTFI(standardTFI, buildOutput), $"Build did not have expected TFI: {TI.PrintRedirectIfLong (buildOutput)}"); }); }
void RestoreRoslynNuget(string projectPath) { TI.RunAndAssert("/Library/Frameworks/Mono.framework/Versions/Current/Commands/nuget", new [] { "restore", projectPath }, "Restore Nuget"); }
public void PlatformSDKOnClassic_ShouldNotBeSupported() { MMPTests.RunMMPTest(tmpDir => { TI.TestClassicExecutable(tmpDir, csprojConfig: "<MonoBundlingExtraArgs>--linkplatform</MonoBundlingExtraArgs>\n", includeMonoRuntime: true, shouldFail: true); }); }
string GetBaseAssemblyPath(string name, bool modern) => Path.Combine(TI.FindRootDirectory(), "Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/" + GetFrameworkName(modern) + "/", name + ".dll");
static void MonoPosixTestCore(string tmpDir, TI.UnifiedTestConfig test) { TI.TestUnifiedExecutable(test, shouldFail: false); Assert.IsTrue(File.Exists(Path.Combine(tmpDir, "bin/Debug/XM45Example.app/Contents/MonoBundle/libMonoPosixHelper.dylib")), String.Format("Does {0}/bin/Debug/XM45Example.app/Contents/MonoBundle/libMonoPosixHelper.dylib to exist?", tmpDir)); }
void RestoreRoslynNuget(string projectType) { StringBuilder nugetArgs = new StringBuilder("restore " + Path.Combine(RoslynTestProjectRoot + projectType + "/") + "packages.config"); TI.RunAndAssert(nugetPath, nugetArgs, "Restore Nuget"); }