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

后端 未结 2 1133
感动是毒
感动是毒 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: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
    

提交回复
热议问题