146 references to MSBuildApp
Microsoft.Build.CommandLine.UnitTests (134)
CommandLineSwitches_Tests.cs (24)
30
MSBuildApp
.Initialize();
1189
MSBuildApp
.BuildProject(
1261
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "false", "true" });
1272
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "true", "false" });
1285
string result =
MSBuildApp
.ExtractAnyLoggerParameter("v=diag;v=q", new string[] { "v", "verbosity" });
1301
Assert.Null(
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches));
1325
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1347
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1372
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1390
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1459
ISet<string> actualWarningsAsMessages =
MSBuildApp
.ProcessWarnAsMessageSwitch(commandLineSwitches);
1482
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: true, resourceName: null).ShouldBeTrue();
1484
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: false, resourceName: null).ShouldBeFalse();
1486
MSBuildApp
.ProcessBooleanSwitch(new[] { "true" }, defaultValue: false, resourceName: null).ShouldBeTrue();
1488
MSBuildApp
.ProcessBooleanSwitch(new[] { "false" }, defaultValue: true, resourceName: null).ShouldBeFalse();
1490
Should.Throw<CommandLineSwitchException>(() =>
MSBuildApp
.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidRestoreValue"));
1519
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: true, resourceName: "InvalidNoLogoValue").ShouldBeTrue();
1520
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: false, resourceName: "InvalidNoLogoValue").ShouldBeFalse();
1523
MSBuildApp
.ProcessBooleanSwitch(new[] { "true" }, defaultValue: false, resourceName: "InvalidNoLogoValue").ShouldBeTrue();
1524
MSBuildApp
.ProcessBooleanSwitch(new[] { "false" }, defaultValue: true, resourceName: "InvalidNoLogoValue").ShouldBeFalse();
1527
Should.Throw<CommandLineSwitchException>(() =>
MSBuildApp
.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidNoLogoValue"));
1566
var graphBuildOptions =
MSBuildApp
.ProcessGraphBuildSwitch(parameters);
1604
MSBuildApp
.Execute([@"msbuild.exe", project, "/t:foo.bar"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
XMake_Tests.cs (110)
549
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", indicator])
550
.ShouldBe(
MSBuildApp
.ExitType.Success);
635
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", "-junk"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
636
MSBuildApp
.Execute([@"msbuild.exe", "-t"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
637
MSBuildApp
.Execute([@"msbuild.exe", "@bogus.rsp"]).ShouldBe(
MSBuildApp
.ExitType.InitializationError);
645
MSBuildApp
.ProcessVerbositySwitch("Q").ShouldBe(LoggerVerbosity.Quiet);
646
MSBuildApp
.ProcessVerbositySwitch("quiet").ShouldBe(LoggerVerbosity.Quiet);
647
MSBuildApp
.ProcessVerbositySwitch("m").ShouldBe(LoggerVerbosity.Minimal);
648
MSBuildApp
.ProcessVerbositySwitch("minimal").ShouldBe(LoggerVerbosity.Minimal);
649
MSBuildApp
.ProcessVerbositySwitch("N").ShouldBe(LoggerVerbosity.Normal);
650
MSBuildApp
.ProcessVerbositySwitch("normal").ShouldBe(LoggerVerbosity.Normal);
651
MSBuildApp
.ProcessVerbositySwitch("d").ShouldBe(LoggerVerbosity.Detailed);
652
MSBuildApp
.ProcessVerbositySwitch("detailed").ShouldBe(LoggerVerbosity.Detailed);
653
MSBuildApp
.ProcessVerbositySwitch("diag").ShouldBe(LoggerVerbosity.Diagnostic);
654
MSBuildApp
.ProcessVerbositySwitch("DIAGNOSTIC").ShouldBe(LoggerVerbosity.Diagnostic);
662
MSBuildApp
.ProcessVerbositySwitch("loquacious");
669
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1" }).ShouldBe(1);
670
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "2" }).ShouldBe(2);
671
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "3" }).ShouldBe(3);
672
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "4" }).ShouldBe(4);
673
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8" }).ShouldBe(8);
674
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "63" }).ShouldBe(63);
677
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8", "4" }).ShouldBe(4);
685
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "-1" });
694
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "0" });
703
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "foo" });
710
MSBuildApp
.ParseNodeMode("1").ShouldBe(NodeMode.OutOfProcNode);
711
MSBuildApp
.ParseNodeMode("2").ShouldBe(NodeMode.OutOfProcTaskHostNode);
712
MSBuildApp
.ParseNodeMode("3").ShouldBe(NodeMode.OutOfProcRarNode);
713
MSBuildApp
.ParseNodeMode("8").ShouldBe(NodeMode.OutOfProcServerNode);
719
MSBuildApp
.ParseNodeMode("OutOfProcNode").ShouldBe(NodeMode.OutOfProcNode);
720
MSBuildApp
.ParseNodeMode("outofprocnode").ShouldBe(NodeMode.OutOfProcNode);
721
MSBuildApp
.ParseNodeMode("OUTOFPROCNODE").ShouldBe(NodeMode.OutOfProcNode);
722
MSBuildApp
.ParseNodeMode("OutOfProcTaskHostNode").ShouldBe(NodeMode.OutOfProcTaskHostNode);
723
MSBuildApp
.ParseNodeMode("outofproctaskhostnode").ShouldBe(NodeMode.OutOfProcTaskHostNode);
724
MSBuildApp
.ParseNodeMode("OutOfProcRarNode").ShouldBe(NodeMode.OutOfProcRarNode);
725
MSBuildApp
.ParseNodeMode("outofprocrarnode").ShouldBe(NodeMode.OutOfProcRarNode);
726
MSBuildApp
.ParseNodeMode("OutOfProcServerNode").ShouldBe(NodeMode.OutOfProcServerNode);
727
MSBuildApp
.ParseNodeMode("outofprocservernode").ShouldBe(NodeMode.OutOfProcServerNode);
735
MSBuildApp
.ParseNodeMode("4");
744
MSBuildApp
.ParseNodeMode("-1");
753
MSBuildApp
.ParseNodeMode("InvalidMode");
762
MSBuildApp
.ParseNodeMode("");
772
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1025" });
992
MSBuildApp
.SetConsoleUI();
999
MSBuildApp
.SetConsoleUI();
1025
MSBuildApp
.SetConsoleUI();
1059
MSBuildApp
.SetConsoleUI();
1210
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", quotedProjectFileName]).ShouldBe(
MSBuildApp
.ExitType.Success);
1244
MSBuildApp
1250
.ShouldBe(
MSBuildApp
.ExitType.Success);
1680
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe(answer, StringCompareShould.IgnoreCase);
1695
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1707
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1719
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1722
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1736
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1751
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1765
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase);
1779
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1793
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1802
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1807
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1812
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1817
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1822
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1827
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1832
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1837
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1842
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1847
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1852
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1858
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1863
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1875
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj"); // "Expected test.proj to be only project found"
1889
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1903
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1918
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1932
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1946
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1960
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1975
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1987
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2001
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2015
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2082
string actualProject =
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2106
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2130
MSBuildApp
.ProcessDistributedFileLogger(
2149
MSBuildApp
.ProcessDistributedFileLogger(
2168
MSBuildApp
.ProcessDistributedFileLogger(
2180
MSBuildApp
.ProcessDistributedFileLogger(
2191
MSBuildApp
.ProcessDistributedFileLogger(
2210
MSBuildApp
.ProcessDistributedFileLogger(
2223
MSBuildApp
.ProcessDistributedFileLogger(
2236
MSBuildApp
.ProcessDistributedFileLogger(
2249
MSBuildApp
.ProcessDistributedFileLogger(
2262
MSBuildApp
.ProcessDistributedFileLogger(
2273
MSBuildApp
.ProcessDistributedFileLogger(
2284
MSBuildApp
.ProcessDistributedFileLogger(
2302
MSBuildApp
.ProcessDistributedFileLogger(
2323
MSBuildApp
.ProcessDistributedFileLogger(
2358
MSBuildApp
.ProcessConsoleLoggerSwitch(
2368
MSBuildApp
.ProcessConsoleLoggerSwitch(
2382
MSBuildApp
.ProcessConsoleLoggerSwitch(
3141
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
;
84
MSBuildApp
.ExitType.Success,
85
MSBuildApp
.Execute([ @"c:\bin\msbuild.exe", '"' + inputFile.Path + '"', '"' + (NativeMethodsShared.IsUnixLike ? "-pp:" : "/pp:") + outputFile.Path + '"']));
MSBuild (9)
CommandLine\CommandLineParser.cs (2)
120
string exePath = Path.GetDirectoryName(typeof(
MSBuildApp
).GetAssemblyPath()); // Copied from XMake
535
string exePath = Path.GetDirectoryName(typeof(
MSBuildApp
).GetAssemblyPath()); // Copied from XMake
MSBuildClientApp.cs (5)
37
public static
MSBuildApp
.ExitType Execute(string[] commandLineArgs, CancellationToken cancellationToken)
58
public static
MSBuildApp
.ExitType Execute(string[] commandLineArgs, string msbuildLocation, CancellationToken cancellationToken)
74
return
MSBuildApp
.Execute(commandLineArgs);
78
Enum.TryParse(exitResult.MSBuildAppExitTypeString, out
MSBuildApp
.ExitType MSBuildAppExitType))
85
return
MSBuildApp
.ExitType.MSBuildClientFailure;
XMake.cs (2)
163
s_exePath = Path.GetDirectoryName(typeof(
MSBuildApp
).GetAssemblyPath());
2545
return terminalLoggerParameters?.Length > 0 ?
MSBuildApp
.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty;