Use NAnt to run mbunit tests using gallio

1 Dic

Gallio has a great build-in support for NAnt!
Unfortunately at the moment this is not well document so if you need to create a target to execute all tests inside an assembly you can write this xml fragment inside your NAnt project file:

<target name=”test” depends=”build”>
    failonerror=”false” >
    <runner-extension value=”TeamCityExtension,Gallio.TeamCityIntegration” />
      <!– Specify the tests assemblies –>
      <include name=”${src.dir}Data.Fixturebin${project.config}Data.Fixture.dll”/>
  <fail if=”${exitCode != ‘0’}” >One or more tests failed. Please check the log for more details</fail>   

don’t forget to load Gallio NAnt Tasks before start with this line of xml

<loadtasks assembly=”.toolsGallioGallio.NAntTasks.dll” />

If you need more information you can take a look at comment in the source code here

Technorati Tag: ,,

7 Risposte to “Use NAnt to run mbunit tests using gallio”

  1. Jeff Brown dicembre 1, 2008 a 9:16 pm #

    Some more info here:

    Would you be interested in contributing a chapter to the Gallio book about setting up Gallio for use with NAnt?

  2. Jeff Brown settembre 2, 2009 a 9:13 am #

    Note that in v3.1 the “assemblies” element has been renamed to “files” since Gallio now supports running test files of other kinds, such as RSpec tests.

  3. Jeff Brown settembre 2, 2009 a 9:14 am #

    Here’s an updated link to the API docs in case anyone stumbles on this post:

  4. Jeff Brown settembre 2, 2009 a 9:19 am #

    Last comment… the TeamCity integration extension no longer needs to be added manually. Gallio v3.1 will automatically detect when it is running as part of a TeamCity build process. 🙂

  5. Robz settembre 20, 2009 a 3:41 pm #

    I created a universal NAnt script for Gallio.

    The only thing I need to figure out is how to get Gallio into source control of each project without a 26.4MB hit. I tried putting only GallioNAntTasks.dll and Gallio.dll into source, but it kept running into errors. When I point to the full install, I’m golden.

    • Jeff Brown settembre 27, 2009 a 7:17 pm #

      You need to include all of the relevant plugins and their files. We have some work in progress on a tool (Gallio.Copy) that will make it easy to copy a subset of Gallio into a directory of your choice.

      If you look inside the *.plugin file, you’ll find the list of all of the files that the plugin requires. For your purposes you probably need the following plugins: Gallio, NAnt, MbUnit.

      • Jeff Brown settembre 27, 2009 a 8:13 pm #

        Oops, you probably need the Gallio.Reports plugin too.


Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:


Stai commentando usando il tuo account Chiudi sessione /  Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )


Connessione a %s...

%d blogger hanno fatto clic su Mi Piace per questo: