[tests] Remove `bool useMSBuild` arg from ProjectTestHelpers
.. as we always use msbuild now.
This commit is contained in:
Родитель
8f0df143a1
Коммит
6278f108cf
|
@ -224,12 +224,12 @@ namespace Xamarin.MMP.Tests
|
|||
}
|
||||
|
||||
// In most cases we generate projects in tmp and this is not needed. But nuget and test projects can make that hard
|
||||
public static void CleanUnifiedProject (string csprojTarget, bool useMSBuild = false)
|
||||
public static void CleanUnifiedProject (string csprojTarget)
|
||||
{
|
||||
RunAndAssert ("/Library/Frameworks/Mono.framework/Commands/" + (useMSBuild ? "msbuild" : "msbuild"), new StringBuilder (csprojTarget + " /t:clean"), "Clean");
|
||||
RunAndAssert ("/Library/Frameworks/Mono.framework/Commands/msbuild", new StringBuilder (csprojTarget + " /t:clean"), "Clean");
|
||||
}
|
||||
|
||||
public static string BuildProject (string csprojTarget, bool isUnified, bool diagnosticMSBuild = false, bool shouldFail = false, bool useMSBuild = false, bool release = false, string[] environment = null)
|
||||
public static string BuildProject (string csprojTarget, bool isUnified, bool diagnosticMSBuild = false, bool shouldFail = false, bool release = false, string[] environment = null)
|
||||
{
|
||||
string rootDirectory = FindRootDirectory ();
|
||||
|
||||
|
@ -375,10 +375,10 @@ namespace Xamarin.MMP.Tests
|
|||
return GenerateEXEProject (config);
|
||||
}
|
||||
|
||||
public static string GenerateAndBuildUnifiedExecutable (UnifiedTestConfig config, bool shouldFail = false, bool useMSBuild = false, string[] environment = null)
|
||||
public static string GenerateAndBuildUnifiedExecutable (UnifiedTestConfig config, bool shouldFail = false, string[] environment = null)
|
||||
{
|
||||
string csprojTarget = GenerateUnifiedExecutableProject (config);
|
||||
return BuildProject (csprojTarget, isUnified: true, diagnosticMSBuild: config.DiagnosticMSBuild, shouldFail: shouldFail, useMSBuild: useMSBuild, release: config.Release, environment: environment);
|
||||
return BuildProject (csprojTarget, isUnified: true, diagnosticMSBuild: config.DiagnosticMSBuild, shouldFail: shouldFail, release: config.Release, environment: environment);
|
||||
}
|
||||
|
||||
public static string RunGeneratedUnifiedExecutable (UnifiedTestConfig config)
|
||||
|
@ -388,7 +388,7 @@ namespace Xamarin.MMP.Tests
|
|||
return RunEXEAndVerifyGUID (config.TmpDir, config.guid, exePath);
|
||||
}
|
||||
|
||||
public static OutputText TestUnifiedExecutable (UnifiedTestConfig config, bool shouldFail = false, bool useMSBuild = false, string[] environment = null)
|
||||
public static OutputText TestUnifiedExecutable (UnifiedTestConfig config, bool shouldFail = false, string[] environment = null)
|
||||
{
|
||||
// If we've already generated guid bits for this config, don't tack on a second copy
|
||||
if (config.guid == Guid.Empty)
|
||||
|
@ -397,7 +397,7 @@ namespace Xamarin.MMP.Tests
|
|||
config.TestCode += GenerateOutputCommand (config.TmpDir, config.guid);
|
||||
}
|
||||
|
||||
string buildOutput = GenerateAndBuildUnifiedExecutable (config, shouldFail, useMSBuild, environment);
|
||||
string buildOutput = GenerateAndBuildUnifiedExecutable (config, shouldFail, environment);
|
||||
if (shouldFail)
|
||||
return new OutputText (buildOutput, "");
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ namespace Xamarin.MMP.Tests
|
|||
// If we fail, we'll likley fail with "did not generate an exe" before returning but let's check anyway
|
||||
string secondBuildOutput = TI.BuildProject (Path.Combine (tmpDir, TI.GetUnifiedExecutableProjectName (test)), true, diagnosticMSBuild: true);
|
||||
Assert.IsTrue (!secondBuildOutput.Contains ("Skipping target \"_CompileToNative"), "Did not skip");
|
||||
Assert.IsTrue (secondBuildOutput.Contains ("CompileToNative needs to be built as output file"), "Did need to build");
|
||||
Assert.IsTrue (secondBuildOutput.Contains ("Building target \"_CompileToNative\" completely"), "Did need to build");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Xamarin.MMP.Tests {
|
|||
|
||||
string netStandardProject = TI.GenerateNetStandardProject (config);
|
||||
TI.RunAndAssert("/usr/local/share/dotnet/dotnet", $"restore {netStandardProject}", "Restore");
|
||||
TI.BuildProject(netStandardProject, true, useMSBuild: true);
|
||||
TI.BuildProject(netStandardProject, true);
|
||||
|
||||
config.ItemGroup = $@"
|
||||
<ItemGroup>
|
||||
|
@ -49,7 +49,7 @@ namespace Xamarin.MMP.Tests {
|
|||
config.CSProjConfig = "<MonoBundlingExtraArgs>--registrar=dynamic</MonoBundlingExtraArgs>";
|
||||
config.XM45 = full;
|
||||
|
||||
TI.TestUnifiedExecutable(config, useMSBuild: true);
|
||||
TI.TestUnifiedExecutable(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Xamarin.MMP.Tests
|
|||
|
||||
TI.CleanUnifiedProject (projectPath);
|
||||
RestoreRoslynNuget ("Modern");
|
||||
TI.BuildProject (projectPath, true, useMSBuild: true);
|
||||
TI.BuildProject (projectPath, true);
|
||||
TI.RunAndAssert (Path.Combine (RoslynTestProjectRoot, "Modern/bin/Debug/RoslynTestApp.app/Contents/MacOS/RoslynTestApp"), new StringBuilder (), "Run");
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace Xamarin.MMP.Tests
|
|||
|
||||
TI.CleanUnifiedProject (projectPath);
|
||||
RestoreRoslynNuget ("Full");
|
||||
TI.BuildProject (projectPath, true, useMSBuild: true);
|
||||
TI.BuildProject (projectPath, true);
|
||||
TI.RunAndAssert (Path.Combine (RoslynTestProjectRoot, "Full/bin/Debug/RoslynTestApp.app/Contents/MacOS/RoslynTestApp"), new StringBuilder (), "Run");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Xamarin.MMP.Tests
|
|||
var projectPath = Path.Combine (TestProjectRoot, projectName, $"{projectName}.csproj");
|
||||
|
||||
TI.CleanUnifiedProject (projectPath);
|
||||
TI.BuildProject (projectPath, true, useMSBuild: false);
|
||||
TI.BuildProject (projectPath, true);
|
||||
TI.RunAndAssert (Path.Combine (Path.GetDirectoryName (projectPath), $"bin/Debug/{projectName}.app/Contents/MacOS/{projectName}"), new StringBuilder (), "Run");
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче