Exemplo n.º 1
0
 public virtual void Setup()
 {
     m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
     World           = World.DefaultGameObjectInjectionWorld = new World("Test World");
     m_Manager       = World.EntityManager;
     m_ManagerDebug  = new EntityManager.EntityManagerDebug(m_Manager);
 }
Exemplo n.º 2
0
        public virtual void Setup()
        {
            // Redirect Log messages in NUnit which get swallowed (from GC invoking destructor in some cases)
            // System.Console.SetOut(NUnit.Framework.TestContext.Out);

            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
#if !UNITY_DOTSPLAYER
            World = World.DefaultGameObjectInjectionWorld = new World("Test World");
#else
            Unity.Burst.DotsRuntimeInitStatics.Init();
            World = DefaultTinyWorldInitialization.Initialize("Test World");
#endif

            m_Manager      = World.EntityManager;
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);

            _systems.Clear();

#if !UNITY_DOTSPLAYER
#if !UNITY_2019_2_OR_NEWER
            // Not raising exceptions can easily bring unity down with massive logging when tests fail.
            // From Unity 2019.2 on this field is always implicitly true and therefore removed.

            UnityEngine.Assertions.Assert.raiseExceptions = true;
#endif  // #if !UNITY_2019_2_OR_NEWER
#endif  // #if !UNITY_DOTSPLAYER
        }
Exemplo n.º 3
0
    public virtual void Setup()
    {
        _previousWorld = World.Active;
        _world         = World.Active = new World("Test World");

        _entityManager = _world.GetOrCreateManager <EntityManager>();
        _managerDebug  = new EntityManager.EntityManagerDebug(_entityManager);
    }
Exemplo n.º 4
0
        public virtual void SetUp()
        {
            previousWorld = World.DefaultGameObjectInjectionWorld;
            world         = World.DefaultGameObjectInjectionWorld = new World("Test World");

            manager      = world.EntityManager;
            managerDebug = new EntityManager.EntityManagerDebug(manager);
        }
Exemplo n.º 5
0
        public virtual void SetUp()
        {
            PreviousWorld = World.Active;
            World         = World.Active = new World("Test World");

            EntityManager = World.EntityManager;
            ManagerDebug  = new EntityManager.EntityManagerDebug(EntityManager);
        }
Exemplo n.º 6
0
        public virtual void Setup()
        {
            m_PreviousWorld = World.Active;
            World           = World.Active = new World("Test World");

            m_Manager      = World.GetOrCreateManager <EntityManager>();
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);
        }
Exemplo n.º 7
0
        public virtual void Setup()
        {
            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
            World           = World.DefaultGameObjectInjectionWorld = new World("Test World");
            m_Manager       = World.EntityManager;
            m_ManagerDebug  = new EntityManager.EntityManagerDebug(m_Manager);

            World.GetOrCreateSystem <EntityForEachSystem>();
        }
Exemplo n.º 8
0
        protected virtual void SetUp()
        {
            World = new World("Test World");

            m_Manager      = World.EntityManager;
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);

            m_AnimationGraphSystem = World.GetOrCreateSystem <PreAnimationGraphSystem>();
            m_AnimationGraphSystem.AddRef();
        }
Exemplo n.º 9
0
        public virtual void Setup()
        {
            // Redirect Log messages in NUnit which get swallowed (from GC invoking destructor in some cases)
            // System.Console.SetOut(NUnit.Framework.TestContext.Out);

            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
            World           = World.DefaultGameObjectInjectionWorld = new World("Test World");

            m_Manager      = World.EntityManager;
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);
        }
Exemplo n.º 10
0
        protected virtual void SetUp()
        {
            _previousWorld = World.Active;

            _world = World.Active = new World("ECS Test World");

            _manager = _world.EntityManager;

            _managerDebug = new EntityManager.EntityManagerDebug(_manager);

            UnityEngine.Assertions.Assert.raiseExceptions = true;
        }
        public virtual void Setup()
        {
            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
            World           = World.DefaultGameObjectInjectionWorld = new World("Test World");
            m_Manager       = World.EntityManager;
            m_ManagerDebug  = new EntityManager.EntityManagerDebug(m_Manager);
#if !UNITY_DOTSPLAYER
            // Many ECS tests will only pass if the Jobs Debugger enabled;
            // force it enabled for all tests, and restore the original value at teardown.
            JobsDebuggerWasEnabled         = JobsUtility.JobDebuggerEnabled;
            JobsUtility.JobDebuggerEnabled = true;
#endif
        }
Exemplo n.º 12
0
        public virtual void Setup()
        {
            m_PreviousWorld = World.Active;
            World           = World.Active = new World("Test World");

            m_Manager      = World.GetOrCreateManager <EntityManager>();
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);


            // not raising exceptions can easily bring unity down with massive logging,
            // when tests fail.
            UnityEngine.Assertions.Assert.raiseExceptions = true;
        }
Exemplo n.º 13
0
        public virtual void Setup()
        {
            PreviousWorld = World.DefaultGameObjectInjectionWorld;
            World         = World.DefaultGameObjectInjectionWorld = new World("Test World");

            EntityManager      = World.EntityManager;
            EntityManagerDebug = new EntityManager.EntityManagerDebug(EntityManager);

            World.GetOrCreateSystem <BeginInitializationEntityCommandBufferSystem>();
            World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
            World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>();
            World.GetOrCreateSystem <EndSimulationEntityCommandBufferSystem>();
            World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
        }
Exemplo n.º 14
0
        public virtual void Setup()
        {
            m_PreviousWorld = World.Active;
            World           = World.Active = new World("Test World");

            m_Manager      = World.GetOrCreateManager <EntityManager>();
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);

#if !UNITY_2019_2_OR_NEWER
            // Not raising exceptions can easily bring unity down with massive logging when tests fail.
            // From Unity 2019.2 on this field is always implicitly true and therefore removed.

            UnityEngine.Assertions.Assert.raiseExceptions = true;
#endif
        }
        public void Setup()
        {
            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
            const string kTestWorldName = "Test World";

#if UNITY_DOTSPLAYER
            // Tiny always runs outside of process from the Editor, as such we need to
            // invoke the tiny bootstrapping for worlds manually
            World = DefaultWorldInitialization.Initialize(kTestWorldName);
#else
            World = World.DefaultGameObjectInjectionWorld = new World(kTestWorldName);
#endif

            m_Manager      = World.EntityManager;
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);
        }
        public virtual void Setup()
        {
#if !UNITY_DOTSRUNTIME
            // unit tests preserve the current player loop to restore later, and start from a blank slate.
            m_PreviousPlayerLoop = PlayerLoop.GetCurrentPlayerLoop();
            PlayerLoop.SetPlayerLoop(PlayerLoop.GetDefaultPlayerLoop());
#endif
            m_PreviousWorld = World.DefaultGameObjectInjectionWorld;
            World           = World.DefaultGameObjectInjectionWorld = new World("Test World");
            m_Manager       = World.EntityManager;
            m_ManagerDebug  = new EntityManager.EntityManagerDebug(m_Manager);

            // Many ECS tests will only pass if the Jobs Debugger enabled;
            // force it enabled for all tests, and restore the original value at teardown.
            JobsDebuggerWasEnabled         = JobsUtility.JobDebuggerEnabled;
            JobsUtility.JobDebuggerEnabled = true;
        }
Exemplo n.º 17
0
        public virtual void Setup()
        {
            m_PreviousWorld = World.Active;
#if !UNITY_DOTSPLAYER
            World = World.Active = new World("Test World");
#else
            World = DefaultTinyWorldInitialization.Initialize("Test World");
#endif

            m_Manager      = World.EntityManager;
            m_ManagerDebug = new EntityManager.EntityManagerDebug(m_Manager);

#if !UNITY_DOTSPLAYER
#if !UNITY_2019_2_OR_NEWER
            // Not raising exceptions can easily bring unity down with massive logging when tests fail.
            // From Unity 2019.2 on this field is always implicitly true and therefore removed.

            UnityEngine.Assertions.Assert.raiseExceptions = true;
#endif  // #if !UNITY_2019_2_OR_NEWER
#endif  // #if !UNITY_DOTSPLAYER
        }