Hiện tại, cách dễ nhất là chỉ cần 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>
Edit: Thông báo Cài đặt bổ sung, bạn có thể gọi vào mục tiêu như thế này:
<MSBuild Projects="yourmsbuild.msbuild" Targets="RunSpecs" Properties="AdditionalSettings=-s -t -i "web" --html Specs\Specs.html"/>
Nếu bạn vượt qua --teamcity như một tham số nó ra dữ liệu log cụ thể TeamCity để TeamCity sẽ theo dõi các bài kiểm tra của bạn .
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
Nguồn
2009-06-02 15:25:24
Lưu ý rằng khi bạn đang làm điều này với việc sử dụng không sử dụng arg line = "assembly1 assembly2" không arg giá trị (nếu không bạn sẽ nhận được lỗi tốt không rõ ràng) – Neal