Search Unity

Question Profiling code in Test Runner

Discussion in 'Testing & Automation' started by GilesDMiddleton, Dec 27, 2017.

  1. GilesDMiddleton

    GilesDMiddleton

    Joined:
    Aug 12, 2015
    Posts:
    91
    I have been a good citizen, and pushed much of my code into testable components.
    I'm currently testing my AI routines fully via Unit Tests and unity's Test Runner. And noticed it's very slow, so decided to profile where the CPU is being used.

    I've tried to use the profiler (2017.1.0p5 personal, macOS), and can't see any of for my code in the resulting window.
    I've tried deep profiling & ensuring the editor is profiled (as the game isn't running when the tests are running), i've also tried putting BeginSample and EndSample calls in the [Test] code, but still no results in my window.
    The profiler does appear to stall (the whole UI is blocked) while tests are running, and then continue afterwards - does it not collect while running tests? Is there one specific frame I need to go to, to see my profile information? Do I need to signal a frame movement to assist the profiler?

    What am I doing wrong?
     
    AcademyOfFetishes likes this.