How do you run your unit tests? Compiler flags? Static libraries?

后端 未结 7 530
情书的邮戳
情书的邮戳 2021-02-04 06:20

I\'m just getting started with TDD and am curious as to what approaches others take to run their tests. For reference, I am using the google testing framework, but I believe the

7条回答
  •  时光取名叫无心
    2021-02-04 07:10

    Personnally, I use another approach that relies a bit on yours:

    I keep the project-to-test intact. If it's an executable, it should stay an executable. You simply create a post build action in order to aggregate all obj files into a static library.

    Then, you can create you test project, linking the test framework and your previously generated static library.

    Here are some topics corresponding to your question:

    • Visual Studio C++: Unit test exe project with google test?
    • Linker error - linking two "application" type projects in order to use Google Test

提交回复
热议问题