all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Aleksei Gusev <aleksei.gusev@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] (compilation-error-regexp-alist-alist): added regexps for ruby backtraces, ruby's Test::Unit output, cucumber output.
Date: Sat, 10 Jul 2010 08:29:17 +0300	[thread overview]
Message-ID: <87r5jbq502.fsf@gmail.com> (raw)
In-Reply-To: 871vbdptnn.fsf@gmail.com


Is there any chance to get apply this patch on trunk? Maybe I do
something wrong in codebase?

I think many rubists will be very appreciated if Emacs will know about
ruby backtraces out of the box. ;]

Aleksei Gusev <aleksei.gusev@gmail.com> writes:

> Signed-off-by: Aleksei Gusev <aleksei.gusev@gmail.com>
> ---
>  etc/compilation.txt       |  102 +++++++++++++++++++++++++++++++++++++++++++--
>  lisp/progmodes/compile.el |   13 +++++-
>  2 files changed, 110 insertions(+), 5 deletions(-)
>
> diff --git a/etc/compilation.txt b/etc/compilation.txt
> index d6a236d..2041b7f 100644
> --- a/etc/compilation.txt
> +++ b/etc/compilation.txt
> @@ -93,6 +93,55 @@ symbol: comma
>  "foo.adb", line 2(11): warning: file name does not match ...
>  "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment.
>  
> +* Cucumber
> +
> +symbol: cucumber
> +
> +Feature: This is an example for backtrace.
> +
> +  Scenario: undefined step  # features/cucumber.feature:3
> +    Given this is undefined # features/cucumber.feature:4
> +
> +  Scenario: assertion false (Test::Unit)    # features/cucumber.feature:6
> +    Given this will generate 'assert false' # features/step_definitions/default_steps.rb:1
> +      <false> is not true. (Test::Unit::AssertionFailedError)
> +      /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block'
> +      /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion'
> +      /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block'
> +      /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert'
> +      /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion'
> +      /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert'
> +      ./features/step_definitions/default_steps.rb:2:in `/^this will generate 'assert false'$/'
> +      features/cucumber.feature:7:in `Given this will generate 'assert false''
> +
> +  Scenario: assertion false (RSpec)           # features/cucumber.feature:9
> +    Given this will generate 'should be_true' # features/step_definitions/default_steps.rb:5
> +      expected true to be false (Spec::Expectations::ExpectationNotMetError)
> +      ./features/step_definitions/default_steps.rb:6:in `/^this will generate 'should be_true'$/'
> +      features/cucumber.feature:10:in `Given this will generate 'should be_true''
> +
> +  Scenario: backtrace in step definition # features/cucumber.feature:12
> +    Given this will generate backtrace   # features/step_definitions/default_steps.rb:9
> +       (RuntimeError)
> +      ./features/step_definitions/default_steps.rb:10:in `/^this will generate backtrace$/'
> +      features/cucumber.feature:13:in `Given this will generate backtrace'
> +
> +  Scenario: deeep backtrace in step definition # features/cucumber.feature:15
> +    Given this will generate deep backtrace    # features/step_definitions/default_steps.rb:13
> +       (RuntimeError)
> +      ./features/step_definitions/default_steps.rb:18:in `deep'
> +      ./features/step_definitions/default_steps.rb:14:in `/^this will generate deep backtrace$/'
> +      features/cucumber.feature:16:in `Given this will generate deep backtrace'
> +
> +Failing Scenarios:
> +cucumber features/cucumber.feature:6 # Scenario: assertion false (Test::Unit)
> +cucumber features/cucumber.feature:9 # Scenario: assertion false (RSpec)
> +cucumber features/cucumber.feature:12 # Scenario: backtrace in step definition
> +cucumber features/cucumber.feature:15 # Scenario: deeep backtrace in step definition
> +
> +5 scenarios (4 failed, 1 undefined)
> +5 steps (4 failed, 1 undefined)
> +0m0.007s
>  
>  * EDG C/C++
>  
> @@ -318,6 +367,51 @@ symbol: php
>  Parse error: parse error, unexpected $ in main.php on line 59
>  Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66
>  
> +* Ruby
> +
> +symbol: ruby
> +
> +plain-exception.rb:7:in `fun': unhandled exception
> +	from plain-exception.rb:3:in `proxy'
> +	from plain-exception.rb:12
> +
> +* Ruby (Test::Unit)
> +
> +symbol: ruby-Test::Unit
> +
> +Loaded suite examples/test-unit
> +Started
> +FFFE
> +Finished in 0.023173 seconds.
> +
> +  1) Failure:
> +test_a_deep_assert(BacktracesTest)
> +    [examples/test-unit.rb:28:in `here_is_a_deep_assert'
> +     examples/test-unit.rb:19:in `test_a_deep_assert']:
> +<false> is not true.
> +
> +  2) Failure:
> +test_assert(BacktracesTest) [examples/test-unit.rb:5]:
> +<false> is not true.
> +
> +  3) Failure:
> +test_assert_raise(BacktracesTest) [examples/test-unit.rb:9]:
> +Exception raised:
> +Class: <RuntimeError>
> +Message: <"">
> +---Backtrace---
> +examples/test-unit.rb:10:in `test_assert_raise'
> +examples/test-unit.rb:9:in `test_assert_raise'
> +---------------
> +
> +  4) Error:
> +test_backtrace(BacktracesTest):
> +NoMethodError: undefined method `not_exists' for nil:NilClass
> +    examples/test-unit.rb:24:in `some_function_call_from_nil'
> +    examples/test-unit.rb:15:in `test_backtrace'
> +
> +4 tests, 3 assertions, 3 failures, 1 errors
> +
>  * RXP
>  
>  symbol: rxp
> @@ -375,11 +469,11 @@ 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 
> +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 
> +        -:    1:/* $ gcc -fprofile-arcs -ftest-coverage foo.c
>          -:    2:   $ ./a.out
>          -:    3:   $ gcov foo.c
>          -:    4:   LANG=C gcov foo.c
> @@ -393,10 +487,10 @@ symbol: gcov-file gcov-bb-file gcov-never-called-line gcov-called-line
>          1:   12:    r = 1;
>      #####:   13:  else if (argc == 2)
>      #####:   14:    r = 2;
> -        -:   15:  else 
> +        -:   15:  else
>      #####:   16:    r = 0;
>          1:   17:  return r;
> -        -:   18:} 
> +        -:   18:}
>  
>  
>  * Podchecker error messages, per Pod::Checker
> diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
> index 7000b4b..e9cf5d4 100644
> --- a/lisp/progmodes/compile.el
> +++ b/lisp/progmodes/compile.el
> @@ -196,6 +196,10 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
>       "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\
>  \\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 3 (4))
>  
> +    (cucumber
> +     "\\(?:^cucumber\\(?: -p [^[:space:]]+\\)?\\|#\\)\
> +\\(?: \\)\\([^\(].*\\):\\([1-9][0-9]*\\)" 1 2)
> +
>      (edg-1
>       "^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)"
>       1 2 nil (3 . 4))
> @@ -325,6 +329,13 @@ during global destruction\\.$\\)" 1 2)
>       "\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)"
>       2 3 nil nil)
>  
> +    (ruby
> +     "^[\t ]*\\(?:from \\)?\
> +\\([^\(\n][^[:space:]\n]*\\):\\([1-9][0-9]*\\)\\(:in `.*'\\)?.*$" 1 2)
> +
> +    (ruby-Test::Unit
> +     "[\t ]*\\[\\([^\(].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:" 1 2)
> +
>      (rxp
>       "^\\(?:Error\\|Warnin\\(g\\)\\):.*\n.* line \\([0-9]+\\) char\
>   \\([0-9]+\\) of file://\\(.+\\)"
> @@ -2083,7 +2094,7 @@ and overlay is highlighted between MK and END-MK."
>                  pre-existing
>                (let ((display-buffer-reuse-frames t)
>                      (pop-up-windows t))
> -	        ;; Pop up a window.
> +		;; Pop up a window.
>                  (display-buffer (marker-buffer msg)))))
>  	 (highlight-regexp (with-current-buffer (marker-buffer msg)
>  			     ;; also do this while we change buffer

-- 
WBR, Aleksei Gusev




  reply	other threads:[~2010-07-10  5:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08 20:16 [PATCH] (compilation-error-regexp-alist-alist): added regexps for ruby backtraces, ruby's Test::Unit output, cucumber output Aleksei Gusev
2010-07-10  5:29 ` Aleksei Gusev [this message]
2010-07-10 19:48 ` Chong Yidong
2010-08-02 13:54   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=87r5jbq502.fsf@gmail.com \
    --to=aleksei.gusev@gmail.com \
    --cc=emacs-devel@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.