Question about Erlang/OTP Test Server and gen_server

Benefits Dragon benefitsdragon@REDACTED
Thu Dec 1 17:07:48 CET 2005


Yes it is normal behaviour, if you want the gen_server crashing to be
reported as a failure you have to check whether it is still alive at the end
of the test and call 'exit' if it is dead or {testX, ok} if it is.
(You would use the function whereis(Name) to do this, it returns 'undefined'
if it is dead).

I believe the reason behind this is that it is not necessarily a test case
failure if a process crashes, there are many types of test where you are
making sure that a process does crash on a certain scenario or when it does
not necessarily constitue an error.

The test server doesn't automatically link to the modules you are testing,
it only reports a crash as a failure if it was the test case that caused the
error, that means if your test case sends a message to a gen_server it
thinks everything was fine because there was no problems sending the message
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20051201/10232afd/attachment.htm>


More information about the erlang-questions mailing list