beeware / cricket

A GUI tool for running Python test suites.
BSD 3-Clause "New" or "Revised" License
213 stars 68 forks source link

Console output for failed tests #33

Open spookylukey opened 10 years ago

spookylukey commented 10 years ago

This seems like a great tool, but lacking a key feature for me:

The normal test runner outputs to the console in a format that can be parsed by IDEs, allowing you to jump right to the line where you have an error (failed assertion or exception). For example, in Emacs:

http://lukeplant.me.uk/uploads/Screenshot_from_2014-03-31_20_29_37.png

If there was an option for cricket to dump the same output stdout when it ran tests (as they failed - not waiting for the end), this would allow it to be a fantastic drop-in replacement for the normal test runner that keeps the best of both worlds.

Thanks!

freakboy3742 commented 10 years ago

Better integration with editors is definitely something I want to look at. I suppose the question is where the line is drawn. My initial though was that the 'parse and hyperlink' function is something that should be handled on the Cricket side, and given as a directive to the editor to open in a particular location.

Your suggestion seems to be more along the line of "give the whole trace to Emacs, and let Emacs handle the hyperlink". While Emacs is obviously a big player in this space, I'm wary of introducing a feature that would only be useful to Emacs (if only because I don't use Emacs myself :-) That said, I obviously don't want to lock out Emacs users.

I know this is available as a command line option for a bunch of editors (e.g., Sublime Text allows you to run sublimetext main.c:100:12 to open a file at a particular cursor point.); for others, it might require an editor-side plugin. Does Emacs have any comparable options? Or any IPC options for communicating with other processes (e.g., sending data over a pipe)?

spookylukey commented 10 years ago

Yep, emacs has a 'server' mode you can start (M-x server-start), then it looks like:

emacsclient -n +100:12 main.c

That will open main.c, line 100, column 12 in your current emacs process.

Being able to do something like that would certainly be an adequate solution for me. I'm also investigating other test runners - although I haven't found anything else that works just right yet!