Skip to content

Commit

Permalink
[tests] Remove TI.UnifiedTestConfig.DiagnosticMSBuild
Browse files Browse the repository at this point in the history
.. as we always build with diagnostic verbosity now. And remove the
parameter from `TI.BuildProject(..)`.
  • Loading branch information
radical committed May 22, 2018
1 parent 6278f10 commit b578593
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 5 additions & 7 deletions tests/common/mac/ProjectTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public class UnifiedTestConfig
// Not necessarly required
public bool FSharp { get; set; }
public bool XM45 { get; set; }
public bool DiagnosticMSBuild { get; set; }
public bool Release { get; set; } = false;

public string ProjectName { get; set; } = "";
Expand All @@ -167,7 +166,6 @@ public class UnifiedTestConfig
public UnifiedTestConfig (string tmpDir)
{
TmpDir = tmpDir;
DiagnosticMSBuild = true;
}
}

Expand Down Expand Up @@ -229,7 +227,7 @@ public static void CleanUnifiedProject (string csprojTarget)
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 release = false, string[] environment = null)
public static string BuildProject (string csprojTarget, bool isUnified, bool shouldFail = false, bool release = false, string[] environment = null)
{
string rootDirectory = FindRootDirectory ();

Expand All @@ -242,7 +240,7 @@ public static string BuildProject (string csprojTarget, bool isUnified, bool dia
// This is to force build to use our mmp and not system mmp
StringBuilder buildArgs = new StringBuilder ();
if (isUnified) {
buildArgs.Append (diagnosticMSBuild ? " /verbosity:diagnostic " : " /verbosity:normal ");
buildArgs.Append (" /verbosity:diagnostic ");
buildArgs.Append (" /property:XamarinMacFrameworkRoot=" + rootDirectory + "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current ");

if (release)
Expand Down Expand Up @@ -378,7 +376,7 @@ public static string GenerateUnifiedExecutableProject (UnifiedTestConfig config)
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, release: config.Release, environment: environment);
return BuildProject (csprojTarget, isUnified: true, shouldFail: shouldFail, release: config.Release, environment: environment);
}

public static string RunGeneratedUnifiedExecutable (UnifiedTestConfig config)
Expand Down Expand Up @@ -410,7 +408,7 @@ public static OutputText TestClassicExecutable (string tmpDir, string testCode =
{
Guid guid = Guid.NewGuid ();
string csprojTarget = GenerateClassicEXEProject (tmpDir, "ClassicExample.csproj", testCode + GenerateOutputCommand (tmpDir,guid), csprojConfig, includeMonoRuntime: includeMonoRuntime);
string buildOutput = BuildProject (csprojTarget, isUnified : false, diagnosticMSBuild: false, shouldFail : shouldFail);
string buildOutput = BuildProject (csprojTarget, isUnified : false, shouldFail : shouldFail);
if (shouldFail)
return new OutputText (buildOutput, "");

Expand All @@ -427,7 +425,7 @@ public static OutputText TestSystemMonoExecutable (UnifiedTestConfig config, boo
config.ProjectName = $"{projectName}.csproj";
string csprojTarget = GenerateSystemMonoEXEProject (config);

string buildOutput = BuildProject (csprojTarget, isUnified: true, diagnosticMSBuild: config.DiagnosticMSBuild, shouldFail: shouldFail, release: config.Release);
string buildOutput = BuildProject (csprojTarget, isUnified: true, shouldFail: shouldFail, release: config.Release);
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 @@ -355,7 +355,7 @@ public void Unified_FailedBuild_ShouldRequireAnotherBuildNotSkipMMP ()
// And try again.
// 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);
string secondBuildOutput = TI.BuildProject (Path.Combine (tmpDir, TI.GetUnifiedExecutableProjectName (test)), true);
Assert.IsTrue (!secondBuildOutput.Contains ("Skipping target \"_CompileToNative"), "Did not skip");
Assert.IsTrue (secondBuildOutput.Contains ("Building target \"_CompileToNative\" completely"), "Did need to build");
}
Expand Down
8 changes: 4 additions & 4 deletions tests/msbuild-mac/src/MSBuild-Smoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ public void BuildingSameBindingProject_TwoTimes_ShallNotInvokeMMPTwoTimes ()
{
var config = new TI.UnifiedTestConfig (tmpDir) { ProjectName = project, ItemGroup = nativeRefItemGroup };
string projectPath = TI.GenerateBindingLibraryProject (config);
string buildOutput = TI.BuildProject (projectPath, isUnified: true, diagnosticMSBuild: true);
string buildOutput = TI.BuildProject (projectPath, isUnified: true);
Assert.IsTrue (buildOutput.Contains (@"Building target ""CoreCompile"""));
string secondBuildOutput = TI.BuildProject (projectPath, isUnified: true, diagnosticMSBuild: true);
string secondBuildOutput = TI.BuildProject (projectPath, isUnified: true);
Assert.IsFalse (secondBuildOutput.Contains (@"Building target ""CoreCompile"""));
}
});
Expand All @@ -181,10 +181,10 @@ public void BuildingSameProject_TwoTimes_ShallNotInvokeMMPTwoTimes ()
{
var config = new TI.UnifiedTestConfig (tmpDir) { ProjectName = project };
string projectPath = TI.GenerateEXEProject (config);
string buildOutput = TI.BuildProject (projectPath, isUnified: true, diagnosticMSBuild: true);
string buildOutput = TI.BuildProject (projectPath, isUnified: true);
Assert.IsTrue (buildOutput.Contains (@"Building target ""_CompileToNative"""));
string secondBuildOutput = TI.BuildProject (projectPath, isUnified: true, diagnosticMSBuild: true);
string secondBuildOutput = TI.BuildProject (projectPath, isUnified: true);
Assert.IsFalse (secondBuildOutput.Contains (@"Building target ""_CompileToNative"""));
}
});
Expand Down

0 comments on commit b578593

Please sign in to comment.