ciera / crystalsaf

Automatically exported from code.google.com/p/crystalsaf
3 stars 2 forks source link

unit tests will not fail from analysis exceptions #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write a crystal analysis that throws a RuntimeException
2. Run a Crystal unit test that runs the analysis from (1) and triggers the 
exception

What is the expected output? What do you see instead?
Unit test should fail but succeeds instead (with the thrown exception logged on 
the console)

Please use labels and text to provide additional information.
This used to work but now happens at least since r315 because Crystal now 
swallows any Throwable coming out of an analysis run.  Hence assigning to 
Ciera, who committed r315 I think.  

We could just re-throw the exception, but from the commit comment on r315 I 
guess that that's not what we want (we want to analyze any remaining comp units 
anyway).  Instead, we probably want to cache the thrown exception an rethrow 
later.  As an aside, I think we should at most intercept RuntimeExceptions in 
this way: I don't like the idea of swallowing Errors like OutOfMemoryError and 
keep going.

Original issue reported on code.google.com by kevin.bi...@gmail.com on 12 Dec 2010 at 6:30

GoogleCodeExporter commented 9 years ago
Yeah, I agree. I am pretty sure this used to work...

Original comment by nels.bec...@gmail.com on 13 Dec 2010 at 3:48

GoogleCodeExporter commented 9 years ago
Fixed with r329 : Crystal now catches exceptions and rethrows at the end of the 
Crystal run.  Thus Crystal will run over all selected comp units *and* fail at 
the end if there were exceptions.  That in particular lets unit tests fail 
(which only run Crystal on one compilation unit at a time).

Original comment by kevin.bi...@gmail.com on 15 May 2011 at 4:45

GoogleCodeExporter commented 9 years ago
Yay!

Original comment by nels.bec...@gmail.com on 16 May 2011 at 9:44

GoogleCodeExporter commented 9 years ago
Yeah it's much better now.  This is part of a bigger commit where you can also 
run Crystal on .class files now, see issue #26 I think.  It's pretty neat!

Original comment by kevin.bi...@gmail.com on 17 May 2011 at 2:17