views:

58

answers:

2

Using Visual Studio 2010, is there a way to run all unit tests in a solution automatically after building the solution locally?

+1  A: 

You could record a macro to do it. In the macro, you would run the build and then start the unit tests. Then you could just run the macro to do it all in one step. Check Tools->Macros for more details.

EDIT You can also record keyboard shortcuts for the macros, and I think you can use existing key sequences, such as CTRL-SHIFT-B for build. So if you wanted to override the default behavior of CTRL-SHIFT-B, this would be one way.

dcp
I would prefer to not affect how we build when we are developing. In other words, I want the unit tests to run when a developer compiles a solution via Build -> Build Solution.
Rick D
@Rick D - As far as I know, there's no way to alter the behavior of Build->Build Solution.
dcp
@Rick D - However, see my latest edit for a partial solution.
dcp
Thanks dcp... looks like the way to go.
Rick D
A: 

You could also try this addon: http://ox.no/software/continuoustesting

slamidtfyn
@slamidtfyn - I like this solution, but, it seems that it will only run the unit test from the first test project (assembly) that it finds (atleast that's what it appears to be doing).
Rick D
Didn't know that sorry. That must be an issue in a lot of cases.
slamidtfyn