浏览代码

[tests]Fix up test framework to wait 5 frames before updating.

/Branch_batcher
Tim Cooper 8 年前
当前提交
16ec060a
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 21
      Assets/GraphicsTests/Editor/TestFramework.cs

21
Assets/GraphicsTests/Editor/TestFramework.cs


using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NUnit.Framework;

using System.Text.RegularExpressions;
using UnityEngine.TestTools;
namespace UnityEditor.Experimental.Rendering
{

public string name;
public float threshold;
public string relativePath;
public int frameWait;
public override string ToString()
{

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);
var splitPaths = p.FullName.Split(new[] {split}, StringSplitOptions.RemoveEmptyEntries);
threshold = 0.02f
threshold = 0.02f,
frameWait = 10
};
}
}

[Test, TestCaseSource(typeof(CollectScenes), "scenes")]
public void TestScene(TestInfo testInfo)
[UnityTest]
// [TestCaseSource(typeof(CollectScenes), "scenes") ]
public IEnumerator TestScene([ValueSource(typeof(CollectScenes), "scenes")]TestInfo testInfo)
for (int i = 0; i < testInfo.frameWait; ++i)
{
yield return null;
}
var testSetup = Object.FindObjectOfType<SetupSceneForRenderPipelineTest> ();
Assert.IsNotNull(testSetup, "No SetupSceneForRenderPipelineTest in scene " + testInfo.name);

正在加载...
取消
保存