unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* code coverage mode?
@ 2009-10-22  7:25 m h
  2009-10-22 15:48 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: m h @ 2009-10-22  7:25 UTC (permalink / raw)
  To: emacs-devel

Hey all-

I'm implementing emacs support for code coverage tools in python.

I've currently got some code [0], that will show coverage data in two ways:

* flymake mode
* compile mode

I like the flymake style, yet I still want to really use flymake for
how it was intended.  (Plus I don't want to be re-running coverage
analysis on every change, since it only really changes when you
instrument the code.  Also if you edit the code then your coverage
data is probably stale (unless you're clever about it, which I'm not)
So I guess in that way it's more like compile mode).  I'm not a lisper
by any means, I'm hacking stuff together here.  But if this were
python then I'd create a subclass of flymake and use that for
coverage, while still using the former for its normal use (syntax
checking).

My recent work has been a simple test finder.  The idea being that you
are working on a function and want to see what kind of coverage you
have for that function.  So you invoke the run-function-tests (or
something similar) and it will run only tests that invoke that
function directly and report coverage on that.  View the results,
tweak the tests to get more coverage.  Rinse, repeat....

So I figure before I go off and hack a kludgey solution, I thought I'd
ask the experts if they have any ideas or suggestions.  It'd be cooler
to implement it the "right way" if others (other languages) could take
advantage of it and use it as well.

thoughts?  Does anyone here care about coverage?  What features would they want?

(if this is OT kindly redirect me to the correct place :))

thanks much!

-matt

0 - http://github.com/mattharrison/pycoverage.el




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: code coverage mode?
  2009-10-22  7:25 code coverage mode? m h
@ 2009-10-22 15:48 ` Stefan Monnier
  2009-10-22 16:17   ` m h
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2009-10-22 15:48 UTC (permalink / raw)
  To: m h; +Cc: emacs-devel

> I like the flymake style, yet I still want to really use flymake for
> how it was intended.  (Plus I don't want to be re-running coverage
[...]
> by any means, I'm hacking stuff together here.  But if this were
> python then I'd create a subclass of flymake and use that for
> coverage, while still using the former for its normal use (syntax
> checking).

So, IIUC you'd like to be able to use flymake in two different ways at
the same time in the same buffer?  It's probably not too difficult to
do, but will require changing flymake for that.

Patches welcome,


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: code coverage mode?
  2009-10-22 15:48 ` Stefan Monnier
@ 2009-10-22 16:17   ` m h
  0 siblings, 0 replies; 3+ messages in thread
From: m h @ 2009-10-22 16:17 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Thu, Oct 22, 2009 at 9:48 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> I like the flymake style, yet I still want to really use flymake for
>> how it was intended.  (Plus I don't want to be re-running coverage
> [...]
>> by any means, I'm hacking stuff together here.  But if this were
>> python then I'd create a subclass of flymake and use that for
>> coverage, while still using the former for its normal use (syntax
>> checking).
>
> So, IIUC you'd like to be able to use flymake in two different ways at
> the same time in the same buffer?  It's probably not too difficult to
> do, but will require changing flymake for that.
>

Yes I want normal flymake, then for code coverage I (think I) want to
turn on coverage-mode which will analyze the coverage data and if the
data is fresher than the file, show the coverage data as well.  Then
when one starts typing some new code (or a new line at least), disable
coverage data because it's stale.  This might seem weird but the
workflow I'm trying to get is working on a particular function,
analyze the coverage for it, and add tests to get full coverage.  My
helper utility provides me the ability to only run tests for that
function rather than a whole suite, so I imagine I'd want a macro to
run coverage-for-function.

> Patches welcome,

yes, they are ;)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-22 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-22  7:25 code coverage mode? m h
2009-10-22 15:48 ` Stefan Monnier
2009-10-22 16:17   ` m h

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).