Loading ...
Sorry, an error occurred while loading the content.

Re: ounit suppresses stderr

Expand Messages
  • Sylvain Le Gall
    Hello, ... OUnit is not suppressing stderr, it catch exception and don t print stacktrace. There is a patch pending in Debian BTS about this:
    Message 1 of 2 , Aug 9, 2009
    • 0 Attachment
      Hello,

      On 09-08-2009, Sashan Govender <sashang@...> wrote:
      > --8ti626YLfjfZc8aviyGlG-Gb1NE7OrSAaSTHQHu
      > Content-Type: text/plain; charset=ISO-8859-1
      > Content-Transfer-Encoding: 7bit
      >
      > Hi
      >
      > Does oUnit suppress stderr? I have some code that is throwing an an
      > index out of bounds exception in one of my oUnit tests. The output I
      > get from oUnit is
      >
      > ...E.
      >======================================================================
      > Error: test_suite:3:insertion tests
      >
      > Invalid_argument("index out of bounds")
      > ----------------------------------------------------------------------
      > Ran: 5 tests in: 0.00 seconds.
      > FAILED: Cases: 5 Tried: 5 Errors: 1 Failures: 0 Skip:0 Todo:0
      >
      >
      > Whereas if I run the failing code without using oUnit I get the
      > following stack trace:
      >
      > Fatal error: exception Invalid_argument("index out of bounds")
      > Raised at file "BPlusTree.ml", line 189, characters 4-46
      > Called from file "BPlusTree.ml", line 204, characters 6-112
      > Called from file "BPlusTree.ml", line 273, characters 8-25
      > Called from file "BPlusTree.ml", line 275, characters 8-23
      > Called from file "simple.ml", line 33, characters 10-34
      >
      >
      > So how can I convince oUnit to show me the stack trace?
      >

      OUnit is not suppressing stderr, it catch exception and don't print
      stacktrace.

      There is a patch pending in Debian BTS about this:
      http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528603

      You can take a look at it to implement your own catch and print
      stacktrace...

      Regards
      Sylvain Le Gall
    Your message has been successfully submitted and would be delivered to recipients shortly.