rabbitmq/erlando

eunit test run does not detect test failures

Closed this issue · 1 comments

As per subject, if some tests are broken but you run 'eunit' wrapper (via rebar eunit for instance) the result of the run still says

All 3 tests passed.

This seems to happen because test:test/2 wrapper catches all errors (including badmatch) and converts them into error messages (or plain ok if the test has passed), but 'eunit' treats any return from test function as test success.

It is can be easily fixed though: See the commit in my branch

However this stil not quite "eunit-ing": the first error aborts the entire test module run so if there are some other failures they won't be reported untill the first one is fixed. So here is another way to run the existing tests va 'eunit': another commit on another branch. This way all the tests (22 at the moment) are extracted and run with 'eunit' which will report all the failures.

Thanks for this. I've applied your second suggested fix. I never use rebar myself so never look at the erlando_test file. Testing shows your patch works and I'm happy to apply it. Thanks once again.