[erlang-questions] Probably a dumb eunit question

16 views
Skip to first unread message

Rudolph van Graan

unread,
Oct 1, 2012, 6:40:19 AM10/1/12
to erlang-q...@erlang.org
I have one test case that fails because something it calls crashes. I see this output after running the test:

======================== EUnit ========================
*failed*
::undef
=======================================================
  Failed: 1.  Skipped: 0.  Passed: 0.


I know WHY it fails. The test consists of this single line of code:

 ?assertMatch(ok,my_app:install()),

If I change the assertMatch to assertError, I get the real reason for the crash:

*failed*
::{assertException_failed,
    [{module,cache_tests},
     {line,45},
     {expression,"app : install ( )"},
     {pattern,"{ error , ok , [...] }"},
     {unexpected_exception,
         {error,undef,
             [{util,get_value,[frag_properties,[{...}|...]],[]},
              {app,'-install/2-fun-0-',4,[{...}|...]},
              {lists,foldl,3,[...]},
              {app,install,2,...},
              {cache_tests,'-start_stop/0-fun-0-',...},
              {cache_tests,...},
              {...}|...]}}]}

My question is... what am I doing wrong so that I don't get the crash stack and details when I just use assertMatch(...) ?

Thanks,

R

Magnus Henoch

unread,
Oct 1, 2012, 8:27:01 AM10/1/12
to Rudolph van Graan, erlang-q...@erlang.org
Rudolph van Graan <rvg.m...@me.com> writes:

> I have one test case that fails because something it calls crashes. I
> see this output after running the test:
>
> ======================== EUnit ========================
> *failed*
> ::undef
> =======================================================
> Failed: 1. Skipped: 0. Passed: 0.

[...]

> My question is... what am I doing wrong so that I don't get the crash
> stack and details when I just use assertMatch(...) ?

Are you using R15B or R15B01? The lack of stack traces in eunit is a
known problem, fixed in R15B02.

Regards,
Magnus
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
Reply all
Reply to author
Forward
0 new messages