File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,32 @@ patch:
7777 src/openocd -s ../tcl -f /path/to/openocd.cfg
7878 @endcode
7979
80+ - Runtime coverage testing
81+
82+ Apply the following patch to prevent OpenOCD from killing itself:
83+ @code
84+ --- a/src/openocd.c
85+ +++ b/src/openocd.c
86+ @@ -372,8 +372,6 @@ int openocd_main(int argc, char *argv[])
87+
88+ if (ERROR_FAIL == ret)
89+ return EXIT_FAILURE;
90+ - else if (ERROR_OK != ret)
91+ - exit_on_signal(ret);
92+
93+ return ret;
94+ }
95+ @endcode
96+
97+ Configure your OpenOCD binary with coverage support as follows:
98+ @code
99+ LDFLAGS="-fprofile-arcs -ftest-coverage"
100+ CFLAGS="-fprofile-arcs -ftest-coverage" ./configure
101+ @endcode
102+
103+ Now every time OpenOCD is run, coverage info in your build directory is
104+ updated. Running `gcov src/path/file.c` will generate a report.
105+
80106Please consider performing these additonal checks where appropriate
81107(especially Clang Static Analyzer for big portions of new code) and
82108mention the results (e.g. "Valgrind-clean, no new Clang analyzer
You can’t perform that action at this time.
0 commit comments