CallbackInitializer.cs 444 B

123456789101112131415161718
  1. #if TEST_FRAMEWORK
  2. using UnityEditor;
  3. using UnityEditor.TestTools.TestRunner.Api;
  4. using UnityEngine;
  5. namespace Packages.Rider.Editor.UnitTesting
  6. {
  7. [InitializeOnLoad]
  8. internal static class CallbackInitializer
  9. {
  10. static CallbackInitializer()
  11. {
  12. if (CallbackData.instance.isRider)
  13. ScriptableObject.CreateInstance<TestRunnerApi>().RegisterCallbacks(ScriptableObject.CreateInstance<TestsCallback>(), 0);
  14. }
  15. }
  16. }
  17. #endif