|
|
|
|
|
|
[OneTimeSetUp] |
|
|
|
public void OneTimeSetUp() |
|
|
|
{ |
|
|
|
BackupSceneManagerSetup(); |
|
|
|
SetupRenderPipeAsset(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
Debug.Log("OnTimeTearDown"); |
|
|
|
RestoreSceneManagerSetup(); |
|
|
|
} |
|
|
|
|
|
|
|
public static RenderPipelineAsset GetRenderPipelineAsset(string _SRP_ID) |
|
|
|
|
|
|
string filePath = Path.Combine(absolutePath, TestFrameworkTools.renderPipelineAssets[_SRP_ID] ); |
|
|
|
|
|
|
|
filePath = filePath.Replace(Application.dataPath, ""); |
|
|
|
|
|
|
|
filePath = filePath.Remove(0, 1); |
|
|
|
|
|
|
|
//Debug.Log("Before combine: " + filePath);
|
|
|
|
|
|
|
|
filePath = Path.Combine("Assets", filePath); |
|
|
|
|
|
|
|
//Debug.Log("RP Asset is at : " + filePath);
|
|
|
|
|
|
|
|
return (RenderPipelineAsset)AssetDatabase.LoadAssetAtPath(filePath, typeof(RenderPipelineAsset)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public void SetupRenderPipeAsset() |
|
|
|
{ |
|
|
|
Debug.Log("Set " + _SRP_ID + " render pipeline."); |
|
|
|
//Debug.Log("Set " + _SRP_ID + " render pipeline. Previous was "+ ( (UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null)? "null":UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset.name) );
|
|
|
|
|
|
|
|
//Debug.Log("RestoreRenderPipeAsset from " + wantedTestsRenderPipeAsset.name + " to " + ((beforeTestsRenderPipeAsset == null)?"null":beforeTestsRenderPipeAsset.name));
|
|
|
|
{ |
|
|
|
//Debug.Log("RestoreRenderPipeAsset -> Actual restore");
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static SceneSetup[] sceneManagerSetupBeforeTest; |
|
|
|
|
|
|
|
public void BackupSceneManagerSetup() |
|
|
|
{ |
|
|
|
sceneManagerSetupBeforeTest = EditorSceneManager.GetSceneManagerSetup(); |
|
|
|
} |
|
|
|
|
|
|
|
public void RestoreSceneManagerSetup() |
|
|
|
{ |
|
|
|
if ( (sceneManagerSetupBeforeTest == null) || ( sceneManagerSetupBeforeTest.Length == 0 ) ) |
|
|
|
{ |
|
|
|
EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
EditorSceneManager.RestoreSceneManagerSetup(sceneManagerSetupBeforeTest); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|