浏览代码

Properly override template in fail folder if needed.

Render realtime reflection probes before doing a test.
/main
Remy 7 年前
当前提交
356da4e5
共有 1 个文件被更改,包括 19 次插入1 次删除
  1. 20
      Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs

20
Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs


yield return null;
}
// Force rendering of all realtime reflection probes
ReflectionProbe[] probes = GameObject.FindObjectsOfType<ReflectionProbe>();
int[] renderIDs = new int[probes.Length];
for (int i=0; i<probes.Length; ++i)
{
if (probes[i].mode == UnityEngine.Rendering.ReflectionProbeMode.Realtime)
renderIDs[i] = probes[i].RenderProbe();
else
renderIDs[i] = -1;
}
for (int i=0; i<probes.Length; ++i)
{
if (renderIDs[i] != -1)
{
while (!probes[i].IsFinishedRendering(renderIDs[i])) yield return null;
}
}
testSetup.thingToDoBeforeTest.Invoke();
// Render the camera

var misMatchLocationTemplate = Path.Combine(failedPath, string.Format("{0}.template.{1}", testInfo.name, "png"));
var generated = captured.EncodeToPNG();
File.WriteAllBytes(misMatchLocationResult, generated);
File.Copy(dumpFileLocation, misMatchLocationTemplate);
File.Copy(dumpFileLocation, misMatchLocationTemplate, true);
}
Assert.IsTrue(areEqual, "Scene from {0}, did not match .template file.", testInfo.relativePath);

正在加载...
取消
保存