views:

172

answers:

1

The CruiseControl.Net documentation advises against using the NUnit task, suggesting instead that NUnit is called within the build script.

I'm trying to work out what is the best way to achieve this.

I've added a 'RunTests' project to my solution which uses the NUnit MSBuild Community Task to execute the tests.

I wanted to add a 'Test' target to this project so that I could run MSBuild against the whole solution with the targets "Build;Test". However, MSBuild didn't like this, reporting thet the solution didn't include a Test target.

What should I be doing? I'm not entirely clear why CruiseControl.Net suggests we don't use the NUnit task. If I do wrap up the calls to NUnit within a MSBuild project, I'm not entirely sure if I should be calling MSBuild twice from CC.Net (once to build everything and once to call the test). If I should be combining the Build and Test within one call to MSBuild, how do I achieve this?

Any tips gratefully received.

Sandy

+1  A: 

There is no reason why you can't have several calls to MSBuild from your ccnet project. In our projects, we have the first call to MSBuild compile the code. The second call uses an MSBuild script that runs our unit tests and code analysis.

Pedro
Thanks Pedro, this is what I'd ended up doing.
sandy