Skip to content

Commit 572aee0

Browse files
committed
Removed PerformanceBenchmarkTests
Added PerformanceBenchmarkTestsJson Added PerformanceBenchmarkTestsXML Added TestData files Fixed baseline files not being read when path is a directory
1 parent 226f1b4 commit 572aee0

File tree

14 files changed

+13206
-46
lines changed

14 files changed

+13206
-46
lines changed

UnityPerformanceBenchmarkReporter/PerformanceBenchmark.cs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void AddTestResults(
8686

8787
foreach (var fileNamePath in fileNamePaths)
8888
{
89-
var performanceTestRun = testResultParser.Parse(fileNamePath,DataVersion);
89+
var performanceTestRun = testResultParser.Parse(fileNamePath, DataVersion);
9090
if (performanceTestRun != null && performanceTestRun.Results.Any())
9191
{
9292
perfTestRuns.Add(
@@ -100,7 +100,7 @@ private void AddTestResults(
100100
for (var i = 0; i < resultFilesOrderedByResultName.Length; i++)
101101
{
102102
var performanceTestRun =
103-
testResultParser.Parse(resultFilesOrderedByResultName[i].Key,DataVersion);
103+
testResultParser.Parse(resultFilesOrderedByResultName[i].Key, DataVersion);
104104

105105
if (performanceTestRun != null && performanceTestRun.Results.Any())
106106
{
@@ -133,12 +133,15 @@ private void AddTestResults(
133133

134134
public void SetDataVersion(string version)
135135
{
136-
if(int.TryParse(version,out int result)){
137-
if(result > 0 && result < 3)
136+
if (int.TryParse(version, out int result))
137+
{
138+
if (result > 0 && result < 3)
138139
DataVersion = result;
139140
else
140-
throw new ArgumentException($"{version} is not a valid data format version. Please pass 1 or 2");
141-
}else{
141+
throw new ArgumentException($"{version} is not a valid data format version. Please pass 1 or 2");
142+
}
143+
else
144+
{
142145
throw new ArgumentException($"{version} is not a valid data format version");
143146
}
144147
}
@@ -211,7 +214,21 @@ private void ProcessAsDirectory(string sourcePath, string optionName, OptionsPar
211214
sourcePath, FileType));
212215
}
213216

214-
ResultDirectoryPaths.Add(sourcePath);
217+
switch (resultType)
218+
{
219+
case OptionsParser.ResultType.Test:
220+
ResultDirectoryPaths.Add(sourcePath);
221+
break;
222+
case OptionsParser.ResultType.Baseline:
223+
foreach (var filename in fileNames)
224+
{
225+
BaselineFilePaths.Add(filename);
226+
}
227+
228+
break;
229+
default:
230+
throw new InvalidEnumArgumentException(resultType.ToString());
231+
}
215232
}
216233

217234
private void ProcessAsFile(string sourcePath, string optionName, OptionsParser.ResultType resultType)

0 commit comments

Comments
 (0)