How to do code coverage on embedded

前端 未结 3 1380
你的背包
你的背包 2021-02-06 08:58

I write a project for a non POSIX embedded system so I cannot use gcc option --coverage (i don\'t have read or write). What else can I do to produce gcov like output. I do have

3条回答
  •  温柔的废话
    2021-02-06 09:46

    Our family of C/C++ test coverage tools instrument the source code, producing a program you compile with you embedded compiler, that will collect test coverage data into a "small" data structure added to the program. This works with various dialects including ANSI, GCC, Microsoft and GreenHills.

    You have to export that data structure from the embedded execution context to a file on a PC; this is often easy to do with a spare serial or parallel port and a small bit of custom code specific to your port. The tools will provide test coverage views and summaries with that resulting files.

    So, you can use these tools to collect test coverage data from your embedded system, in most practical circumstances.

提交回复
热议问题