views:

221

answers:

2

Hi Everyone,

I got stuck up when I tried to run the Unit Test written using mbunit from NAnt. when I tried this lines of code in NAntbuilder.

<mbunit 
    report-types="Html;Xml;Text"
    report-filename-format="${test_results.file}"
    report-output-directory="${test_results.directory}"
    halt-on-failure="true"
    failonerror="true">
  <assemblies>
    <include name="${build.directory}\*Test*dll" />
  </assemblies>
</mbunit >

I got an error message

BUILD FAILED

./.../mbunit.build(26,5):

Invalid element <mbunit>. Unknown task or datatype.

I have copied the mbunit.framework.dll, quickgraphalgorithm.dll,quickgraph.dll to NAnt's bin folder.

Could you please any of you help me out to run the mbunit test from NAnt.

Thanks in Advance,

Ganesh

A: 

This blog post about MbUnit & NAnt lists the assemblies you need to copy to the NAnt bin directory. As far as I can understand from your post you also need:

  • MbUnit.Core.dll
  • MbUnit.Tasks.dll
Halvard
Thanks for your comment, I have copied the MbunitTasks.dll but coudnt find Mbunitcore.dll, after copying that file also I am getting the same error.
Ganesh Astroved
It seems in the latest version of MbUnit the MbUnit.Core dll is built into MbUnit.Framework dll, so then you should have everything you need (and I'm out of suggestions).
Halvard
Last shot: Do you have a <loadtasks assembly="c:foo\MbUnit.Framework.dll" /> in your build file? See http://nant.sourceforge.net/release/latest/help/tasks/loadtasks.html for NAnt documentation on the <loadtasks> task.
Halvard
Even this not worked, I have tried the same.
Ganesh Astroved
You actually want to use <loadtasks assembly="c:\foo\MbUnit.Tasks.dll" /> since the Tasks assembly is the one that actually contains the NAnt tasks.
Jeff Brown
A: 

I'm using the latest Gallio framework to run mbUnit tests from Nant, but there's no MbUnit.Tasks.dll file in that package. There's a Gallio.NAntTasks.dll file, but Nant complains that there was a "Failure scanning Gallio.NAntTasks.dll for extensions. Unable to load one or more of the requested types."

jazmatician