Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

don't clean the stacktrace if the error is in the use of proper funct…

…ions

Otherwise, the next error (not tested, is a simplification of an actually
failing test), with a wrong call to the invalid proper_fs:run_commands/1:

prop_bad_fsm() ->
    ?FORALL(
       Cmds, proper_fsm:commands(?MODULE),
       {H, S, R} = proper_fsm:run_commands(Cmds),
       ?WHENFAIL(report_error(H, S, R), R =:= ok)).

Will fail with undef and an empty stracktrace, which is confusing enough to
drain some time debugging it:

!
Failed: After 1 test(s).
An exception was raised: error:undef.
Stacktrace: [].
[]
  • Loading branch information...
commit c09f24f7d717c8e88819b031885fac2486723f58 1 parent 76f016d
Samuel Rivas samuelrivas authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 src/proper.erl
7 src/proper.erl
@@ -1399,7 +1399,12 @@ threw_exception_aux(Fun, TopMod, TopName, TopArgs) ->
1399 1399 -spec clean_stacktrace(stacktrace()) -> stacktrace().
1400 1400 clean_stacktrace(RawTrace) ->
1401 1401 {Trace,_Rest} = lists:splitwith(fun is_not_proper_call/1, RawTrace),
1402   - Trace.
  1402 + %% If the clean trace is empty it's probably because of a bad call to
  1403 + %% the proper API, so we let the whole stacktrace through
  1404 + case Trace of
  1405 + [] -> RawTrace;
  1406 + _ -> Trace
  1407 + end.
1403 1408
1404 1409 -spec is_not_proper_call(call_record()) -> boolean().
1405 1410 -ifdef(OLD_STACKTRACE_FORMAT).

0 comments on commit c09f24f

Please sign in to comment.
Something went wrong with that request. Please try again.