Updates to show "None" for XR settings when VR disabled
This commit is contained in:
Родитель
2079762bf4
Коммит
100de9f870
|
@ -21,7 +21,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public readonly Dictionary<string, Dictionary<string, string>> MismatchedEditorVersionValues = new Dictionary<string, Dictionary<string, string>>();
|
||||
|
||||
public bool MismatchesExist => PlayerSystemInfoResultFiles.Any() ||
|
||||
PlayerSystemInfoResultFiles.Any() ||
|
||||
PlayerSettingsResultFiles.Any() ||
|
||||
QualitySettingsResultFiles.Any() ||
|
||||
ScreenSettingsResultFiles.Any() ||
|
||||
BuildSettingsResultFiles.Any() ||
|
||||
|
@ -30,7 +30,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public void ValidatePlayerSystemInfo(PerformanceTestRun testRun1, PerformanceTestRun testRun2,
|
||||
string firstTestRunResultPath, string xmlFileNamePath, string[] excludedFieldNames)
|
||||
{
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.DeviceModel)) && testRun1.PlayerSystemInfo.DeviceModel != testRun2.PlayerSystemInfo.DeviceModel)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.DeviceModel)) || excludedFieldNames == null) && testRun1.PlayerSystemInfo.DeviceModel != testRun2.PlayerSystemInfo.DeviceModel)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSystemInfoResultFiles,
|
||||
|
@ -41,7 +41,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSystemInfo.DeviceModel,
|
||||
testRun2.PlayerSystemInfo.DeviceModel);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.GraphicsDeviceName)) && testRun1.PlayerSystemInfo.GraphicsDeviceName != testRun2.PlayerSystemInfo.GraphicsDeviceName)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.GraphicsDeviceName)) || excludedFieldNames == null) && testRun1.PlayerSystemInfo.GraphicsDeviceName != testRun2.PlayerSystemInfo.GraphicsDeviceName)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSystemInfoResultFiles,
|
||||
|
@ -52,7 +52,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSystemInfo.GraphicsDeviceName,
|
||||
testRun2.PlayerSystemInfo.GraphicsDeviceName);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.ProcessorCount)) && testRun1.PlayerSystemInfo.ProcessorCount != testRun2.PlayerSystemInfo.ProcessorCount)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.ProcessorCount)) || excludedFieldNames == null) && testRun1.PlayerSystemInfo.ProcessorCount != testRun2.PlayerSystemInfo.ProcessorCount)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSystemInfoResultFiles,
|
||||
|
@ -63,7 +63,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSystemInfo.ProcessorCount.ToString(),
|
||||
testRun2.PlayerSystemInfo.ProcessorCount.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.ProcessorType)) && testRun1.PlayerSystemInfo.ProcessorType != testRun2.PlayerSystemInfo.ProcessorType)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.ProcessorType)) || excludedFieldNames == null) && testRun1.PlayerSystemInfo.ProcessorType != testRun2.PlayerSystemInfo.ProcessorType)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSystemInfoResultFiles,
|
||||
|
@ -74,7 +74,8 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSystemInfo.ProcessorType,
|
||||
testRun2.PlayerSystemInfo.ProcessorType);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.XrDevice)) && testRun1.PlayerSystemInfo.XrDevice != testRun2.PlayerSystemInfo.XrDevice)
|
||||
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.XrDevice)) || excludedFieldNames == null) && testRun1.PlayerSystemInfo.XrDevice != testRun2.PlayerSystemInfo.XrDevice)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSystemInfoResultFiles,
|
||||
|
@ -85,7 +86,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSystemInfo.XrDevice,
|
||||
testRun2.PlayerSystemInfo.XrDevice);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.XrModel)) && testRun1.PlayerSystemInfo.XrModel != testRun2.PlayerSystemInfo.XrModel)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.XrModel)) || excludedFieldNames == null) && testRun1.PlayerSystemInfo.XrModel != testRun2.PlayerSystemInfo.XrModel)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSystemInfoResultFiles,
|
||||
|
@ -101,7 +102,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public void ValidatePlayerSettings(PerformanceTestRun testRun1, PerformanceTestRun testRun2,
|
||||
string firstTestRunResultPath, string xmlFileNamePath, string[] excludedFieldNames)
|
||||
{
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.AndroidMinimumSdkVersion)) && testRun1.PlayerSettings.AndroidMinimumSdkVersion != testRun2.PlayerSettings.AndroidMinimumSdkVersion)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.AndroidMinimumSdkVersion)) || excludedFieldNames == null) && testRun1.PlayerSettings.AndroidMinimumSdkVersion != testRun2.PlayerSettings.AndroidMinimumSdkVersion)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -112,7 +113,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSettings.AndroidMinimumSdkVersion,
|
||||
testRun2.PlayerSettings.AndroidMinimumSdkVersion);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.AndroidTargetSdkVersion)) && testRun1.PlayerSettings.AndroidTargetSdkVersion != testRun2.PlayerSettings.AndroidTargetSdkVersion)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.AndroidTargetSdkVersion)) || excludedFieldNames == null) && testRun1.PlayerSettings.AndroidTargetSdkVersion != testRun2.PlayerSettings.AndroidTargetSdkVersion)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -133,7 +134,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
string.Join(',', testRun2.PlayerSettings.EnabledXrTargets.ToArray()) :
|
||||
string.Empty;
|
||||
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.EnabledXrTargets)) && srcEnabledXrTargetsString != targetEnabledXrTargetsString)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.EnabledXrTargets)) || excludedFieldNames == null) && srcEnabledXrTargetsString != targetEnabledXrTargetsString)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -145,7 +146,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
targetEnabledXrTargetsString);
|
||||
}
|
||||
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.GpuSkinning)) && testRun1.PlayerSettings.GpuSkinning != testRun2.PlayerSettings.GpuSkinning)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.GpuSkinning)) || excludedFieldNames == null) && testRun1.PlayerSettings.GpuSkinning != testRun2.PlayerSettings.GpuSkinning)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -156,7 +157,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSettings.GpuSkinning.ToString(),
|
||||
testRun2.PlayerSettings.GpuSkinning.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.GraphicsApi)) && testRun1.PlayerSettings.GraphicsApi != testRun2.PlayerSettings.GraphicsApi)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.GraphicsApi)) || excludedFieldNames == null) && testRun1.PlayerSettings.GraphicsApi != testRun2.PlayerSettings.GraphicsApi)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -167,29 +168,8 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSettings.GraphicsApi,
|
||||
testRun2.PlayerSettings.GraphicsApi);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.GraphicsJobs)) && testRun1.PlayerSettings.GraphicsJobs != testRun2.PlayerSettings.GraphicsJobs)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
MismatchedPlayerSettingsValues,
|
||||
firstTestRunResultPath,
|
||||
xmlFileNamePath,
|
||||
nameof(testRun1.PlayerSettings.GraphicsJobs),
|
||||
testRun1.PlayerSettings.GraphicsJobs.ToString(),
|
||||
testRun2.PlayerSettings.GraphicsJobs.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.MtRendering)) && testRun1.PlayerSettings.MtRendering != testRun2.PlayerSettings.MtRendering)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
MismatchedPlayerSettingsValues,
|
||||
firstTestRunResultPath,
|
||||
xmlFileNamePath,
|
||||
nameof(testRun1.PlayerSettings.MtRendering),
|
||||
testRun1.PlayerSettings.MtRendering.ToString(),
|
||||
testRun2.PlayerSettings.MtRendering.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.RenderThreadingMode)) && testRun1.PlayerSettings.RenderThreadingMode != testRun2.PlayerSettings.RenderThreadingMode)
|
||||
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSystemInfo.DeviceModel)) || excludedFieldNames == null) && testRun1.PlayerSettings.RenderThreadingMode != testRun2.PlayerSettings.RenderThreadingMode)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -200,7 +180,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSettings.RenderThreadingMode,
|
||||
testRun2.PlayerSettings.RenderThreadingMode);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.ScriptingBackend)) && testRun1.PlayerSettings.ScriptingBackend != testRun2.PlayerSettings.ScriptingBackend)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.ScriptingBackend)) || excludedFieldNames == null) && testRun1.PlayerSettings.ScriptingBackend != testRun2.PlayerSettings.ScriptingBackend)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -211,7 +191,10 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSettings.ScriptingBackend,
|
||||
testRun2.PlayerSettings.ScriptingBackend);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.StereoRenderingPath)) && testRun1.PlayerSettings.StereoRenderingPath != testRun2.PlayerSettings.StereoRenderingPath)
|
||||
|
||||
if ( (testRun1.PlayerSettings.VrSupported || testRun2.PlayerSettings.VrSupported)
|
||||
&& (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.StereoRenderingPath)) || excludedFieldNames == null)
|
||||
&& testRun1.PlayerSettings.StereoRenderingPath != testRun2.PlayerSettings.StereoRenderingPath)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -222,7 +205,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.PlayerSettings.StereoRenderingPath,
|
||||
testRun2.PlayerSettings.StereoRenderingPath);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.VrSupported)) && testRun1.PlayerSettings.VrSupported != testRun2.PlayerSettings.VrSupported)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.PlayerSettings.VrSupported)) || excludedFieldNames == null) && testRun1.PlayerSettings.VrSupported != testRun2.PlayerSettings.VrSupported)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref PlayerSettingsResultFiles,
|
||||
|
@ -238,7 +221,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public void ValidateQualitySettings(PerformanceTestRun testRun1, PerformanceTestRun testRun2,
|
||||
string firstTestRunResultPath, string xmlFileNamePath, string[] excludedFieldNames)
|
||||
{
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.AnisotropicFiltering)) && testRun1.QualitySettings.AnisotropicFiltering != testRun2.QualitySettings.AnisotropicFiltering)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.AnisotropicFiltering)) || excludedFieldNames == null) && testRun1.QualitySettings.AnisotropicFiltering != testRun2.QualitySettings.AnisotropicFiltering)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref QualitySettingsResultFiles,
|
||||
|
@ -249,7 +232,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.QualitySettings.AnisotropicFiltering,
|
||||
testRun2.QualitySettings.AnisotropicFiltering);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.AntiAliasing)) && testRun1.QualitySettings.AntiAliasing != testRun2.QualitySettings.AntiAliasing)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.AntiAliasing)) || excludedFieldNames == null) && testRun1.QualitySettings.AntiAliasing != testRun2.QualitySettings.AntiAliasing)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref QualitySettingsResultFiles,
|
||||
|
@ -260,7 +243,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.QualitySettings.AntiAliasing.ToString(),
|
||||
testRun2.QualitySettings.AntiAliasing.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.BlendWeights)) && testRun1.QualitySettings.BlendWeights != testRun2.QualitySettings.BlendWeights)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.BlendWeights)) || excludedFieldNames == null) && testRun1.QualitySettings.BlendWeights != testRun2.QualitySettings.BlendWeights)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref QualitySettingsResultFiles,
|
||||
|
@ -271,7 +254,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.QualitySettings.BlendWeights,
|
||||
testRun2.QualitySettings.BlendWeights);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.ColorSpace)) && testRun1.QualitySettings.ColorSpace != testRun2.QualitySettings.ColorSpace)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.ColorSpace)) || excludedFieldNames == null) && testRun1.QualitySettings.ColorSpace != testRun2.QualitySettings.ColorSpace)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref QualitySettingsResultFiles,
|
||||
|
@ -282,7 +265,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.QualitySettings.ColorSpace,
|
||||
testRun2.QualitySettings.ColorSpace);
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.Vsync)) && testRun1.QualitySettings.Vsync != testRun2.QualitySettings.Vsync)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.QualitySettings.Vsync)) || excludedFieldNames == null) && testRun1.QualitySettings.Vsync != testRun2.QualitySettings.Vsync)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref QualitySettingsResultFiles,
|
||||
|
@ -298,7 +281,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public void ValidateScreenSettings(PerformanceTestRun testRun1, PerformanceTestRun testRun2,
|
||||
string firstTestRunResultPath, string xmlFileNamePath, string[] excludedFieldNames)
|
||||
{
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.Fullscreen)) && testRun1.ScreenSettings.Fullscreen != testRun2.ScreenSettings.Fullscreen)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.Fullscreen)) || excludedFieldNames == null) && testRun1.ScreenSettings.Fullscreen != testRun2.ScreenSettings.Fullscreen)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref ScreenSettingsResultFiles,
|
||||
|
@ -309,7 +292,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.ScreenSettings.Fullscreen.ToString(),
|
||||
testRun2.ScreenSettings.Fullscreen.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.ScreenHeight)) && testRun1.ScreenSettings.ScreenHeight != testRun2.ScreenSettings.ScreenHeight)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.ScreenHeight)) || excludedFieldNames == null) && testRun1.ScreenSettings.ScreenHeight != testRun2.ScreenSettings.ScreenHeight)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref ScreenSettingsResultFiles,
|
||||
|
@ -320,7 +303,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.ScreenSettings.ScreenHeight.ToString(),
|
||||
testRun2.ScreenSettings.ScreenHeight.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.ScreenRefreshRate)) && testRun1.ScreenSettings.ScreenRefreshRate != testRun2.ScreenSettings.ScreenRefreshRate)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.ScreenRefreshRate)) || excludedFieldNames == null) && testRun1.ScreenSettings.ScreenRefreshRate != testRun2.ScreenSettings.ScreenRefreshRate)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref ScreenSettingsResultFiles,
|
||||
|
@ -331,7 +314,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun1.ScreenSettings.ScreenRefreshRate.ToString(),
|
||||
testRun2.ScreenSettings.ScreenRefreshRate.ToString());
|
||||
}
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.ScreenWidth)) && testRun1.ScreenSettings.ScreenWidth != testRun2.ScreenSettings.ScreenWidth)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.ScreenSettings.ScreenWidth)) || excludedFieldNames == null) && testRun1.ScreenSettings.ScreenWidth != testRun2.ScreenSettings.ScreenWidth)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref ScreenSettingsResultFiles,
|
||||
|
@ -347,7 +330,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public void ValidateBuildSettings(PerformanceTestRun testRun1, PerformanceTestRun testRun2,
|
||||
string firstTestRunResultPath, string xmlFileNamePath, string[] excludedFieldNames)
|
||||
{
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.Platform)) && testRun1.BuildSettings.Platform != testRun2.BuildSettings.Platform)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.Platform)) || excludedFieldNames == null) && testRun1.BuildSettings.Platform != testRun2.BuildSettings.Platform)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref BuildSettingsResultFiles,
|
||||
|
@ -359,7 +342,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun2.BuildSettings.Platform);
|
||||
}
|
||||
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.BuildTarget)) && testRun1.BuildSettings.BuildTarget != testRun2.BuildSettings.BuildTarget)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.BuildTarget)) || excludedFieldNames == null) && testRun1.BuildSettings.BuildTarget != testRun2.BuildSettings.BuildTarget)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref BuildSettingsResultFiles,
|
||||
|
@ -371,7 +354,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun2.BuildSettings.BuildTarget);
|
||||
}
|
||||
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.DevelopmentPlayer)) && testRun1.BuildSettings.DevelopmentPlayer != testRun2.BuildSettings.DevelopmentPlayer)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.DevelopmentPlayer)) || excludedFieldNames == null) && testRun1.BuildSettings.DevelopmentPlayer != testRun2.BuildSettings.DevelopmentPlayer)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref BuildSettingsResultFiles,
|
||||
|
@ -383,7 +366,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun2.BuildSettings.DevelopmentPlayer.ToString());
|
||||
}
|
||||
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.AndroidBuildSystem)) && testRun1.BuildSettings.AndroidBuildSystem != testRun2.BuildSettings.AndroidBuildSystem)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.BuildSettings.AndroidBuildSystem)) || excludedFieldNames == null) && testRun1.BuildSettings.AndroidBuildSystem != testRun2.BuildSettings.AndroidBuildSystem)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref BuildSettingsResultFiles,
|
||||
|
@ -399,7 +382,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
public void ValidateEditorVersion(PerformanceTestRun testRun1, PerformanceTestRun testRun2,
|
||||
string firstTestRunResultPath, string xmlFileNamePath, string[] excludedFieldNames)
|
||||
{
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.EditorVersion.FullVersion)) && testRun1.EditorVersion.FullVersion != testRun2.EditorVersion.FullVersion)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.EditorVersion.FullVersion)) || excludedFieldNames == null) && testRun1.EditorVersion.FullVersion != testRun2.EditorVersion.FullVersion)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref EditorVersionResultFiles,
|
||||
|
@ -411,7 +394,7 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
testRun2.EditorVersion.FullVersion);
|
||||
}
|
||||
|
||||
if (excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.EditorVersion.FullVersion)) && testRun1.EditorVersion.Branch != testRun2.EditorVersion.Branch)
|
||||
if ((excludedFieldNames != null && !excludedFieldNames.Contains(nameof(testRun1.EditorVersion.FullVersion)) || excludedFieldNames == null) && testRun1.EditorVersion.Branch != testRun2.EditorVersion.Branch)
|
||||
{
|
||||
AddMismatchedTestConfig(
|
||||
ref EditorVersionResultFiles,
|
||||
|
|
|
@ -10,7 +10,8 @@ namespace UnityPerformanceBenchmarkReporter
|
|||
{
|
||||
private static readonly Dictionary<string, string[]> ExcludedConfigFieldNames = new Dictionary<string, string[]>
|
||||
{
|
||||
{typeof(EditorVersion).Name, new []{"DateSeconds", "RevisionValue", "Branch"}}
|
||||
{typeof(EditorVersion).Name, new []{"DateSeconds", "RevisionValue", "Branch"}},
|
||||
{typeof(PlayerSettings).Name, new []{"MtRendering", "GraphicsJobs"}}
|
||||
};
|
||||
|
||||
private static void Main(string[] args)
|
||||
|
|
|
@ -20,7 +20,8 @@ namespace UnityPerformanceBenchmarkReporter.Report
|
|||
"styles.css",
|
||||
"UnityLogo.png",
|
||||
"warning.png",
|
||||
"help.png"
|
||||
"help.png",
|
||||
"help-hover.png"
|
||||
};
|
||||
|
||||
private readonly Dictionary<string, string[]> excludedConfigFieldNames = new Dictionary<string, string[]>();
|
||||
|
@ -32,6 +33,7 @@ namespace UnityPerformanceBenchmarkReporter.Report
|
|||
private uint thisSigFig;
|
||||
private bool thisHasBenchmarkResults;
|
||||
private MetadataValidator metadataValidator;
|
||||
private bool vrSupported = false;
|
||||
|
||||
public ReportWriter(Dictionary<string, string[]> excludedTestConfigs = null)
|
||||
{
|
||||
|
@ -726,9 +728,15 @@ namespace UnityPerformanceBenchmarkReporter.Report
|
|||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (thisObject.GetType().GetFields().Any(f => f.Name.Equals("VrSupported")))
|
||||
{
|
||||
vrSupported = (bool)thisObject.GetType().GetFields().First(f => f.Name.Equals("VrSupported")).GetValue(thisObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (var field in thisObject.GetType().GetFields())
|
||||
{
|
||||
|
||||
if (excludedFieldNames != null && excludedFieldNames.Contains(field.Name))
|
||||
{
|
||||
continue;
|
||||
|
@ -812,10 +820,18 @@ namespace UnityPerformanceBenchmarkReporter.Report
|
|||
|
||||
private object GetFieldValues<T>(FieldInfo field, T thisObject)
|
||||
{
|
||||
return IsIEnumerableFieldType(field) ? ConvertIEnumberableToString(field, thisObject) : field.GetValue(thisObject);
|
||||
return IsIEnumerableFieldType(field) ? ConvertIEnumberableToString(field, thisObject) : GetValue(field, thisObject);
|
||||
}
|
||||
|
||||
private static bool IsIEnumerableFieldType(FieldInfo field)
|
||||
private object GetValue<T>(FieldInfo field, T thisObject)
|
||||
{
|
||||
return
|
||||
(field.Name.Equals("StereoRenderingPath") || field.Name.Equals("XrModel") || field.Name.Equals("XrDevice")) && !vrSupported ?
|
||||
"None" :
|
||||
field.GetValue(thisObject);
|
||||
}
|
||||
|
||||
private bool IsIEnumerableFieldType(FieldInfo field)
|
||||
{
|
||||
return typeof(IEnumerable).IsAssignableFrom(field.FieldType) && field.FieldType != typeof(string);
|
||||
}
|
||||
|
@ -823,15 +839,23 @@ namespace UnityPerformanceBenchmarkReporter.Report
|
|||
private string ConvertIEnumberableToString<T>(FieldInfo field, T thisObject)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var enumerable in (IEnumerable) field.GetValue(thisObject))
|
||||
var fieldValues = ((IEnumerable) field.GetValue(thisObject)) as List<string>;
|
||||
if (fieldValues != null && fieldValues.Any())
|
||||
{
|
||||
sb.Append(enumerable + ",");
|
||||
}
|
||||
foreach (var enumerable in fieldValues)
|
||||
{
|
||||
sb.Append(enumerable + ",");
|
||||
}
|
||||
|
||||
if (sb.ToString().EndsWith(','))
|
||||
if (sb.ToString().EndsWith(','))
|
||||
{
|
||||
// trim trailing comma
|
||||
sb.Length--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// trim trailing comma
|
||||
sb.Length--;
|
||||
sb.Append("None");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
|
|
|
@ -52,7 +52,7 @@ th {
|
|||
}
|
||||
|
||||
.helpwrapper:hover {
|
||||
background-image: url("help2.png");
|
||||
background-image: url("help-hover.png");
|
||||
}
|
||||
|
||||
.titletable {
|
||||
|
@ -223,6 +223,7 @@ div:hover > .configwarning {
|
|||
border: 1px solid lightgray;
|
||||
border-radius: 4px;
|
||||
margin: 5px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fieldgroupwarning {
|
||||
|
@ -230,6 +231,7 @@ div:hover > .configwarning {
|
|||
border: 1px solid #f28034;
|
||||
border-radius: 4px;
|
||||
margin: 5px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fieldname {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
|
Загрузка…
Ссылка в новой задаче