Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions com.unity.toon-graphics-test/Runtime/Resources.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 12 additions & 23 deletions com.unity.toon-graphics-test/Runtime/UTSGraphicsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ internal static IEnumerator RunInternal(GraphicsTestCase testCase, bool isXR = f
yield return null;

Camera mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
UTSGraphicsTestSettings settings = Object.FindFirstObjectByType<UTSGraphicsTestSettings>();
Assert.IsNotNull(settings, "Invalid test scene, couldn't find UTS_GraphicsTestSettings");

UTSGraphicsTestSettingsSO settingsSO = settings.SO;
Assert.IsNotNull(settingsSO);


//"Packages/com.unity.toon-graphics-test/Runtime/Resources/UTSGraphicsSettings.asset";
UTSGraphicsTestSettingsSO settingsSO = Resources.Load<UTSGraphicsTestSettingsSO>("UTSGraphicsSettings");
Assert.IsNotNull(settingsSO, "[UTS Graphics Test] Settings not found");

ImageComparisonSettings imageComparisonSettings = settingsSO.ImageComparisonSettings;
Assert.IsNotNull(imageComparisonSettings);

Expand Down Expand Up @@ -117,23 +116,13 @@ internal static IEnumerator RunInternal(GraphicsTestCase testCase, bool isXR = f

ImageAssert.AreEqual(testCase.ReferenceImage, mainCamera,
imageComparisonSettings, testCase.ReferenceImagePathLog);

// Does it allocate memory when it renders what's on the main camera?
bool allocatesMemory = false;

if (settings == null || settings.CheckMemoryAllocation)
{
try
{
ImageAssert.AllocatesMemory(mainCamera, imageComparisonSettings);
}
catch (AssertionException)
{
allocatesMemory = true;
}
if (allocatesMemory)
Assert.Fail("Allocated memory when rendering what is on main camera");
}

// [TODO-sin: 2025-12-23] Check memory allocations
// try {
// ImageAssert.AllocatesMemory(mainCamera, imageComparisonSettings);
// } catch (AssertionException) {
// Assert.Fail("Allocated memory when rendering what is on main camera");
// }
}
}

Expand Down