hmoeller
08-26-2008, 07:43 AM
I added an NUnit task to my build project, pointed it to an NUnit project file and selected "net-2.0" as the target framework. In this case, the build project doesn't report a failure on failing unit tests anymore.
The reason is simple. As long as you don't specify a framework, the command line generated looks like this:
"C:\Program Files\NUnit-Net-2.0 2.2.10\bin\NUnit-console.exe" /nologo nunit.project
Everything works fine here. But as soon as you specify a target framework, the command line is generated in a different way:
C:\WINDOWS\system32\cmd.exe /C clr net-2.0 nunit-console /nologo nunit.project
Unfotunately, the error code returned by nunit-console is not propagated by clr or doesn't make it through cmd.exe. The exit code in this case is always 0, leading to a passed build step.
The reason is simple. As long as you don't specify a framework, the command line generated looks like this:
"C:\Program Files\NUnit-Net-2.0 2.2.10\bin\NUnit-console.exe" /nologo nunit.project
Everything works fine here. But as soon as you specify a target framework, the command line is generated in a different way:
C:\WINDOWS\system32\cmd.exe /C clr net-2.0 nunit-console /nologo nunit.project
Unfotunately, the error code returned by nunit-console is not propagated by clr or doesn't make it through cmd.exe. The exit code in this case is always 0, leading to a passed build step.