Domanda

Qualche giorno fa ho visto un BDD screencast di Rob Conery . Nel video ha mostrato come utilizzare MSpec , così ho scaricato e giocato con i bit. Quello che voglio ora è quello di integrare MSpec con MS build, ma io non so come ... io uso TFS Team build del server della CI - Puoi aiutarmi a integrare MSpec con MSBuild?

Grazie!

È stato utile?

Soluzione

Al momento il modo più semplice è quello di Exec proprio questo.

 <Target Name="RunSpecs">
    <PropertyGroup>
      <MSpecCommand>
        lib\machine\specifications\Machine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path\to\your\project\bin\Debug\Your.Project.Specs.dll path\to\your\other\project\bin\Debug\Your.Other.Project.dll 
      </MSpecCommand>
    </PropertyGroup>
    <Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
    <Exec Command="$(MSpecCommand)" />
  </Target>

Modifica: Avviso Impostazioni aggiuntive, è possibile chiamare nel bersaglio in questo modo:

    <MSBuild Projects="yourmsbuild.msbuild" Targets="RunSpecs" Properties="AdditionalSettings=-s -t -i &quot;web&quot; --html Specs\Specs.html"/>

Se si passa --teamcity come un argomento che uscite dati TeamCity registro specifico in modo TeamCity seguirà i test.

Machine.Specifications
Copyright (C) 2007, 2008

Usage: mspec-runner.exe [options] <assemblies>
Options:
  -i, --include     Executes all specifications in contexts with these comma delimited tags. Ex. -i "foo,bar,foo_bar"
  -x, --exclude     Exclude specifications in contexts with these comma delimited tags. Ex. -x "foo,bar,foo_bar"
  -t, --timeinfo    Shows time-related information in HTML output
  -s, --silent      Suppress console output
  --teamcity        Reporting for TeamCity CI integration.
  --html <PATH>     Outputs an HTML file(s) to path, one-per-assembly w/ index.html (if directory, otherwise all are in
one file)
  -h, --help        Shows this help message
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top