146 references to MSBuildApp
Microsoft.Build.CommandLine.UnitTests (134)
CommandLineSwitches_Tests.cs (24)
30
MSBuildApp
.Initialize();
1190
MSBuildApp
.BuildProject(
1262
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "false", "true" });
1273
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"));
1520
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: true, resourceName: "InvalidNoLogoValue").ShouldBeTrue();
1521
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: false, resourceName: "InvalidNoLogoValue").ShouldBeFalse();
1524
MSBuildApp
.ProcessBooleanSwitch(new[] { "true" }, defaultValue: false, resourceName: "InvalidNoLogoValue").ShouldBeTrue();
1525
MSBuildApp
.ProcessBooleanSwitch(new[] { "false" }, defaultValue: true, resourceName: "InvalidNoLogoValue").ShouldBeFalse();
1528
Should.Throw<CommandLineSwitchException>(() =>
MSBuildApp
.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidNoLogoValue"));
1567
var graphBuildOptions =
MSBuildApp
.ProcessGraphBuildSwitch(parameters);
1605
MSBuildApp
.Execute([@"msbuild.exe", project, "/t:foo.bar"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
XMake_Tests.cs (110)
547
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", indicator])
548
.ShouldBe(
MSBuildApp
.ExitType.Success);
633
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", "-junk"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
634
MSBuildApp
.Execute([@"msbuild.exe", "-t"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
635
MSBuildApp
.Execute([@"msbuild.exe", "@bogus.rsp"]).ShouldBe(
MSBuildApp
.ExitType.InitializationError);
643
MSBuildApp
.ProcessVerbositySwitch("Q").ShouldBe(LoggerVerbosity.Quiet);
644
MSBuildApp
.ProcessVerbositySwitch("quiet").ShouldBe(LoggerVerbosity.Quiet);
645
MSBuildApp
.ProcessVerbositySwitch("m").ShouldBe(LoggerVerbosity.Minimal);
646
MSBuildApp
.ProcessVerbositySwitch("minimal").ShouldBe(LoggerVerbosity.Minimal);
647
MSBuildApp
.ProcessVerbositySwitch("N").ShouldBe(LoggerVerbosity.Normal);
648
MSBuildApp
.ProcessVerbositySwitch("normal").ShouldBe(LoggerVerbosity.Normal);
649
MSBuildApp
.ProcessVerbositySwitch("d").ShouldBe(LoggerVerbosity.Detailed);
650
MSBuildApp
.ProcessVerbositySwitch("detailed").ShouldBe(LoggerVerbosity.Detailed);
651
MSBuildApp
.ProcessVerbositySwitch("diag").ShouldBe(LoggerVerbosity.Diagnostic);
652
MSBuildApp
.ProcessVerbositySwitch("DIAGNOSTIC").ShouldBe(LoggerVerbosity.Diagnostic);
660
MSBuildApp
.ProcessVerbositySwitch("loquacious");
667
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1" }).ShouldBe(1);
668
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "2" }).ShouldBe(2);
669
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "3" }).ShouldBe(3);
670
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "4" }).ShouldBe(4);
671
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8" }).ShouldBe(8);
672
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "63" }).ShouldBe(63);
675
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8", "4" }).ShouldBe(4);
683
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "-1" });
692
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "0" });
701
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "foo" });
708
MSBuildApp
.ParseNodeMode("1").ShouldBe(NodeMode.OutOfProcNode);
709
MSBuildApp
.ParseNodeMode("2").ShouldBe(NodeMode.OutOfProcTaskHostNode);
710
MSBuildApp
.ParseNodeMode("3").ShouldBe(NodeMode.OutOfProcRarNode);
711
MSBuildApp
.ParseNodeMode("8").ShouldBe(NodeMode.OutOfProcServerNode);
717
MSBuildApp
.ParseNodeMode("OutOfProcNode").ShouldBe(NodeMode.OutOfProcNode);
718
MSBuildApp
.ParseNodeMode("outofprocnode").ShouldBe(NodeMode.OutOfProcNode);
719
MSBuildApp
.ParseNodeMode("OUTOFPROCNODE").ShouldBe(NodeMode.OutOfProcNode);
720
MSBuildApp
.ParseNodeMode("OutOfProcTaskHostNode").ShouldBe(NodeMode.OutOfProcTaskHostNode);
721
MSBuildApp
.ParseNodeMode("outofproctaskhostnode").ShouldBe(NodeMode.OutOfProcTaskHostNode);
722
MSBuildApp
.ParseNodeMode("OutOfProcRarNode").ShouldBe(NodeMode.OutOfProcRarNode);
723
MSBuildApp
.ParseNodeMode("outofprocrarnode").ShouldBe(NodeMode.OutOfProcRarNode);
724
MSBuildApp
.ParseNodeMode("OutOfProcServerNode").ShouldBe(NodeMode.OutOfProcServerNode);
725
MSBuildApp
.ParseNodeMode("outofprocservernode").ShouldBe(NodeMode.OutOfProcServerNode);
733
MSBuildApp
.ParseNodeMode("4");
742
MSBuildApp
.ParseNodeMode("-1");
751
MSBuildApp
.ParseNodeMode("InvalidMode");
760
MSBuildApp
.ParseNodeMode("");
770
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1025" });
990
MSBuildApp
.SetConsoleUI();
997
MSBuildApp
.SetConsoleUI();
1023
MSBuildApp
.SetConsoleUI();
1057
MSBuildApp
.SetConsoleUI();
1208
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", quotedProjectFileName]).ShouldBe(
MSBuildApp
.ExitType.Success);
1242
MSBuildApp
1248
.ShouldBe(
MSBuildApp
.ExitType.Success);
1678
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe(answer, StringCompareShould.IgnoreCase);
1693
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1705
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1717
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1720
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1734
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1749
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1763
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase);
1777
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1791
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1800
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1805
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1810
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1815
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1820
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1825
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1830
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1835
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1840
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1845
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1850
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1856
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1861
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1873
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj"); // "Expected test.proj to be only project found"
1887
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1901
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1916
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1930
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1944
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1958
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1973
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1985
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1999
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2013
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2080
string actualProject =
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2104
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2128
MSBuildApp
.ProcessDistributedFileLogger(
2147
MSBuildApp
.ProcessDistributedFileLogger(
2166
MSBuildApp
.ProcessDistributedFileLogger(
2178
MSBuildApp
.ProcessDistributedFileLogger(
2189
MSBuildApp
.ProcessDistributedFileLogger(
2208
MSBuildApp
.ProcessDistributedFileLogger(
2221
MSBuildApp
.ProcessDistributedFileLogger(
2234
MSBuildApp
.ProcessDistributedFileLogger(
2247
MSBuildApp
.ProcessDistributedFileLogger(
2260
MSBuildApp
.ProcessDistributedFileLogger(
2271
MSBuildApp
.ProcessDistributedFileLogger(
2282
MSBuildApp
.ProcessDistributedFileLogger(
2300
MSBuildApp
.ProcessDistributedFileLogger(
2321
MSBuildApp
.ProcessDistributedFileLogger(
2356
MSBuildApp
.ProcessConsoleLoggerSwitch(
2366
MSBuildApp
.ProcessConsoleLoggerSwitch(
2380
MSBuildApp
.ProcessConsoleLoggerSwitch(
3139
MSBuildApp
.Execute([@"c:\bin\msbuild.exe", project, "/m:257 /mt"]).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
Microsoft.Build.Engine.UnitTests (3)
Utilities_Tests.cs (3)
11
using MSBuildApp = Microsoft.Build.CommandLine.
MSBuildApp
;
83
MSBuildApp
.ExitType.Success,
84
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;