Search Unity

Resolved Getting return code from standalone player

Discussion in 'Testing & Automation' started by hassanbot, Sep 17, 2019.

  1. hassanbot

    hassanbot

    Joined:
    Sep 16, 2018
    Posts:
    9
    Hi!

    I'm trying to set up a CI pipeline for my project, and I'd like it to have one build step, and then another step where I make sure the finished build can start and run for a few seconds without errors. This is mainly a sanity test to make sure that it can start on an isolated machine (I'm using a Windows docker for this).

    I've made it so I can pass in a command line argument to make the application close down after a set amount of time, so it can be started something like this: UnityApp.exe -stopAfter 5 -batchmode -nographics

    The problem I'm having is that I don't know how to get the return code of the player. When I'm starting the application using the command prompt, the application immediately detaches and returns 0, while it continues to run as a background process. I'd like it to keep being attached to the command prompt so I can capture the return code when it exits.

    Anyone know if this can be done?

    Thanks,
    Martin
     
    Last edited: Sep 17, 2019
  2. hassanbot

    hassanbot

    Joined:
    Sep 16, 2018
    Posts:
    9
    Sorry, I'm stupid, it's a Windows thing. If you start the application from a .bat script it won't detach.