Does anyone know where to find NUnit console exit codes meanings?

回眸只為那壹抹淺笑 提交于 2019-12-18 18:48:57

问题


I am getting error message from my MSBuild: "nunit-console.exe" exited with code -100.

Does anyone know where NUnit console exit codes meanings can be found?


回答1:


Error code -100 stands for UNEXPECTED_ERROR

static ConsoleUi()
{
    OK = 0;
    INVALID_ARG = -1;
    FILE_NOT_FOUND = -2;
    FIXTURE_NOT_FOUND = -3;
    TRANSFORM_ERROR = -4;
    UNEXPECTED_ERROR = -100;
}

EDIT: Additional information from a thread on the NUnit-Discuss google group:

Additionally, positive values give a count of failed tests in the run.

The -100 return code is a catch-all, usually indicating an unhandled exception in your application or test. It should normally come with a stack trace.




回答2:


A minor update as of NUnit v3, the TRANSFORM_ERROR code appears to have been removed.

The full list now stands as:

OK = 0;
INVALID_ARG = -1;
INVALID_ASSEMBLY = -2;
FIXTURE_NOT_FOUND = -3;       //Reserved, but not in use since v3.0
INVALID_TEST_FIXTURE = -4;    //From v3.4
UNEXPECTED_ERROR = -100;

The source for this is currently located here.




回答3:


For those looking at this a number of years after the OP, these values have changed and changed again. In 3.8, there is a -5 Unload Exception, which is really handy to trap (when NUnit encounters a problem Unloading the assemblies). It seems that -5 is gone in 3.10. Perhaps the assembly Unload problem no longer occurs.



来源:https://stackoverflow.com/questions/3889577/does-anyone-know-where-to-find-nunit-console-exit-codes-meanings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!