2009-06-02 2 views
10

몇 일 전 BDD screencast을 (를) Rob Conery (으)로 보았습니다. 동영상에서 그는 MSpec을 사용하는 방법을 보여 주었기 때문에 다운로드하여 비트로 연주했습니다. 지금 내가 원하는 것은 MSpec을 MS Build와 통합하는 것입니다. 그러나 어떻게 ... TFS 팀을 CI 서버로 사용합니까? MSpec을 MSBuild와 통합하는 데 도움을 줄 수 있습니까?MS 빌드와 MSpec을 통합하는 방법은 무엇입니까?

감사합니다.

답변

7

가장 쉬운 방법은 바로 실행하는 것입니다.

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

편집 : 공지 사항 추가 설정, 당신은 다음과 같은 목표로 호출 할 수 있습니다 : 인수로 --teamcity 전달하는 경우 인 TeamCity는 테스트를 추적 할 수 있도록

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

그것은 인 TeamCity 특정 로그 데이터를 출력 . 당신은 NAnt 사용 인수 라인 = "assembly1의 assembly2"로이 일을하지 않을 때 인수 값 (그렇지 않으면 당신은 매우 비 분명 멋진 오류가 발생합니다) 것을

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

주 – Neal

관련 문제