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

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:
    http://www.gallio.org/api/html/T_Gallio_NAntTasks_GallioTask_Members.html

    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:
    http://www.gallio.org/api/html/T_Gallio_NAntTasks_GallioTask.htm

  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. http://ferventcoder.com/archive/2009/09/20/universal-nant-script-for-gallio.aspx

    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 #

      @Robz
      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.

Lascia un commento

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

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. 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 )

Google+ photo

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

Connessione a %s...

%d blogger cliccano Mi Piace per questo: