unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Masatake YAMATO <jet@gyve.org>
Subject: gcov support in compile.el
Date: Tue, 05 Apr 2005 20:45:06 +0900 (JST)	[thread overview]
Message-ID: <20050405.204506.90075440.jet@gyve.org> (raw)

I have written a regexp to handle a gcov output in compile.el.

2005-04-05  Masatake YAMATO  <jet@gyve.org>

	* progmodes/compile.el (compilation-error-regexp-alist-alist): Add
	regexp for gcov.

2005-04-05  Masatake YAMATO  <jet@gyve.org>

	* compilation.txt (symbol): Added gcov-file 
	gcov-bb-file gcov-never-called-line gcov-called-line .

Masatake YAMATO

Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.348
diff -u -r1.348 compile.el
--- lisp/progmodes/compile.el	29 Mar 2005 04:56:44 -0000	1.348
+++ lisp/progmodes/compile.el	5 Apr 2005 11:46:02 -0000
@@ -280,7 +280,18 @@
 
     (4bsd
      "\\(?:^\\|::  \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
-\\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3)))
+\\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3))
+
+    (gcov-file
+     "^ +-:    \\(0\\):Source:\\(.+\\)$" 2 1 nil 0)    
+    (gcov-bb-file
+     "^ +-:    \\(0\\):Object:\\(?:.+\\)$" nil 1 nil 0)    
+    (gcov-never-called-line
+     "^ +\\(#####\\): +\\([0-9]+\\):.+$" nil 2 nil 2 nil 
+     (1 compilation-error-face))
+    (gcov-called-line
+     "^ +[-0-9]+: +\\([1-9]\\|[0-9]\\{2,\\}\\):.*$" nil 1 nil 0)
+)
   "Alist of values for `compilation-error-regexp-alist'.")
 
 (defcustom compilation-error-regexp-alist
@@ -1839,6 +1850,9 @@
 	  ;; don't use a marker.  --Stef
 	  (if (> pos (point-min)) (copy-marker (1- pos)) pos))))
 
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.gcov$" . compilation-mode))
+
 (provide 'compile)
 
 ;; arch-tag: 12465727-7382-4f72-b234-79855a00dd8c
Index: etc/compilation.txt
===================================================================
RCS file: /cvsroot/emacs/emacs/etc/compilation.txt,v
retrieving revision 1.8
diff -u -r1.8 compilation.txt
--- etc/compilation.txt	22 Nov 2004 23:17:26 -0000	1.8
+++ etc/compilation.txt	5 Apr 2005 11:46:02 -0000
@@ -341,6 +341,32 @@
 bloofle defined( /users/wolfgang/foo.c(4) ), but never used
 
 
+* GCOV (test coverage program)
+
+symbol: gcov-file gcov-bb-file gcov-never-called-line gcov-called-line 
+
+        -:    0:Source:foo.c
+        -:    0:Object:foo.bb
+        -:    1:/* $ gcc -fprofile-arcs -ftest-coverage foo.c 
+        -:    2:   $ ./a.out
+        -:    3:   $ gcov foo.c
+        -:    4:   LANG=C gcov foo.c
+        -:    5:   62.50% of 8 lines executed in file foo.c
+        -:    6:   Creating foo.c.gcov.*/
+        -:    7:int
+        -:    8:main(int argc, char ** argv)
+        1:    9:{
+        1:   10:  int r;
+        1:   11:  if (argc == 1)
+        1:   12:    r = 1;
+    #####:   13:  else if (argc == 2)
+    #####:   14:    r = 2;
+        -:   15:  else 
+    #####:   16:    r = 0;
+        1:   17:  return r;
+        -:   18:} 
+
+
 * Directory tracking
 
 Directories are matched via `compilation-directory-matcher'.  Files which are

             reply	other threads:[~2005-04-05 11:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-05 11:45 Masatake YAMATO [this message]
2005-04-05 15:07 ` gcov support in compile.el Stefan Monnier
2005-04-06  3:03 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050405.204506.90075440.jet@gyve.org \
    --to=jet@gyve.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).