This is an automated email from Gerrit.

Tim Newsome ([email protected]) just uploaded a new patch set to Gerrit, which 
you can find at http://openocd.zylin.com/4918

-- gerrit

commit 8c5c252390eac8c61690667371b8db3f4e3ab959
Author: Tim Newsome <[email protected]>
Date:   Thu Feb 14 17:29:56 2019 -0800

    Document how to get code coverage from OpenOCD.
    
    Change-Id: I74ba8bd7797c3b8ed03cffca938f160e76856390
    Signed-off-by: Tim Newsome <[email protected]>

diff --git a/HACKING b/HACKING
index 39d98bb..a6bb6aa 100644
--- a/HACKING
+++ b/HACKING
@@ -77,6 +77,32 @@ patch:
   src/openocd -s ../tcl -f /path/to/openocd.cfg
   @endcode
 
+- Runtime coverage testing
+
+  Apply the following patch to prevent OpenOCD from killing itself:
+  @code
+--- a/src/openocd.c
++++ b/src/openocd.c
+@@ -372,8 +372,6 @@ int openocd_main(int argc, char *argv[])
+
+        if (ERROR_FAIL == ret)
+                return EXIT_FAILURE;
+-       else if (ERROR_OK != ret)
+-               exit_on_signal(ret);
+
+        return ret;
+ }
+  @endcode
+
+  Configure your OpenOCD binary with coverage support as follows:
+  @code
+  LDFLAGS="-fprofile-arcs -ftest-coverage"
+                  CFLAGS="-fprofile-arcs -ftest-coverage" ./configure
+  @endcode
+
+  Now every time OpenOCD is run, coverage info in your build directory is
+  updated. Running `gcov src/path/file.c` will generate a report.
+
 Please consider performing these additonal checks where appropriate
 (especially Clang Static Analyzer for big portions of new code) and
 mention the results (e.g. "Valgrind-clean, no new Clang analyzer

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to