locked
Automating C++ unit test runs for Windows Metro RRS feed

  • Question

  • I've recently decided to add a native unit test project to my Windows Metro app, and I need a way to run these tests in an automated fashion on the build server. Basically, I'm looking for something similar to MSTest.exe - a utility which is great for running tests from batch files and/or scripts.

    In fact, I've tried using the new version of MSTest.exe that comes with VS11 on a generated test .dll, but it fails with the error:

    "Unable to load the test container 'test.dll' or one of its dependencies... Error details: Could not load file or assembly file://test.dll' or one of its dependencies. The Module was expected to contain an assembly manifest."

    So, does MSTest.exe work with test containers that contain WinRT code? If not, is there a utility that will do what I want?

    Thanks for looking.

    Edit: I just found out that MSTest does not support running tests on a Metro style app. Found here: http://msdn.microsoft.com/en-us/library/ms253138%28v=vs.110%29.aspx This really is too bad. I'm still hoping there's a utility out there that will work.
    Wednesday, April 18, 2012 6:16 PM

Answers

  • After blindly digging through the VS folders, I happened to find a new test runner under:

    C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

    This utility allows you to execute WinRT unit tests from the command line. It's very similar to MSTest.exe.

    There doesn't seem to be any documentation out there for this yet, but at least a help command exists.

    • Marked as answer by JSAndrew Wednesday, April 18, 2012 11:35 PM
    Wednesday, April 18, 2012 11:35 PM

All replies

  • After blindly digging through the VS folders, I happened to find a new test runner under:

    C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

    This utility allows you to execute WinRT unit tests from the command line. It's very similar to MSTest.exe.

    There doesn't seem to be any documentation out there for this yet, but at least a help command exists.

    • Marked as answer by JSAndrew Wednesday, April 18, 2012 11:35 PM
    Wednesday, April 18, 2012 11:35 PM
  • Hi JSAndrew,

    Glad to see this issue has been resolved and thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Have a nice day,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, April 19, 2012 1:39 AM
  • Hi JSAndrew,

    Thanks for sharing your feedback. Glad that issue is resolved and you figured out new test runner vstest.console.exe. 
    <pacakge>.appx can be used to execute tests for Windows Metro style, specifying .dll will not execute tests in appcontainer mode in which Metro style apps runs.

    I added some info about how to execute Tests for Metro style apps at
    Running Unit Tests for Windows Metro style apps from Command Line


    Regards,
    Vikram Agrawal,
    Developer, VSTLM, Microsoft Corporation

    Saturday, May 12, 2012 9:15 AM