简体   繁体   中英

How can I run VS2012 CppUnitTestFramework unit tests from an msbuild script?

I've written a native unit test dll that uses VS2012's CppUnitTestFramework. I can run these tests in the VS2012's IDE in the Test Explorer window.

But, I'd like to also run these tests from our MsBuild script. I guess I need to launch some test runner exe with appropriate command line, but am struggling to find information on this.

Can you help point me in the right direction. Thanks.

The Visual Studio Test Runner is a simple command line tool which needs to be called in order to find and execute the tests. Creating a small msbuild task or using the standard exec task would be enough to invoke the tests after the build.

As long as the test runner is installed properly, it should just pick up these tests and execute them.

See this blog post explaining all the command line intricacies of the new vstest.console.exe .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM