why does ts call (an undefined) end_per_suite?

Siri Hansen (EAB) <>
Mon Jul 12 15:27:27 CEST 2004


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östa Ask (Mobile Arts)" wrote:
> 
> 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östa Ask
>    Mobile Arts
> 
> ====================================== LOG ==========================================
> === source code for twoprim_ST_SA_FO_C_SUITE:end_per_suite/1
> 
> === Test case started with:
> twoprim_ST_SA_FO_C_SUITE:end_per_suite[[{nr_of_errors,0},
>                                          {data_dir,
>                                              "/home/askg/TestDir/TestServer/tusker_test/twoprim_ST_SA_FO_C_SUITE_data/"},
>                                          {priv_dir,
>                                              "/home/askg/TestDir/TestServer/test_server/tusker.logs/run.2004-07-12_14.19.21/log_private"},
>                                          {nodes,[]}]]
> 
> === Current directory is "/home/askg/TestDir/TestServer/test_server"
> 
> === Started at 2004-07-12 14:20:57
> === Ended at 2004-07-12 14:20:57
> === location {twoprim_ST_SA_FO_C_SUITE,end_per_suite}
> === reason={undef,[{twoprim_ST_SA_FO_C_SUITE,
>                     end_per_suite,
>                     [[{nr_of_errors,0},
>                       {data_dir,"/home/askg/TestDir/TestServer/tusker_test/twoprim_ST_SA_FO_C_SUITE_data/"},
>                       {priv_dir,"/home/askg/TestDir/TestServer/test_server/tusker.logs/run.2004-07-12_14.19.21/log_private"},
>                       {nodes,[]}]]},
>                 {test_server,my_apply,3},
>                 {test_server,ts_tc,3},
>                 {test_server,run_test_case_eval,6}]}



More information about the erlang-bugs mailing list