Ensure that program exited with expected exit code.
message to throw in exception in case of check failure
if set to True, then output of command will be attached to message on failure.
expected exit-code, if differ, then exception will be thrown.
See Implementation
Ensure that program exited with expected exit code.