使用Nunit为多个测试程序集设置Jenkins

时间:2013-07-05 09:59:34

标签: jenkins

我有多个测试程序集,如Test-A.dll,Test-B.dll,Test-C.dll,其中包含Nunit测试用例。 我的问题是如何为这些程序集设置这些Nunit测试用例,包括测试 - * .dll

等通配符。

1 个答案:

答案 0 :(得分:1)

根据TeamCity功能的this问题,而不是NUnit功能。因此,除非你编写一些自定义解决方案,否则你无法使用Jenkins。

编辑:我使用了以下Powershell步骤:

$tests = ''
Get-ChildItem -path "." -Recurse -Include "Test*.dll" | Where-Object {$_.DirectoryName -Match ".*\\bin\\Debug"} | foreach {$tests += ($_.toString() -ireplace ([regex]::Escape($env:WORKSPACE) + '\\'), ' ')}
$env:COMPLUS_Version='v4.0.30319'
Invoke-Expression "c:\PrivateWS\resources\NUnit-2.6.3\bin\nunit-console.exe $tests /result:nunit-result.xml"