Class ShaderWarningCollector
Collects shader warnings from the Unity log during builds and test runs.
When enabled via -shader-warnings-as-errors, captured warnings are written
to a ShaderWarnings.log artifact and can be used to fail the job.
Inherited Members
Namespace: UnityEngine.TestTools.Graphics
Assembly: UnityEngine.TestTools.Graphics.dll
Syntax
public static class ShaderWarningCollector
Properties
CollectedWarnings
The deduplicated, sorted list of collected warnings. Only valid after StopAndReport().
Declaration
public static IReadOnlyList<string> CollectedWarnings { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
HasWarnings
Whether any shader warnings have been collected.
Declaration
public static bool HasWarnings { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsCollecting
Whether the collector is currently listening for shader warnings.
Declaration
public static bool IsCollecting { get; }
Property Value
| Type | Description |
|---|---|
| bool |
OutputFilePath
The file path where collected warnings will be written when StopAndReport() is called.
Declaration
public static string OutputFilePath { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
StartCollecting()
Starts listening for shader warnings on UnityEngine.Application.logMessageReceivedThreaded. Clears any previously collected warnings.
Declaration
public static void StartCollecting()
StopAndReport()
Stops listening, writes collected warnings to a file, and publishes the file as a test artifact.
Declaration
public static void StopAndReport()