From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: gcov support in compile.el Date: Tue, 05 Apr 2005 20:45:06 +0900 (JST) Message-ID: <20050405.204506.90075440.jet@gyve.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1112703370 21951 80.91.229.2 (5 Apr 2005 12:16:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Apr 2005 12:16:10 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 05 14:16:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DImxz-0006jM-IE for ged-emacs-devel@m.gmane.org; Tue, 05 Apr 2005 14:15:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DImWq-0001T8-MI for ged-emacs-devel@m.gmane.org; Tue, 05 Apr 2005 07:47:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DImUu-0000lD-Cx for emacs-devel@gnu.org; Tue, 05 Apr 2005 07:45:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DImUr-0000jf-4N for emacs-devel@gnu.org; Tue, 05 Apr 2005 07:45:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DImTL-0008UT-TU for emacs-devel@gnu.org; Tue, 05 Apr 2005 07:43:56 -0400 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DImZt-0007cL-Su for emacs-devel@gnu.org; Tue, 05 Apr 2005 07:50:42 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j35BoT99010691 for ; Tue, 5 Apr 2005 07:50:29 -0400 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j35BoSO26258 for ; Tue, 5 Apr 2005 07:50:28 -0400 Original-Received: from localhost (gls07.tokyo.redhat.com [172.16.32.104]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id j35BoNQo028619 for ; Tue, 5 Apr 2005 20:50:26 +0900 Original-To: emacs-devel@gnu.org X-Mailer: Mew version 4.0.62 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35581 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35581 I have written a regexp to handle a gcov output in compile.el. 2005-04-05 Masatake YAMATO * progmodes/compile.el (compilation-error-regexp-alist-alist): Add regexp for gcov. 2005-04-05 Masatake YAMATO * 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