如何将 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 集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

MSBuild cannot find a reference(MSBuild 找不到参考)
The reference assemblies for framework .NETCore, Version=v5.0 were not found(未找到框架 .NETCore,Version=v5.0 的参考程序集)
quot;File has a different computed hash than specified in manifestquot; error when signing the EXE(“文件的计算哈希值与清单中指定的不同签署EXE时出错)
Good-practices: How to reuse .csproj and .sln files to create your MSBuild script for CI?(良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 MSBuild 脚本?)
Run an MSBuild target only if project is actually built(仅在实际构建项目时运行 MSBuild 目标)
MS-Build BeforeBuild not firing(MS-Build BeforeBuild 未触发)