前几天我看了一个 BDD 截屏视频 经过 罗布·康纳利. 。在视频中他展示了如何使用 M规格, ,所以我下载了它并玩了一下。我现在想要的是整合 M规格 使用 MS Build,但我不知道如何...我使用 TFS team build 作为我的 CI 服务器 - 你能帮我集成吗 M规格 与 MSBuild?

谢谢!

有帮助吗?

解决方案

目前最简单的方法是只EXEC它。

 <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>

编辑:通知其他设置,则可以调用到这样的目标:

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

如果您通过--teamcity作为参数,它输出的TeamCity特定的日志数据,这样的TeamCity将跟踪你的测试。

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top