MSpec を MS Build と統合するにはどうすればよいですか?
-
06-09-2019 - |
質問
数日前に私はある番組を見ました BDD スクリーンキャスト による ロブ・コナリー. 。ビデオで彼は使い方を示しました Mスペック, ということで、ダウンロードしてビットで遊んでみました。私が今望んでいるのは統合することです Mスペック MS Build を使用するのですが、方法がわかりません...TFS チーム ビルドを CI サーバーとして使用しています - 統合を手伝ってもらえますか Mスペック MSBuild では?
ありがとう!
解決
現時点で最も簡単な方法は、単に実行することです。
<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 "web" --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
所属していません StackOverflow