在哪里可以找到 NUnit 控制台退出代码的含义?

发布于 2024-09-26 19:24:17 字数 124 浏览 6 评论 0原文

我从 MSBuild 收到错误消息:

“nunit-console.exe”退出,代码为 -100。

在哪里可以找到 NUnit 控制台退出代码的含义?

I am getting error message from my MSBuild:

"nunit-console.exe" exited with code -100.

Where can the meaning of the NUnit console exit codes be found?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

岁月蹉跎了容颜 2024-10-03 19:24:17

错误代码-100代表UNEXPECTED_ERROR

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

编辑:
来自NUnit-Discuss google 群组上的帖子< /a>:

此外,正值给出
运行中失败的测试计数。

-100 返回码是一个包罗万象的,
通常表示未处理的
您的应用程序或测试中出现异常。
它通常应该带有一个堆栈
跟踪。

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.

↙温凉少女 2024-10-03 19:24:17

NUnit v3 的一个小更新,TRANSFORM_ERROR 代码似乎已被删除。

完整列表现在如下:

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;

其源当前位于 这里

更新:五年过去了,我们终于 记录这些。万岁!

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.

UPDATE: Five years on, we finally documented these. Hooray!

你的他你的她 2024-10-03 19:24:17

对于那些在 OP 发布多年后看到这一点的人来说,这些价值观已经发生了一次又一次的改变。在 3.8 中,有一个 -5 Unload Exception,它确实很容易捕获(当 NUnit 遇到卸载程序集的问题时)。 3.10 中似乎-5 消失了。也许程序集卸载问题不再出现。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文