Search Unity

How to update all systems for a Unit Test?

Discussion in 'Entity Component System' started by GarthSmith, Sep 26, 2018.

  1. GarthSmith

    GarthSmith

    Joined:
    Apr 26, 2012
    Posts:
    1,240
    Hello, fellow Unity forum members!

    Does anyone know how to update all systems in a World for a unit test? This would let us test some complex interactions between systems.

    We can update a single system easily. But I would like to update all systems and barriers in the same order that Unity would normally run them.

    Has anyone figured out how to update an entire World's worth of systems at once? Thanks for any help!

    - Garth
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Running all systems isn't really the idea behind unit tests. I suggest making a utility method that updates the systems necessary for your game play.
     
    GarthSmith likes this.
  3. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    Yeah I've just either manually called update or wrapped them in a function call like @Joachim_Ante said. Seems to work just fine and probably has less overhead than trying to simulate the full player loop