Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  why does ts call (an undefined) end_per_suite?

gosta.ask at mobilearts.s
Posted: Mon Jul 12, 2004 1:28 pm Reply with quote
Guest
Hi,
I have tried to use a Test Suite which (beside the Test Cases) only has a init_per_suite/1
definition.

-export([init_per_suite/1]).
-export([all/1,
tc_register_ok/1, tc_register_nok/1, tc_register_other/1,
tc_activate_ok/1, tc_activate_other/1, tc_deactivate_ok/1,
tc_deactivate_other/1
]).

all/1 looks this way

% Exported Test Specification (executed once)
all(suite) ->
[tc_register_ok, tc_register_nok, tc_register_other,
tc_activate_ok, tc_activate_other, tc_deactivate_ok, tc_deactivate_other].

Yet the following is reported in the log:

[...]
8 twoprim_ST_SA_FO_C_SUITE tc_deactivate_other 8.313 s FAILED {twoprim_ST_SA_FO_C_SUITE,tc_deactivate_other}
Fatal,error or alarm
9 twoprim_ST_SA_FO_C_SUITE end_per_suite 0.000 s FAILED {twoprim_ST_SA_FO_C_SUITE,end_per_suite}
[...]

And if you look at the log for Test Case 9 you can see that it tries to call end_per_suite.
Why is that? Is end_per_suite somehow linked to init_per_suite? Do you have to define
both or none?

Best regards,
/G
siri at erix.ericsson.se
Posted: Mon Jul 12, 2004 1:29 pm Reply with quote
Guest
Yes, init_per_suite and end_per_suite are "linked". The reason is that
they are implemented as a normal "conf case", i.e.

{conf,init_per_suite, CaseList, end_per_suite},

and a conf case requires both the init and end function. I'll fix the
documentation.

/siri

"G

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum