162 references to MSBuildApp
Microsoft.Build.CommandLine.UnitTests (152)
CommandLineSwitches_Tests.cs (36)
29
MSBuildApp
.Initialize();
625
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "/targets:targets.txt" }, switches);
635
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "/targets /targets" }, switches);
713
MSBuildApp
.GatherCommandLineSwitches(new List<string> { "/graph", "/graph:true; NoBuild ;; ;", "/graph:foo" }, switches);
725
MSBuildApp
.GatherCommandLineSwitches(new List<string> { "/graph" }, switches);
737
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "/irc", "/irc:a;b", "/irc:c;d" }, switches);
749
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "/orc:a" }, switches);
761
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "/orc:a", "/orc:b" }, switches);
1181
MSBuildApp
.BuildProject(
1254
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "false", "true" });
1265
bool nodeReuse =
MSBuildApp
.ProcessNodeReuseSwitch(new string[] { "true", "false" });
1279
string result =
MSBuildApp
.ExtractAnyLoggerParameter("v=diag;v=q", new string[] { "v", "verbosity" });
1292
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[] { "" }), commandLineSwitches);
1294
Assert.Null(
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches));
1307
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[]
1317
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1332
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[]
1338
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1355
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[]
1362
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1377
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[] { "/warnaserror" }), commandLineSwitches);
1379
ISet<string> actualWarningsAsErrors =
MSBuildApp
.ProcessWarnAsErrorSwitch(commandLineSwitches);
1396
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[] { "/warnasmessage" }), commandLineSwitches, command);
1414
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "validProject.csproj", "%ENVIRONMENTVARIABLE%" }, commandLineSwitches, fullCommandLine);
1419
MSBuildApp
.GatherCommandLineSwitches(new List<string>() { "%ENVIRONMENTVARIABLE%", "validProject.csproj" }, commandLineSwitches, fullCommandLine);
1434
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[]
1444
ISet<string> actualWarningsAsMessages =
MSBuildApp
.ProcessWarnAsMessageSwitch(commandLineSwitches);
1459
MSBuildApp
.GatherCommandLineSwitches(new List<string>(new[] { "/profileevaluation" }), commandLineSwitches);
1466
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: true, resourceName: null).ShouldBeTrue();
1468
MSBuildApp
.ProcessBooleanSwitch(Array.Empty<string>(), defaultValue: false, resourceName: null).ShouldBeFalse();
1470
MSBuildApp
.ProcessBooleanSwitch(new[] { "true" }, defaultValue: false, resourceName: null).ShouldBeTrue();
1472
MSBuildApp
.ProcessBooleanSwitch(new[] { "false" }, defaultValue: true, resourceName: null).ShouldBeFalse();
1474
Should.Throw<CommandLineSwitchException>(() =>
MSBuildApp
.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidRestoreValue"));
1513
var graphBuildOptions =
MSBuildApp
.ProcessGraphBuildSwitch(parameters);
1554
MSBuildApp
.Execute(new[] { @"msbuild.exe", project, "/t:foo.bar" }).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
XMake_Tests.cs (116)
103
MSBuildApp
.GatherCommandLineSwitches(arguments, switches);
120
MSBuildApp
.GatherCommandLineSwitches(arguments, switches);
135
MSBuildApp
.GatherCommandLineSwitches(arguments, switches);
152
MSBuildApp
.GatherCommandLineSwitches(arguments, switches);
172
MSBuildApp
.GatherCommandLineSwitches(arguments, switches);
462
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":\"foo=\"bar");
467
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":foo=bar");
472
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":foo=bar");
477
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":foo=bar\"");
484
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "/p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":foo=bar\"");
489
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "property", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":foo=bar");
494
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "property", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":foo=bar");
499
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":\"foo foo\"=\"bar bar\";\"baz=onga\"");
508
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":\"foo=\"bar");
513
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":foo=bar");
518
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":foo=bar");
523
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":foo=bar\"");
528
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "property", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":foo=bar");
533
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "property", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":foo=bar");
538
MSBuildApp
.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":\"foo foo\"=\"bar bar\";\"baz=onga\"");
551
MSBuildApp
.GetLengthOfSwitchIndicator(commandLineSwitchWithSlash).ShouldBe(1);
552
MSBuildApp
.GetLengthOfSwitchIndicator(commandLineSwitchWithSingleDash).ShouldBe(1);
553
MSBuildApp
.GetLengthOfSwitchIndicator(commandLineSwitchWithDoubleDash).ShouldBe(2);
555
MSBuildApp
.GetLengthOfSwitchIndicator(commandLineSwitchWithNoneOrIncorrectIndicator).ShouldBe(0);
565
MSBuildApp
.Execute(
571
.ShouldBe(
MSBuildApp
.ExitType.Success);
670
MSBuildApp
.Execute(new[] { @"c:\bin\msbuild.exe", "-junk" }).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
672
MSBuildApp
.Execute(new[] { @"msbuild.exe", "-t" }).ShouldBe(
MSBuildApp
.ExitType.SwitchError);
674
MSBuildApp
.Execute(new[] { @"msbuild.exe", "@bogus.rsp" }).ShouldBe(
MSBuildApp
.ExitType.InitializationError);
682
MSBuildApp
.ProcessVerbositySwitch("Q").ShouldBe(LoggerVerbosity.Quiet);
683
MSBuildApp
.ProcessVerbositySwitch("quiet").ShouldBe(LoggerVerbosity.Quiet);
684
MSBuildApp
.ProcessVerbositySwitch("m").ShouldBe(LoggerVerbosity.Minimal);
685
MSBuildApp
.ProcessVerbositySwitch("minimal").ShouldBe(LoggerVerbosity.Minimal);
686
MSBuildApp
.ProcessVerbositySwitch("N").ShouldBe(LoggerVerbosity.Normal);
687
MSBuildApp
.ProcessVerbositySwitch("normal").ShouldBe(LoggerVerbosity.Normal);
688
MSBuildApp
.ProcessVerbositySwitch("d").ShouldBe(LoggerVerbosity.Detailed);
689
MSBuildApp
.ProcessVerbositySwitch("detailed").ShouldBe(LoggerVerbosity.Detailed);
690
MSBuildApp
.ProcessVerbositySwitch("diag").ShouldBe(LoggerVerbosity.Diagnostic);
691
MSBuildApp
.ProcessVerbositySwitch("DIAGNOSTIC").ShouldBe(LoggerVerbosity.Diagnostic);
699
MSBuildApp
.ProcessVerbositySwitch("loquacious");
706
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1" }).ShouldBe(1);
707
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "2" }).ShouldBe(2);
708
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "3" }).ShouldBe(3);
709
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "4" }).ShouldBe(4);
710
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8" }).ShouldBe(8);
711
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "63" }).ShouldBe(63);
714
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "8", "4" }).ShouldBe(4);
722
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "-1" });
731
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "0" });
740
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "foo" });
750
MSBuildApp
.ProcessMaxCPUCountSwitch(new[] { "1025" });
938
MSBuildApp
.SetConsoleUI();
945
MSBuildApp
.SetConsoleUI();
971
MSBuildApp
.SetConsoleUI();
1005
MSBuildApp
.SetConsoleUI();
1159
MSBuildApp
.Execute(new[] { @"c:\bin\msbuild.exe", quotedProjectFileName }).ShouldBe(
MSBuildApp
.ExitType.Success);
1199
MSBuildApp
.Execute(
1206
}).ShouldBe(
MSBuildApp
.ExitType.Success);
1636
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe(answer, StringCompareShould.IgnoreCase);
1651
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1663
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1675
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1678
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase); // "Expected my.proj to be only project found"
1692
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"
1721
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("my.proj", StringCompareShould.IgnoreCase);
1735
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);
1758
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1763
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1768
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.nativeproj", StringCompareShould.IgnoreCase); // "Expected test.nativeproj to be only project found"
1773
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1778
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1783
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1788
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1793
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1798
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj", StringCompareShould.IgnoreCase); // "Expected test.proj to be only project found"
1803
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1808
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.slnx", StringCompareShould.IgnoreCase); // "Expected test.slnx to be only solution found"
1814
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1819
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.sln", StringCompareShould.IgnoreCase); // "Expected test.sln to be only solution found"
1831
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles).ShouldBe("test.proj"); // "Expected test.proj to be only project found"
1845
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1859
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1874
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1888
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1902
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1916
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1931
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1943
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1957
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
1971
MSBuildApp
.ProcessProjectSwitch(Array.Empty<string>(), extensionsToIgnore, projectHelper.GetFiles);
2038
string actualProject =
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2062
MSBuildApp
.ProcessProjectSwitch(new[] { projectDirectory }, extensionsToIgnore, projectHelper.GetFiles);
2086
MSBuildApp
.ProcessDistributedFileLogger(
2105
MSBuildApp
.ProcessDistributedFileLogger(
2124
MSBuildApp
.ProcessDistributedFileLogger(
2136
MSBuildApp
.ProcessDistributedFileLogger(
2147
MSBuildApp
.ProcessDistributedFileLogger(
2166
MSBuildApp
.ProcessDistributedFileLogger(
2179
MSBuildApp
.ProcessDistributedFileLogger(
2192
MSBuildApp
.ProcessDistributedFileLogger(
2205
MSBuildApp
.ProcessDistributedFileLogger(
2218
MSBuildApp
.ProcessDistributedFileLogger(
2229
MSBuildApp
.ProcessDistributedFileLogger(
2240
MSBuildApp
.ProcessDistributedFileLogger(
2258
MSBuildApp
.ProcessDistributedFileLogger(
2276
MSBuildApp
.ProcessConsoleLoggerSwitch(
2286
MSBuildApp
.ProcessConsoleLoggerSwitch(
2300
MSBuildApp
.ProcessConsoleLoggerSwitch(
2952
MSBuildApp
.Execute(new[] { @"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
;
89
MSBuildApp
.ExitType.Success,
90
MSBuildApp
.Execute(
Microsoft.DotNet.Cli.Utils (1)
MSBuildForwardingAppWithoutLogging.cs (1)
166
return Build.CommandLine.
MSBuildApp
.Main(arguments);
MSBuild (6)
MSBuildClientApp.cs (5)
37
public static
MSBuildApp
.ExitType Execute(
64
public static
MSBuildApp
.ExitType Execute(
87
return
MSBuildApp
.Execute(commandLine);
91
Enum.TryParse(exitResult.MSBuildAppExitTypeString, out
MSBuildApp
.ExitType MSBuildAppExitType))
98
return
MSBuildApp
.ExitType.MSBuildClientFailure;
XMake.cs (1)
3015
return terminalLoggerParameters?.Length > 0 ?
MSBuildApp
.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty;