如何将 MSpec 与 MS Build 集成?

How to integrate MSpec with MS Build?(如何将 MSpec 与 MS Build 集成?)
本文介绍了如何将 MSpec 与 MS Build 集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我观看了 BDD 截屏视频http://blog.wekeroad.com/" rel="noreferrer">Rob Conery.在视频中,他展示了如何使用 MSpec,所以我下载了它并玩了一下.我现在想要的是整合 MSpec 与 MS Build,但我不知道如何...我使用 TFS 团队构建作为我的 CI 服务器 - 你能帮我集成 MSpec 与 MSBuild?

Few days ago I watched a BDD screencast by Rob Conery. In the video he showed how to use MSpec, so I downloaded it and played with the bits. What I want now is to integrate MSpec with MS Build, but I don't know how... I use TFS team build as my CI server - Can you help me to integrate MSpec with MSBuild?

谢谢!

推荐答案

目前最简单的方法就是执行它.

At the moment the easiest way is to just Exec it.

 <Target Name="RunSpecs">
    <PropertyGroup>
      <MSpecCommand>
        libmachinespecificationsMachine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path	oyourprojectinDebugYour.Project.Specs.dll path	oyourotherprojectinDebugYour.Other.Project.dll 
      </MSpecCommand>
    </PropertyGroup>
    <Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
    <Exec Command="$(MSpecCommand)" />
  </Target>

注意附加设置,您可以像这样调用目标:

Notice Additional Settings, you can call into the target like this:

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

如果您将 --teamcity 作为参数传递,它会输出特定于 teamcity 的日志数据,以便 TeamCity 跟踪您的测试.

If you pass --teamcity as an argument it outputs teamcity specific log data so TeamCity will track your tests.

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

这篇关于如何将 MSpec 与 MS Build 集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)