[erlang-questions] common test not working in OTP R20

arif@REDACTED arif@REDACTED
Fri Sep 1 13:48:15 CEST 2017


I just can't get common test to run on built-from-source OTP 20.0 on a
linux machine.

Trying to run just the skeleton of a small common test suite,
some_SUITE, I get a function_clause error: 
             failed: {error,
                        {ct_framework,init_tc,
                         {function_clause,
                          [{ct_hooks,init_tc,
                            [some_SUITE,my_test_case,
                             [{tc_logfile, ".."},
                              {tc_group_properties,[]},
                              {tc_group_path,[]},
                              {data_dir, ".."},
                              {priv_dir, ""}]],
                            [{file,"ct_hooks.erl"},{line,81}]},
                           {ct_framework,ct_suite_init,4,
                            [{file,"ct_framework.erl"},{line,280}]},
			   {test_server_sup,framework_call,4,
                            [{file,"test_server_sup.erl"},{line,772}]},
                           {test_server,run_test_case_eval,9,
                            [{file,"test_server.erl"},{line,920}]}]}}},
{ct_framework,                                                          
                   init_tc}

I have looked through the source and, for example, in common_test-1.11
we had

init_tc(_Mod, TC, Config) ->
    call(fun call_generic/3, Config, [pre_init_per_testcase, TC]).

However, in common_test-1.15 (OTP 20.0), we have:

init_tc(Mod, {init_per_testcase,TC}, Config) ->
    call(fun call_generic_fallback/3, Config, [pre_init_per_testcase,
Mod, TC]);
init_tc(Mod, {end_per_testcase,TC}, Config) ->
    call(fun call_generic_fallback/3, Config, [pre_end_per_testcase,
Mod, TC]);
init_tc(Mod, TC = error_in_suite, Config) ->
    call(fun call_generic_fallback/3, Config, [pre_init_per_testcase,
Mod, TC]).


Would this mean that in ct_framework:init_tc 
      ct_suite_init(Suite,HookFunc,PostInitHook,Config) when
is_list(Config) ->
         case ct_hooks:init_tc(Suite,HookFunc,Config) of 
	 ...

HookFunc should be {init_per_testcase, TC} and not TC, as it appears to
be happening?

I have also tried the pre-built OTP R20.0 for windows, and that works
fine. 

What am I doing wrong? 

Thanks and best regards
Arif



More information about the erlang-questions mailing list