浏览代码

Fixes asked for PR

/asmdef
Remy 7 年前
当前提交
3575217b
共有 1 个文件被更改,包括 4 次插入68 次删除
  1. 72
      Tests/GraphicsTests/Framework/Editor/TestFramework.cs

72
Tests/GraphicsTests/Framework/Editor/TestFramework.cs


"RenderPipeline"
};
private static readonly string[] s_PipelinePath =
{
"LightweightPipeline",
"HDRenderPipeline",
};
// info that gets generated for use
// in a dod way
public struct TestInfo

// collect the scenes that we can use
public static class CollectScenes
{
public static IEnumerable scenes
{
get
{
var absoluteScenesPath = s_Path.Aggregate(s_RootPath, Path.Combine);
foreach (var pipelinePath in s_PipelinePath)
{
var filesPath = Path.Combine(absoluteScenesPath, pipelinePath);
// find all the scenes
var allPaths = System.IO.Directory.GetFiles(filesPath, "*.unity", System.IO.SearchOption.AllDirectories);
// construct all the needed test infos
foreach (var path in allPaths)
{
var p = new FileInfo(path);
var split = s_Path.Aggregate("", Path.Combine);
split = string.Format("{0}{1}", split, Path.DirectorySeparatorChar);
var splitPaths = p.FullName.Split(new[] { split }, StringSplitOptions.RemoveEmptyEntries);
// Add prefix to the name for easier reading
var name = p.Name;
switch (pipelinePath)
{
case "LightweightPipeline":
name = "LTRP_" + name;
break;
case "HDRenderPipeline":
name = "HDRP_" + name;
break;
}
yield return new TestInfo
{
name = name,
relativePath = splitPaths.Last(),
threshold = 0.02f,
frameWait = 100
};
}
}
}
}
public static IEnumerable HDScenes
{
get

}
public static IEnumerable LTScenes
public static IEnumerable LWScenes
{
get
{

split = string.Format("{0}{1}", split, Path.DirectorySeparatorChar);
var splitPaths = p.FullName.Split(new[] { split }, StringSplitOptions.RemoveEmptyEntries);
// Add prefix to the name for easier reading
var name = p.Name;
switch (_pipelinePath)
{
case "LightweightPipeline":
name = "LTRP_" + name;
break;
case "HDRenderPipeline":
name = "HDRP_" + name;
break;
}
name = name,
name = p.Name,
relativePath = splitPaths.Last(),
threshold = 0.02f,
frameWait = 100

}
[UnityTest]
public IEnumerator LTRP_TestScene([ValueSource(typeof(CollectScenes), "LTScenes")]TestInfo testInfo)
public IEnumerator LWRP_TestScene([ValueSource(typeof(CollectScenes), "LWScenes")]TestInfo testInfo)
public IEnumerator TestScene([ValueSource(typeof(CollectScenes), "scenes")]TestInfo testInfo)
public IEnumerator TestScene(TestInfo testInfo)
{
var prjRelativeGraphsPath = s_Path.Aggregate(s_RootPath, Path.Combine);
var filePath = Path.Combine(prjRelativeGraphsPath, testInfo.relativePath);

正在加载...
取消
保存