浏览代码

Merge pull request #932 from Unity-Technologies/HDRP_GraphicTests

Add possibility to have comment in tests listed in TestRunner
/main
GitHub 7 年前
当前提交
d73b4d26
共有 5 个文件被更改,包括 103 次插入1 次删除
  1. 36
      Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs
  2. 30
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/AdditionalTestSceneInfos.asset
  3. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/AdditionalTestSceneInfos.asset.meta
  4. 19
      Tests/Scripts/GraphicTests/Framework/AdditionalTestSceneInfos.cs
  5. 11
      Tests/Scripts/GraphicTests/Framework/AdditionalTestSceneInfos.cs.meta

36
Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs


public struct TestInfo
{
public string name;
public string comment;
public float threshold;
public string relativePath;
public string templatePath;

public override string ToString()
{
return name;
if (string.IsNullOrEmpty(comment))
return name;
else
return string.Format("{0}: {1}", name, comment);
// Get additionalSceneInfo
public static Dictionary<string, AdditionalTestSceneInfos.AdditionalTestSceneInfo> GetAdditionalInfos ( string path)
{
Dictionary<string, AdditionalTestSceneInfos.AdditionalTestSceneInfo> o = new Dictionary<string, AdditionalTestSceneInfos.AdditionalTestSceneInfo>();
AdditionalTestSceneInfos additionalTestSceneInfos = AssetDatabase.LoadAssetAtPath<AdditionalTestSceneInfos>(path);
if (additionalTestSceneInfos != null)
{
for (int i=0 ; i<additionalTestSceneInfos.additionalInfos.Length ; ++i)
{
o[additionalTestSceneInfos.additionalInfos[i].name] = additionalTestSceneInfos.additionalInfos[i];
}
}
return o;
}
// collect the scenes that we can use
public static class CollectScenes
{

{
playModeScenes.Add(ti.templatePath);
}
// Get the additional infos
var additionalInfos = GetAdditionalInfos( "Assets"+Path.Combine(filesPath.Replace(Application.dataPath, ""), "AdditionalTestSceneInfos.asset") );
// construct all the needed test infos
for (int i = 0; i < allPaths_List.Count; ++i)

if (playModeScenes.Contains(splitPaths.Last()))
continue;
string sceneNum = p.Name.Split("_"[0])[0];
comment = additionalInfos.ContainsKey(sceneNum)? additionalInfos[sceneNum].comment:null,
relativePath = splitPaths.Last(),
templatePath = splitPaths.Last(),
threshold = 0.02f,

}
else
{
// Get the additional infos
var additionalInfos = GetAdditionalInfos( Path.Combine(filesPath, "AdditionalTestSceneInfos.asset") );
for ( int i=0 ; i<listFile.scenesPath.Length ; ++i)
{
string path = listFile.scenesPath[i];

split = string.Format("{0}{1}", split, Path.DirectorySeparatorChar);
var splitPaths = p.FullName.Split(new[] { split }, StringSplitOptions.RemoveEmptyEntries);
string sceneNum = p.Name.Split("_"[0])[0];
comment = additionalInfos.ContainsKey(sceneNum)? additionalInfos[sceneNum].comment:null,
relativePath = p.ToString(),
templatePath = splitPaths.Last(),
threshold = 0.02f,

30
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/AdditionalTestSceneInfos.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6918f3da28fdc4e47b6f4f6e669f1831, type: 3}
m_Name: AdditionalTestSceneInfos
m_EditorClassIdentifier:
additionalInfos:
- name: 1102
comment: Waiting for negative values in BC6H.
- name: 1103
comment: Waiting for negative values in BC6H.
- name: 1206
comment: Waiting for negative values in BC6H.
- name: 1302
comment: Open the scene and apply the correct pipeline.
- name: 1303
comment: Open the scene and apply the correct pipeline.
- name: 2203
comment: Scene not finished for the moment.
- name: 2301
comment: Shadow must be fixed.
- name: 2004
comment: No animated cookie on point light.

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/AdditionalTestSceneInfos.asset.meta


fileFormatVersion: 2
guid: be06383040e673b4887e323b8addbd15
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

19
Tests/Scripts/GraphicTests/Framework/AdditionalTestSceneInfos.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityEngine.Experimental.Rendering
{
[CreateAssetMenu(fileName = "AdditionalTestSceneInfos", menuName = "Render Pipeline/Tests/AdditionalTestSceneInfos", order = 20)]
public class AdditionalTestSceneInfos : ScriptableObject
{
public AdditionalTestSceneInfo[] additionalInfos;
[System.Serializable]
public struct AdditionalTestSceneInfo
{
public string name;
public string comment;
}
}
}

11
Tests/Scripts/GraphicTests/Framework/AdditionalTestSceneInfos.cs.meta


fileFormatVersion: 2
guid: 6918f3da28fdc4e47b6f4f6e669f1831
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存