2012-06-05 101 views
1

我已經集成了巡航控制的連續構建過程。在EOD中,它會生成構建報告。如果任何NUnit測試用例失敗,則構建失敗。我們寫了一個特定的測試用例,並將其添加到單獨的dll中。如果該程序集中的任何測試用例失敗,我們不希望我們的構建失敗。我們使用MSBuild目標,.proj文件和巡航控制,ccnet配置文件。即使一個特定的NUnit測試失敗,MSBuild也不會失敗

回答

1

我會兩次調用NUnit:一次爲了測試你想失敗的構建如果沒有通過,那麼第二次運行測試的結果你不想影響構建,例如,

<!-- Any failing tests in Assembly1.dll will cause the build to fail. --> 
<Exec Command="nunit.exe Assembly1.dll" /> 

<!-- Any failing tests in Assembly2.dll won't fail the build because the ContinueOnError attribute is set to True. --> 
<Exec Command="nunit.exe Assembly2.dll" ContinueOnError="True" /> 
+1

如果有任何測試失敗,則將ContinueOnError設置爲true將執行該程序集中剩餘的測試。但是Build仍然失敗,因爲我的測試失敗了。所以ContinueInError = true不起作用 – user660232

相關問題