Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better diagnostics output #4

Open
evnu opened this issue Jan 6, 2017 · 0 comments
Open

Provide better diagnostics output #4

evnu opened this issue Jan 6, 2017 · 0 comments
Assignees

Comments

@evnu
Copy link
Owner

evnu commented Jan 6, 2017

Failed test cases are currently (as of d79a879) reported in the usual stack-tracy way:

./doctest -pa ebin -pa apps/examples/ebin -source apps/examples/src/failing.erl
escript: exception error: no match of right hand side value no_fail
  in function  doctest_2:run/0 (, line 4)
  in call from doctest:'-run/1-lc$^0/1-0-'/1 (src/doctest.erl, line 33)
  in call from doctest:'-main/1-lc$^0/1-0-'/1 (src/doctest.erl, line 20)
  in call from escript:run/2 (escript.erl, line 757)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3

When running doctest against multiple files, the output does not indicate which test actually failed:

./doctest -pa ebin -pa apps/examples/ebin -source apps/examples/src/ex1.erl apps/examples/src/failing_edgecase.erl apps/examples/src/failing.erl 
No problems with side effects
escript: exception error: no match of right hand side value no_fail
  in function  doctest_18:run/0 (, line 4)
  in call from doctest:'-run/1-lc$^0/1-0-'/1 (src/doctest.erl, line 33)
  in call from doctest:'-main/1-lc$^0/1-0-'/1 (src/doctest.erl, line 20)
  in call from doctest:'-main/1-lc$^0/1-0-'/1 (src/doctest.erl, line 20)
  in call from escript:run/2 (escript.erl, line 757)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3

A better output would be something like this:

[success] apps/examples/src/ex1.er
[success] apps/examples/src/failing_edgecase.erl
[failed] apps/examples/src/failing.erl
escript: exception error: no match of right hand side value no_fail
  in function  doctest_18:run/0 (, line 4)

The stacktrace should be cropped to the important part (the actual test), and each file should be mentioned specifically.

@evnu evnu self-assigned this Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant