Skip to content

Commit

Permalink
[tests] Remove bool useMSBuild arg from ProjectTestHelpers
Browse files Browse the repository at this point in the history
.. as we always use msbuild now.
  • Loading branch information
radical committed May 22, 2018
1 parent 8f0df14 commit 6278f10
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions tests/common/mac/ProjectTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ public static string RunAndAssert (string exe, StringBuilder args, string stepNa
}

// 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 ();

Expand Down Expand Up @@ -375,10 +375,10 @@ public static string GenerateUnifiedExecutableProject (UnifiedTestConfig config)
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)
Expand All @@ -388,7 +388,7 @@ public static string RunGeneratedUnifiedExecutable (UnifiedTestConfig config)
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)
Expand All @@ -397,7 +397,7 @@ public static OutputText TestUnifiedExecutable (UnifiedTestConfig config, bool s
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, "");

Expand Down
2 changes: 1 addition & 1 deletion tests/mmptest/src/MMPTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public void Unified_FailedBuild_ShouldRequireAnotherBuildNotSkipMMP ()
// 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");
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions tests/mmptest/src/NetStandardTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void NetStandardTestCore (string tmpDir, bool full)

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>
Expand All @@ -49,7 +49,7 @@ static void NetStandardTestCore (string tmpDir, bool full)
config.CSProjConfig = "<MonoBundlingExtraArgs>--registrar=dynamic</MonoBundlingExtraArgs>";
config.XM45 = full;

TI.TestUnifiedExecutable(config, useMSBuild: true);
TI.TestUnifiedExecutable(config);
}
}
}
4 changes: 2 additions & 2 deletions tests/msbuild-mac/src/RoslynSmokeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void XMModernRosylnProjet_ShouldBuildAndRunWithMSBuild ()

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");
}

Expand All @@ -37,7 +37,7 @@ public void XMFullRosylnProjet_ShouldBuildAndRunWithMSBuild ()

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");
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/msbuild-mac/src/RuntimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void AssemblyRegistration ()
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");
}
}
Expand Down

0 comments on commit 6278f10

Please sign in to comment.