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

后端 未结 7 609
情书的邮戳
情书的邮戳 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 06:55

    I go with #1, some reasons are

    • It allows to check that each lib links correctly
    • You don't want extra code in the product
    • It's easier to debug individual small test programs
    • You may need multiple executables for some tests (like communication tests)

    For C++ build and test, I like to use CMake which can run a selection of the target executables as tests and print a summary of the results.

提交回复
热议问题