32

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
DarkDeny
  • 1,750
  • 2
  • 21
  • 31

3 Answers3

59

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.

skolima
  • 31,963
  • 27
  • 115
  • 151
Julien Hoarau
  • 48,964
  • 20
  • 128
  • 117
  • Hmmm, I get -1 even though the runner runs and says nothing about an invalid arg...The source doesn't tell me either, tbh – flq Mar 09 '11 at 13:16
  • Same here, our unit tests have been running fine in our continuous integration server fine, until recently (unfortunately I can;t identify what checking caused the issue) – Nathan Tregillus Jun 10 '13 at 15:54
  • 8
    I just found out (the hard way) that Error Code -2147023895 stands for StackOverflowException. – binco Jun 12 '13 at 20:04
14

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!

Chris
  • 5,882
  • 2
  • 32
  • 57
2

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.

auser8y
  • 72
  • 4