Only allow use of a single baseline result file. Update help output.
This commit is contained in:
Родитель
35b625de6a
Коммит
2079762bf4
|
@ -13,6 +13,15 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
private readonly string learnMore =
|
||||
"To learn more about the Unity Performance Benchmark Reporter visit the Unity Performance Benchmark Reporter GitHub wiki at https://github.com/Unity-Technologies/PerformanceBenchmarkReporter/wiki.";
|
||||
|
||||
private readonly string commandLineOptionFormat =
|
||||
"// Command line option format\r\n--results=<Path to a test result XML filename OR directory>... [--baseline=\"Path to a baseline XML filename\"] [--reportdirpath=\"Path to where the report will be written\"]";
|
||||
|
||||
private readonly string example1 = "// Run reporter with one performance test result .xml file\r\n--results=\"G:\\My Drive\\XRPerfRuns\\results\\results.xml\"";
|
||||
|
||||
private readonly string example2 = "// Run reporter against a directory containing one or more performance test result .xml files\r\n--results=\"G:\\My Drive\\XRPerfRuns\\results\" ";
|
||||
|
||||
private readonly string example3 = "// Run reporter against a directory containing one or more performance test result .xml files, and a baseline .xml result file\r\n--results=\"G:\\My Drive\\XRPerfRuns\\results\" --baseline=\"G:\\My Drive\\XRPerfRuns\\baselines\\baseline.xml\" ";
|
||||
|
||||
public enum ResultType
|
||||
{
|
||||
Test,
|
||||
|
@ -53,17 +62,17 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
{
|
||||
return new OptionSet()
|
||||
.Add("?|help|h", "Prints out the options.", option => help = option != null)
|
||||
.Add("testresultsxmlsource=", "REQUIRED - Path to a test result XML filename or directory. Directories are searched resursively. You can repeat this option with multiple result file or directory paths.",
|
||||
.Add("results|testresultsxmlsource=", "REQUIRED - Path to a test result XML filename OR directory. Directories are searched resursively. You can repeat this option with multiple result file or directory paths.",
|
||||
xmlsource =>
|
||||
{
|
||||
performanceBenchmark.AddXmlSourcePath(xmlsource, "testresultsxmlsource", ResultType.Test);
|
||||
})
|
||||
.Add("baselinexmlsource:", "OPTIONAL - Path to a baseline XML filename or directory. Directories are searched resursively. You can repeat this option with multiple baseline file or directory paths.",
|
||||
.Add("baseline|baselinexmlsource:", "OPTIONAL - Path to a baseline XML filename.",
|
||||
xmlsource =>
|
||||
{
|
||||
performanceBenchmark.AddXmlSourcePath(xmlsource, "baselinexmlsource", ResultType.Baseline);
|
||||
})
|
||||
.Add("reportdirpath:", "OPTIONAL - Path to directory where the UnityPerformanceBenchmark report will be written. Default is current working directory.",
|
||||
.Add("report|reportdirpath:", "OPTIONAL - Path to where the report will be written. Default is current working directory.",
|
||||
performanceBenchmark.AddReportDirPath);
|
||||
}
|
||||
|
||||
|
@ -78,7 +87,12 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
|
||||
Console.WriteLine(about + "\r\n");
|
||||
Console.WriteLine(learnMore + "\r\n");
|
||||
Console.WriteLine("Usage is:");
|
||||
Console.WriteLine("Usage is:" + "\r\n");
|
||||
Console.WriteLine(commandLineOptionFormat + "\r\n");
|
||||
Console.WriteLine(example1 + "\r\n");
|
||||
Console.WriteLine(example2 + "\r\n");
|
||||
Console.WriteLine(example3 + "\r\n");
|
||||
Console.WriteLine("Options: \r\n");
|
||||
optionSet.WriteOptionDescriptions(Console.Error);
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
HashSet<string> xmlFileNamePaths,
|
||||
bool isBaseline = false)
|
||||
{
|
||||
if (xmlDirectoryPaths.Any())
|
||||
if (!isBaseline && xmlDirectoryPaths.Any())
|
||||
{
|
||||
foreach (var xmlDirectory in xmlDirectoryPaths)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче