问题描述
几天前,我观看了 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 "web" --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 集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!