Skip to content

Remove com.unity.testframework.graphics dependency to fix Unity 6000.3 compile error - #181

Merged
sakumanaoki merged 4 commits into
mainfrom
bugfix/unity_6003_error
Apr 2, 2026
Merged

Remove com.unity.testframework.graphics dependency to fix Unity 6000.3 compile error#181
sakumanaoki merged 4 commits into
mainfrom
bugfix/unity_6003_error

Conversation

@sakumanaoki

Copy link
Copy Markdown
Contributor

概要

Unity 6 (6000.3) へのアップグレード時に、com.unity.testframework.graphics@8.9.1-exp.1 パッケージ内でコンパイルエラーが発生する問題を修正しました。

原因

Unity 6 の com.unity.test-framework 1.6.0 で UnityEngine.TestTools.TestMode が新設されたことにより、com.unity.testframework.graphicsCodeBasedGraphicsTests.cs で名前空間の衝突が発生しています。

対応版がリリースされていないため、依存自体を除去する方針で対応しました。

対応内容

com.unity.testframework.graphics から使用していた以下の型を自前実装に置き換えました。

除去した型 置き換え
ImageComparisonSettings Tests.Runtime.Internal.ImageComparisonSettings (新規)
TestUtils.GetCurrentTestResultsFolderPath() TestUtility.GetCurrentTestResultsFolderPath() (既存クラスにメソッド追加)
ImageMessage / ImageHandler File.WriteAllBytes による直接保存

確認したこと

  • 2022.3でテストが通ること
  • 2022.3でシェーダーを意図的に変更し、テストがコケて画像が出力されること
  • 6000.3でコンパイルエラーが出ず、テストが動くこと

Comment thread Assets/Tests/Runtime/Internal/TestUtility.cs
@sakumanaoki
sakumanaoki merged commit 790fc60 into main Apr 2, 2026
1 check passed
@sakumanaoki
sakumanaoki deleted the bugfix/unity_6003_error branch April 2, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants