From 7e4754a21d47fcc041246f167e129f34a050ff6b Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Wed, 22 Apr 2020 12:03:45 +0200 Subject: [PATCH] Fix running play-mode tests in player I was not able to run play-mode tests using the Zenject.SceneTestFixture in a player (instead of in the Editor) until I removed the restriction to the Editor platform for the Zenject-TestFramework asmdef. It makes kind of sense, as it will be running on other platforms, not in the Editor. I guess the reason for having it there is to prevent Unity from including the test framework in the actual builds. I think this can be acheived as well with adding the "UNITY_INCLUDE_TESTS" constraint. Could you double-check if that works for you? --- .../TestFramework/Zenject-TestFramework.asmdef | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/UnityProject/Assets/Plugins/Zenject/OptionalExtras/TestFramework/Zenject-TestFramework.asmdef b/UnityProject/Assets/Plugins/Zenject/OptionalExtras/TestFramework/Zenject-TestFramework.asmdef index 3f0534c14..c5403801a 100644 --- a/UnityProject/Assets/Plugins/Zenject/OptionalExtras/TestFramework/Zenject-TestFramework.asmdef +++ b/UnityProject/Assets/Plugins/Zenject/OptionalExtras/TestFramework/Zenject-TestFramework.asmdef @@ -6,9 +6,10 @@ "optionalUnityReferences": [ "TestAssemblies" ], - "includePlatforms": [ - "Editor" - ], + "includePlatforms": [], "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file + "allowUnsafeCode": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], +}