No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UnityTestProtocolStarter.cs 815B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Linq;
  3. using UnityEditor.Compilation;
  4. using UnityEditor.TestTools.TestRunner.Api;
  5. using UnityEngine;
  6. using UnityEngine.TestTools;
  7. namespace UnityEditor.TestTools.TestRunner.UnityTestProtocol
  8. {
  9. [InitializeOnLoad]
  10. internal static class UnityTestProtocolStarter
  11. {
  12. static UnityTestProtocolStarter()
  13. {
  14. var commandLineArgs = Environment.GetCommandLineArgs();
  15. if (commandLineArgs.Contains("-automated") && commandLineArgs.Contains("-runTests")) // wanna have it only for utr run
  16. {
  17. var api = ScriptableObject.CreateInstance<TestRunnerApi>();
  18. var listener = ScriptableObject.CreateInstance<UnityTestProtocolListener>();
  19. api.RegisterCallbacks(listener);
  20. }
  21. }
  22. }
  23. }