Running native VS2012/C++ 64-bit unit tests from command line

后端 未结 2 1089
感动是毒
感动是毒 2021-02-04 07:00

I\'m attempting to run unit tests from the command line. I tried using the mstest.exe program using the following command:

E:\\VS Projects\\...\\>\"C:\\Progra         


        
相关标签:
2条回答
  • 2021-02-04 07:09

    Thanks for Hans Passant for guidance.

    The solution is to use:

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

    0 讨论(0)
  • 2021-02-04 07:23

    Another option is to install Catch2 which allows you to run the unit testing project as an exe from the command prompt and display the results:

    https://github.com/catchorg/Catch2

    C:\Projects\T9Predict\T9PredictTests\Debug\> T2PredictTests.exe
    T2PredictTests.exe
    
    C:\Projects\T9Predict\T9PredictTests\T2PredictTests.cpp(33): FAILED!
      REQUIRE( result[0] == "hello" )
    with expansion:
      "" == "hello
    ===============================================================================
    test cases: 2 | 1 passed | 1 failed
    assertions: 2 | 1 passed | 1 failed
    
    0 讨论(0)
提交回复
热议问题