Skip to content

Commit 2079762

Browse files
Only allow use of a single baseline result file. Update help output.
1 parent 35b625d commit 2079762

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

UnityPerformanceBenchmarkReporter/OptionsParser.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ public class OptionsParser
1313
private readonly string learnMore =
1414
"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.";
1515

16+
private readonly string commandLineOptionFormat =
17+
"// 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\"]";
18+
19+
private readonly string example1 = "// Run reporter with one performance test result .xml file\r\n--results=\"G:\\My Drive\\XRPerfRuns\\results\\results.xml\"";
20+
21+
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\" ";
22+
23+
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\" ";
24+
1625
public enum ResultType
1726
{
1827
Test,
@@ -53,17 +62,17 @@ private OptionSet GetOptions(PerformanceBenchmark performanceBenchmark)
5362
{
5463
return new OptionSet()
5564
.Add("?|help|h", "Prints out the options.", option => help = option != null)
56-
.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.",
65+
.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.",
5766
xmlsource =>
5867
{
5968
performanceBenchmark.AddXmlSourcePath(xmlsource, "testresultsxmlsource", ResultType.Test);
6069
})
61-
.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.",
70+
.Add("baseline|baselinexmlsource:", "OPTIONAL - Path to a baseline XML filename.",
6271
xmlsource =>
6372
{
6473
performanceBenchmark.AddXmlSourcePath(xmlsource, "baselinexmlsource", ResultType.Baseline);
6574
})
66-
.Add("reportdirpath:", "OPTIONAL - Path to directory where the UnityPerformanceBenchmark report will be written. Default is current working directory.",
75+
.Add("report|reportdirpath:", "OPTIONAL - Path to where the report will be written. Default is current working directory.",
6776
performanceBenchmark.AddReportDirPath);
6877
}
6978

@@ -78,7 +87,12 @@ private void ShowHelp(string message, OptionSet optionSet)
7887

7988
Console.WriteLine(about + "\r\n");
8089
Console.WriteLine(learnMore + "\r\n");
81-
Console.WriteLine("Usage is:");
90+
Console.WriteLine("Usage is:" + "\r\n");
91+
Console.WriteLine(commandLineOptionFormat + "\r\n");
92+
Console.WriteLine(example1 + "\r\n");
93+
Console.WriteLine(example2 + "\r\n");
94+
Console.WriteLine(example3 + "\r\n");
95+
Console.WriteLine("Options: \r\n");
8296
optionSet.WriteOptionDescriptions(Console.Error);
8397
Environment.Exit(-1);
8498
}

UnityPerformanceBenchmarkReporter/PerformanceBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void AddTestResults(
7070
HashSet<string> xmlFileNamePaths,
7171
bool isBaseline = false)
7272
{
73-
if (xmlDirectoryPaths.Any())
73+
if (!isBaseline && xmlDirectoryPaths.Any())
7474
{
7575
foreach (var xmlDirectory in xmlDirectoryPaths)
7676
{

0 commit comments

Comments
 (0)