Search Unity

Standalone test from command line

Discussion in 'Testing & Automation' started by beatt22, Apr 15, 2020.

  1. beatt22

    beatt22

    Joined:
    May 31, 2016
    Posts:
    6
    I am trying to run a set of StandAlone64 unit tests from the command line.

    i set -testPlatform to StandAloneWindows64 i also set the -testresults to output to an XML.

    In my log i see the following on startup. (I have also tested my setup in -batchmode same result).

    upload_2020-4-15_14-2-23.png


    1. After the building player starts building just fine.
    2. I see that my tests are finished.
    However, My standalone player does not close (even in -batchmode).

    I also don't get an XML file with results.

    Has anyone ever got a similar setup to work?
    Any tips?

    Thanks a lot!
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    what is the command line you are using? maybe there's a typo?
     
    beatt22 likes this.
  3. beatt22

    beatt22

    Joined:
    May 31, 2016
    Posts:
    6
    I generate the string from a method with testPlatform as a parameter.
    My -testPlatform editmode & -testPlatform playmode work just fine.
    Do you(by any chance) have any experience with a similar setup to mine that works?

    The string comes down to -projectPath "my project path" - runTests - testResults "path for my XML" -testPlatform
    StandaloneWindows64 -logFile "logfilePath".

    Thanks for answering btw :)
     
  4. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,652
    My guess is that something is failing in the test run but outside of the tests - like after execution has completed - which is preventing the player from exiting and preventing the results from being reported correctly. We do expect the test results file to be created at the path you specified even for playmode tests.

    What does the log file from your player session tell you?
     
  5. beatt22

    beatt22

    Joined:
    May 31, 2016
    Posts:
    6
    Thanks for responding!

    Today I looked over my setup again and some things have changed since then. I was not able to create my initial problem*

    *
    I don't know what exactly triggered it to change sadly.

    This time the standalone build was canceled because of a Unity editor reference. After adding #if Unity_editor everything worked as intended :).

    If I am able to recreate the issue from my initial setup. I'll let you guys know (if its not an error on my side).

    Thank a lot for confirming that everything worked on your side.