Running both 32 bit and 64 bit unit test in TFS 2010
My project has both 32 bit and 64 bit components. THey have both managed and unmanaged components. I 开发者_开发百科need to run unit test for both configuration. I also have separate set of different test files to deploy for each configuration, so I've been using deployment item using .testrunconfig. I saw you can force it to run in 32 bit or run in 64 bit is the machine is 64 bit. I suppose I could create 2 build definition one for 32 bit and 64 bit, but if it's possible I rather have one.
So is there a way to accomplish this with one build configuration ? How do you conditionally set the deployment item based on the configuration ?
Since you already have two different .testrunconfig files that specify the deployment items as well as whether tests should run in 32bit or 64 bit environment, you can add a second test to your build by editing your build definition from Visual Studio, choosing the Process tab and selecting the little "..." button to edit your tests (assuming you're using the Default Template). This will open the Automated Tests dialog window where you can add your tests a second time and specify your second testrunconfig.
IIRC if you're building multiple configurations/platforms in your Items to Build specification, this method will run all tests for all configurations, which may or may not be what you want. To run your x86 binaries in 32 bit test environment, and your x64 binaries in 64 bit, you will have to edit the Build process template accordingly.
精彩评论