How to test an EXE with Google Test?

后端 未结 6 1405
梦毁少年i
梦毁少年i 2020-12-03 05:55

I have a C++ project in Visual Studio, and have added another project exclusively for testing. Both of these projects are EXEs (console apps). So how do I use the first proj

6条回答
  •  -上瘾入骨i
    2020-12-03 06:10

    If you want to test a console app you can run a test that opens a console window and run the exe file of the first app. Then in your googletest catch the standard output from the exe you just ran.

    [For more control over the first app you might need to have the first app parse arguments sent to it, e.g. some flags like -x or what ever you need.]

提交回复
热议问题