views:

200

answers:

2

Can someone please tell me why my build script (nant) doesn't display the unit test details in the command prompt window? I have verbose set to true, but it doesn't want to display any details about my unit tests. Here's the target:

<target name="run-unit-tests" depends="compile, move.assemblies.for.tests, rebuildDatabase">
     <mkdir dir="${tests.output.dir}" />

     <nunit2 haltonfailure="true" failonerror="true" verbose="true">
      <formatter type="Xml" extension=".xml" outputdir="${tests.output.dir}" usefile="true" />
      <test assemblyname="${test.assembly.file}" />
     </nunit2>
    <echo message="Unit Testing Done!" />
    </target>

The command prompt window just displays this:

[mkdir] Creating directory 'C:\Projects\TestProject\build\artifacts\UnitTestOutput'.
[echo] Unit Testing Done!
build:
BUILD SUCCEEDED

Am I missing something here?

Thanks!

A: 

Is there a log file in ${tests.output.dir} ? If so, what if you set usefile to false and type to "Plain"?

JeffH
+1  A: 

I found the answer. I looked at the source for CodeCampServer and saw a line

<formatter type="Plain" />

and added it to my build script so it looks like this:

<nunit2 haltonfailure="true" failonerror="true" verbose="true">
      <formatter type="Xml" extension=".xml" outputdir="${tests.output.dir}" usefile="true" />
      <formatter type="Plain" />
      <test assemblyname="${test.assembly.file}" />
     </nunit2>

and now it displays the details.

Sorry to ask the question prematurely on here, but at least it might help someone in the future if they have a similar problem.

Chris Conway