[erlang-questions] clarify: init_per_suite/0 in Common Test

Robert Virding robert.virding@REDACTED
Sun Jun 3 19:48:32 CEST 2012


There is a suite/0 for function, described here:

http://www.erlang.org/doc/man/common_test.html#Module:suite-0
http://www.erlang.org/doc/apps/common_test/write_test_chapter.html#id69736

which is an info function for the whole test suite. It is the suite version of the <test-case>/0 function.

Robert

----- Original Message -----
> Hi,
> 
> I suppose Bengt's asking if you can use an info function also with
> init_per_suite. Answer is yes, and it's documented in the user's
> guide, chapter 4.14:
> 
> http://www.erlang.org/doc/apps/common_test/write_test_chapter.html#id71329
> 
> We should add info also in the reference manual that what goes for
> the
> testcase info function, "Testcase()", is valid for config functions
> init/end_per_suite/group too.
> 
> Thanks!
> 
> Best regards,
> Peter
> 
> Ericsson AB, Erlang/OTP
> 
> 
> 2012/5/31, Abdul Fattah Mahran <abdoo.mahran@REDACTED>:
> > Hi Bengt,
> > It is documented
> > http://www.erlang.org/doc/man/common_test.html#Module:init_per_suite-1
> >
> > Module:init_per_suite(Config) -> NewConfig | {skip,Reason} |
> > {skip_and_save,Reason,SaveConfig}
> >
> > Types:
> >  Config = NewConfig = SaveConfig = [{Key,Value}]
> >   Key = atom()
> >   Value = term()
> >   Reason = term()
> >
> >  OPTIONAL
> >
> > This configuration function is called as the first function in the
> > suite.
> > It typically contains initializations which are common for all test
> > cases
> > in the suite, and which shall only be done once. The Config
> > parameter is
> > the configuration data which can be modified here. Whatever is
> > returned
> > from this function is given as Config to all configuration
> > functions and
> > test cases in the suite. If {skip,Reason} is returned, all test
> > cases in
> > the suite will be skipped and Reason printed in the overview log
> > for the
> > suite.
> >
> > For information on save_config and skip_and_save, please see
> > Dependencies
> > between Test Cases and
> > Suites<http://www.erlang.org/doc/apps/common_test/dependencies_chapter.html#save_config>in
> > the User's Guide.
> >
> >
> > Thanks,
> >
> > best regards,
> >
> >
> >
> >
> > On Thu, May 31, 2012 at 8:41 AM, Bengt Kleberg
> > <bengt.kleberg@REDACTED>wrote:
> >
> >> Greetings,
> >>
> >> There is no Module:init_per_suite/0 documented for Common Test
> >> test
> >> suites. Should it be?
> >>
> >>
> >> bengt
> >>
> >>
> >> _______________________________________________
> >> erlang-questions mailing list
> >> erlang-questions@REDACTED
> >> http://erlang.org/mailman/listinfo/erlang-questions
> >>
> >
> >
> >
> > --
> > Thanks
> > Best Regards,
> > Abd El-Fattah Mahran
> > http://www.linkedin.com/in/abdoomahran
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> 



More information about the erlang-questions mailing list