protected override TreeViewItem BuildRoot() { TreeViewItem root = new TreeViewItem(0, -1, "Root"); int nextID = 1; IEnumerable <GraphicsTestCase> testCases = new EditorGraphicsTestCaseProvider().GetTestCases(); foreach (var i_testCase in testCases) { TestResultViewItem item = new TestResultViewItem(nextID, 0, Path.GetFileNameWithoutExtension(i_testCase.ScenePath), i_testCase); nextID++; root.AddChild(item); } SetupDepthsFromParentsAndChildren(root); return(root); }
protected override TreeViewItem BuildRoot() { TreeViewItem root = new TreeViewItem(0, -1, "Root"); int nextID = 1; TreeViewItem hdrpParent = new TreeViewItem(nextID, 0, "HDRP"); ++nextID; root.AddChild(hdrpParent); TreeViewItem lwrpParent = new TreeViewItem(nextID, 0, "LWRP"); ++nextID; root.AddChild(lwrpParent); Dictionary <string, TreeViewItem> hdrpFolders = new Dictionary <string, TreeViewItem>(); foreach (TestFrameworkTools.TestInfo info in TestFrameworkTools.CollectScenes.HDRP) { TreeViewItem parent = hdrpParent; string folder = Path.GetDirectoryName(info.templatePath).Split("\\"[0]).Last(); if (hdrpFolders.ContainsKey(folder)) { parent = hdrpFolders[folder]; } else { parent = new TreeViewItem(nextID, 0, folder); nextID++; hdrpParent.AddChild(parent); hdrpFolders.Add(folder, parent); } var prjRelativeGraphsPath = TestFrameworkTools.s_Path.Aggregate(TestFrameworkTools.s_RootPath, Path.Combine); var filePath = Path.Combine(prjRelativeGraphsPath, info.relativePath); filePath = string.Format("Assets{0}", filePath.Replace(Application.dataPath, "")); SceneAsset sceneObject = AssetDatabase.LoadAssetAtPath <SceneAsset>(filePath); TestResultViewItem item = new TestResultViewItem(nextID, 0, info.name, sceneObject); nextID++; parent.AddChild(item); } Dictionary <string, TreeViewItem> lwrpFolders = new Dictionary <string, TreeViewItem>(); foreach (TestFrameworkTools.TestInfo info in TestFrameworkTools.CollectScenes.LWRP) { TreeViewItem parent = lwrpParent; string folder = Path.GetDirectoryName(info.templatePath).Split("\\"[0]).Last(); if (lwrpFolders.ContainsKey(folder)) { parent = lwrpFolders[folder]; } else { parent = new TreeViewItem(nextID, 0, folder); nextID++; lwrpParent.AddChild(parent); lwrpFolders.Add(folder, parent); } var prjRelativeGraphsPath = TestFrameworkTools.s_Path.Aggregate(TestFrameworkTools.s_RootPath, Path.Combine); var filePath = Path.Combine(prjRelativeGraphsPath, info.relativePath); filePath = string.Format("Assets{0}", filePath.Replace(Application.dataPath, "")); SceneAsset sceneObject = AssetDatabase.LoadAssetAtPath <SceneAsset>(filePath); TestResultViewItem item = new TestResultViewItem(nextID, 0, info.name, sceneObject); nextID++; parent.AddChild(item); } SetupDepthsFromParentsAndChildren(root); return(root); }