How to integrate MSpec with 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 "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 集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将 MSpec 与 MS Build 集成?


- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 输入按键事件处理程序 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01