Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "yield return new WaitForEndOfFrame()" never returns in batchmode?

I am trying to write integration tests by using unity test tools package.

Tests run without problem in the editor (in play mode).

But when I try to run the integration test from the command line (in batchmode) WaitForEndOfFrame coroutine never returns.

Is this a known issue or am I missing something?

I am using the below command to run the tests:

 /Applications/Unity-5.3.1-f1/Unity.app/Contents/MacOS/Unity \
  -batchmode \
  -nographics \
  -logfile \
  -projectPath $(pwd) \
  -executeMethod UnityTest.Batch.RunIntegrationTests \
  -testscenes=TestScene \
  -resultsFileDirectory=$(pwd)
like image 601
ilkinulas Avatar asked Mar 01 '16 06:03

ilkinulas


Video Answer


1 Answers

Unity doesn't update frames in the Editor when in Batch Mode. From their documentation:

  • You cannot use WaitForEndOfFrame when running the Editor with -batchmode, because systems like animation, physics and timeline might not work correctly in the Editor. This is because Unity does not currently update these systems when using WaitForEndOfFrame.
like image 175
House Avatar answered Oct 06 '22 23:10

House