121 references to MSBuildApp
Microsoft.Build.CommandLine.UnitTests (111)
CommandLineSwitches_Tests.cs (19)
29
MSBuildApp
.Initialize();
1188
MSBuildApp
.BuildProject(
1261
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "false", "true" });
1272
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "true", "false" });
1286
string result =
MSBuildApp
.ExtractAnyLoggerParameter("v=diag;v=q", new string[] { "v", "verbosity" });
1302
Assert.Null(
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches));
1326
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1348
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1373
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1391
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1460
ISet<string> actualWarningsAsMessages =
MSBuildApp
.ProcessWarnAsMessageSwitch(commandLineSwitches);
1483
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: true, resourceName: null).ShouldBeTrue();
1485
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: false, resourceName: null).ShouldBeFalse();
1487
MSBuildApp
.ProcessBooleanSwitch(new[] { "true" }, defaultValue: false, resourceName: null).ShouldBeTrue();
1489
MSBuildApp
.ProcessBooleanSwitch(new[] { "false" }, defaultValue: true, resourceName: null).ShouldBeFalse();
1491
Should.Throw<CommandLineSwitchException>(() =>
MSBuildApp
.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidRestoreValue"));
1530
var graphBuildOptions =
MSBuildApp
.ProcessGraphBuildSwitch(parameters);
1568
MSBuildApp
.Execute(@"msbuild.exe " + project + " /t:foo.bar").ShouldBe(
MSBuildApp
.ExitType.SwitchError);
XMake_Tests.cs (92)
570
MSBuildApp
.Execute(@$"c:\bin\msbuild.exe {indicator} ")
571
.ShouldBe(
MSBuildApp
.ExitType.Success);
664
MSBuildApp
.Execute(@"c:\bin\msbuild.exe -junk").ShouldBe(
MSBuildApp
.ExitType.SwitchError);
666
MSBuildApp
.Execute(@"msbuild.exe -t").ShouldBe(
MSBuildApp
.ExitType.SwitchError);
668
MSBuildApp
.Execute(@"msbuild.exe @bogus.rsp").ShouldBe(
MSBuildApp
.ExitType.InitializationError);
676
MSBuildApp
.ProcessVerbositySwitch("Q").ShouldBe(LoggerVerbosity.Quiet);
677
MSBuildApp
.ProcessVerbositySwitch("quiet").ShouldBe(LoggerVerbosity.Quiet);
678
MSBuildApp
.ProcessVerbositySwitch("m").ShouldBe(LoggerVerbosity.Minimal);
679
MSBuildApp
.ProcessVerbositySwitch("minimal").ShouldBe(LoggerVerbosity.Minimal);
680
MSBuildApp
.ProcessVerbositySwitch("N").ShouldBe(LoggerVerbosity.Normal);
681
MSBuildApp
.ProcessVerbositySwitch("normal").ShouldBe(LoggerVerbosity.Normal);
682
MSBuildApp
.ProcessVerbositySwitch("d").ShouldBe(LoggerVerbosity.Detailed);
683
MSBuildApp
.ProcessVerbositySwitch("detailed").ShouldBe(LoggerVerbosity.Detailed);
684
MSBuildApp
.ProcessVerbositySwitch("diag").ShouldBe(LoggerVerbosity.Diagnostic);
685
MSBuildApp
.ProcessVerbositySwitch("DIAGNOSTIC").ShouldBe(LoggerVerbosity.Diagnostic);
693
MSBuildApp
.ProcessVerbositySwitch("loquacious");
700
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1" }).ShouldBe(1);
701
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "2" }).ShouldBe(2);
702
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "3" }).ShouldBe(3);
703
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "4" }).ShouldBe(4);
704
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8" }).ShouldBe(8);
705
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "63" }).ShouldBe(63);
708
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8", "4" }).ShouldBe(4);
716
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "-1" });
725
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "0" });
734
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "foo" });
744
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1025" });
932
MSBuildApp
.SetConsoleUI();
939
MSBuildApp
.SetConsoleUI();
965
MSBuildApp
.SetConsoleUI();
999
MSBuildApp
.SetConsoleUI();
1150
MSBuildApp
.Execute(@"c:\bin\msbuild.exe " + quotedProjectFileName).ShouldBe(
MSBuildApp
.ExitType.Success);
1184
MSBuildApp
.Execute(@$"c:\bin\msbuild.exe /logger:FileLogger,""Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"";""LogFile={logFile}"" /verbosity:detailed " + quotedProjectFileName).ShouldBe(
MSBuildApp
.ExitType.Success);
1614
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe(answer, StringCompareShould.IgnoreCase);
1629
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1641
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1653
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1656
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1670
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1685
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1699
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase);
1713
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1727
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1736
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1741
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1746
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1751
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1756
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1761
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1766
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1771
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1776
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1781
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1786
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1792
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1797
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1809
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj"); // "Expected test.proj to be only project found"
1823
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1837
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1852
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1866
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1880
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1894
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1909
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1921
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1935
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1949
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2016
string actualProject =
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2040
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2064
MSBuildApp
.ProcessDistributedFileLogger(
2083
MSBuildApp
.ProcessDistributedFileLogger(
2102
MSBuildApp
.ProcessDistributedFileLogger(
2114
MSBuildApp
.ProcessDistributedFileLogger(
2125
MSBuildApp
.ProcessDistributedFileLogger(
2144
MSBuildApp
.ProcessDistributedFileLogger(
2157
MSBuildApp
.ProcessDistributedFileLogger(
2170
MSBuildApp
.ProcessDistributedFileLogger(
2183
MSBuildApp
.ProcessDistributedFileLogger(
2196
MSBuildApp
.ProcessDistributedFileLogger(
2207
MSBuildApp
.ProcessDistributedFileLogger(
2218
MSBuildApp
.ProcessDistributedFileLogger(
2236
MSBuildApp
.ProcessDistributedFileLogger(
2254
MSBuildApp
.ProcessConsoleLoggerSwitch(
2264
MSBuildApp
.ProcessConsoleLoggerSwitch(
2278
MSBuildApp
.ProcessConsoleLoggerSwitch(
2927
MSBuildApp
.Execute(@"c:\bin\msbuild.exe " + project + " / m:257 /mt").ShouldBe(
MSBuildApp
.ExitType.SwitchError);
Microsoft.Build.Engine.UnitTests (3)
Utilities_Tests.cs (3)
12
using MSBuildApp = Microsoft.Build.CommandLine.
MSBuildApp
;
83
MSBuildApp
.Execute(@"c:\bin\msbuild.exe """ + inputFile.Path +
85
.ShouldBe(
MSBuildApp
.ExitType.Success);
Microsoft.DotNet.Cli.Utils (1)
MSBuildForwardingAppWithoutLogging.cs (1)
160
return Build.CommandLine.
MSBuildApp
.Main(arguments);
MSBuild (6)
MSBuildClientApp.cs (5)
37
public static
MSBuildApp
.ExitType Execute(string commandLine, CancellationToken cancellationToken)
58
public static
MSBuildApp
.ExitType Execute(
77
return
MSBuildApp
.Execute(commandLine);
81
Enum.TryParse(exitResult.MSBuildAppExitTypeString, out
MSBuildApp
.ExitType MSBuildAppExitType))
88
return
MSBuildApp
.ExitType.MSBuildClientFailure;
XMake.cs (1)
2436
return terminalLoggerParameters?.Length > 0 ?
MSBuildApp
.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty;